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

The passthrough implementation: one dedicated VkDeviceMemory per buffer, mapped for its lifetime. Every allocation it returns owns its memory and starts at offset zero. More...

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

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

Public Member Functions

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

Detailed Description

The passthrough implementation: one dedicated VkDeviceMemory per buffer, mapped for its lifetime. Every allocation it returns owns its memory and starts at offset zero.

Constructor & Destructor Documentation

◆ DedicatedBufferAllocator()

donner::gpu::vulkan::DedicatedBufferAllocator::DedicatedBufferAllocator ( const VkPhysicalDeviceMemoryProperties & memoryProperties)
inlineexplicit
Parameters
memoryPropertiesPhysical device memory properties, for memory-type selection.

Member Function Documentation

◆ allocate()

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

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.

Implements donner::gpu::vulkan::BufferSuballocator.

◆ release()

void donner::gpu::vulkan::DedicatedBufferAllocator::release ( const VulkanApi & api,
VkDevice device,
BufferAllocation & allocation )
overridevirtual

Releases an allocation obtained from allocate.

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

Implements donner::gpu::vulkan::BufferSuballocator.


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