Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::gpu::vulkan::BufferSuballocator Class Referenceabstract

Supplies the memory a buffer is bound into. More...

#include "donner/gpu/vulkan/VulkanBufferAllocator.h"

Inheritance diagram for donner::gpu::vulkan::BufferSuballocator:
[legend]

Public Member Functions

virtual Result< BufferAllocationallocate (const VulkanApi &api, VkDevice device, VkBuffer buffer, std::string_view label)=0
 Provides memory for buffer and binds it.
virtual void release (const VulkanApi &api, VkDevice device, BufferAllocation &allocation)=0
 Releases an allocation obtained from allocate.

Detailed Description

Supplies the memory a buffer is bound into.

Every buffer this backend allocates is host-visible, host-coherent, and persistently mapped: queue writes are a memcpy and readback needs no staging. An implementation must preserve that, because the rest of the backend reads and writes buffers straight through BufferAllocation::mapped with no flush or invalidate of its own.

Member Function Documentation

◆ allocate()

virtual Result< BufferAllocation > donner::gpu::vulkan::BufferSuballocator::allocate ( const VulkanApi & api,
VkDevice device,
VkBuffer buffer,
std::string_view label )
nodiscardpure virtual

Provides memory for buffer and binds it.

Parameters
apiResolved device entry points.
deviceDevice owning buffer.
bufferBuffer to bind memory into.
labelBuffer label, for failure messages.

Implemented in donner::gpu::vulkan::DedicatedBufferAllocator.

◆ release()

virtual void donner::gpu::vulkan::BufferSuballocator::release ( const VulkanApi & api,
VkDevice device,
BufferAllocation & allocation )
pure virtual

Releases an allocation obtained from allocate.

Parameters
apiResolved device entry points.
deviceDevice owning the allocation.
allocationAllocation to release; left cleared.

Implemented in donner::gpu::vulkan::DedicatedBufferAllocator.


The documentation for this class was generated from the following file: