![]() |
XII Release 0.1.0
|
Vulkan memory allocator wrapper. More...
#include <MemoryAllocatorVulkan.h>
Public Member Functions | |
| vk::Result | Initialize (xiiGALDeviceVulkan *pDeviceVulkan, xiiUInt32 uiPreferredBlockSize=0U) |
| Constructs the memory allocator with Vulkan instance, physical device, and logical device. | |
| void | DeInitialize () |
| Cleans up internal resources. | |
| vk::Result | CreateBuffer (const vk::BufferCreateInfo &vkBufferCreateInfo, const xiiVulkanAllocationCreateInfo &allocationCreateInfo, vk::Buffer &out_buffer, xiiVulkanAllocation &out_allocation, xiiVulkanAllocationInfo *pAllocationInfo=nullptr) const |
| Creates a Vulkan buffer and allocates memory for it. | |
| void | DestroyBuffer (vk::Buffer &vkBuffer, xiiVulkanAllocation &allocation) const |
| Destroys a Vulkan buffer and frees its associated memory. | |
| vk::Result | CreateImage (const vk::ImageCreateInfo &vkImageCreateInfo, const xiiVulkanAllocationCreateInfo &allocationCreateInfo, vk::Image &out_image, xiiVulkanAllocation &out_allocation, xiiVulkanAllocationInfo *pAllocationInfo=nullptr) const |
| Creates a Vulkan image and allocates memory for it. | |
| void | DestroyImage (vk::Image &vkImage, xiiVulkanAllocation &allocation) const |
| Destroys a Vulkan image and frees its associated memory. | |
| xiiVulkanAllocationInfo | GetAllocationInfo (xiiVulkanAllocation allocation) const |
| Retrieves detailed information about a memory allocation. | |
| vk::MemoryPropertyFlags | GetMemoryPropertyFlags (xiiVulkanAllocation allocation) const |
| Returns the memory property flags for a given allocation. | |
| void | SetAllocationUserData (xiiVulkanAllocation allocation, const char *pUserData) const |
| Sets user-defined metadata for a memory allocation. | |
| vk::Result | MapMemory (xiiVulkanAllocation allocation, void **pData) const |
| Maps a memory allocation to a CPU-accessible pointer. | |
| void | UnmapMemory (xiiVulkanAllocation allocation) const |
| Unmaps a previously mapped memory allocation. | |
| vk::Result | FlushAllocation (xiiVulkanAllocation allocation, vk::DeviceSize offset=0U, vk::DeviceSize size=vk::WholeSize) const |
| Flushes a memory allocation to ensure GPU visibility. | |
| vk::Result | InvalidateAllocation (xiiVulkanAllocation allocation, vk::DeviceSize offset=0U, vk::DeviceSize size=vk::WholeSize) const |
| Invalidates a memory allocation to ensure CPU visibility. | |
| xiiVulkanMemoryStatistics | GetStatistics () const |
| Returns current memory usage statistics. | |
Vulkan memory allocator wrapper.
Provides high-level allocation and resource management for Vulkan buffers and images. Internally wraps Vulkan Memory Allocator (VMA) or custom logic to simplify memory handling.
| vk::Result xiiVulkanMemoryAllocator::CreateBuffer | ( | const vk::BufferCreateInfo & | vkBufferCreateInfo, |
| const xiiVulkanAllocationCreateInfo & | allocationCreateInfo, | ||
| vk::Buffer & | out_buffer, | ||
| xiiVulkanAllocation & | out_allocation, | ||
| xiiVulkanAllocationInfo * | pAllocationInfo = nullptr ) const |
Creates a Vulkan buffer and allocates memory for it.
| vkBufferCreateInfo | - Buffer creation parameters. |
| allocationCreateInfo | - Allocation configuration. |
| out_buffer | - Output buffer handle. |
| out_allocation | - Output allocation handle. |
| pAllocationInfo | - Optional pointer to receive detailed allocation info. |
| vk::Result xiiVulkanMemoryAllocator::CreateImage | ( | const vk::ImageCreateInfo & | vkImageCreateInfo, |
| const xiiVulkanAllocationCreateInfo & | allocationCreateInfo, | ||
| vk::Image & | out_image, | ||
| xiiVulkanAllocation & | out_allocation, | ||
| xiiVulkanAllocationInfo * | pAllocationInfo = nullptr ) const |
Creates a Vulkan image and allocates memory for it.
| vkImageCreateInfo | - Image creation parameters. |
| allocationCreateInfo | - Allocation configuration. |
| out_image | - Output image handle. |
| out_allocation | - Output allocation handle. |
| pAllocationInfo | - Optional pointer to receive detailed allocation info. |
| void xiiVulkanMemoryAllocator::DestroyBuffer | ( | vk::Buffer & | vkBuffer, |
| xiiVulkanAllocation & | allocation ) const |
Destroys a Vulkan buffer and frees its associated memory.
| vkBuffer | - Buffer to destroy. |
| allocation | - Allocation handle to free. |
| void xiiVulkanMemoryAllocator::DestroyImage | ( | vk::Image & | vkImage, |
| xiiVulkanAllocation & | allocation ) const |
Destroys a Vulkan image and frees its associated memory.
| vkImage | - Image to destroy. |
| allocation | - Allocation handle to free. |
| vk::Result xiiVulkanMemoryAllocator::FlushAllocation | ( | xiiVulkanAllocation | allocation, |
| vk::DeviceSize | offset = 0U, | ||
| vk::DeviceSize | size = vk::WholeSize ) const |
Flushes a memory allocation to ensure GPU visibility.
| allocation | - Allocation handle. |
| offset | - Byte offset to flush from. |
| size | - Number of bytes to flush. |
| xiiVulkanAllocationInfo xiiVulkanMemoryAllocator::GetAllocationInfo | ( | xiiVulkanAllocation | allocation | ) | const |
Retrieves detailed information about a memory allocation.
| allocation | - Allocation handle. |
| vk::MemoryPropertyFlags xiiVulkanMemoryAllocator::GetMemoryPropertyFlags | ( | xiiVulkanAllocation | allocation | ) | const |
Returns the memory property flags for a given allocation.
| allocation | - Allocation handle. |
| xiiVulkanMemoryStatistics xiiVulkanMemoryAllocator::GetStatistics | ( | ) | const |
Returns current memory usage statistics.
| vk::Result xiiVulkanMemoryAllocator::Initialize | ( | xiiGALDeviceVulkan * | pDeviceVulkan, |
| xiiUInt32 | uiPreferredBlockSize = 0U ) |
Constructs the memory allocator with Vulkan instance, physical device, and logical device.
| pDeviceVulkan | - The Vulkan device implementation. |
| uiPreferredBlockSize | - Optional preferred block size for allocations. |
| vk::Result xiiVulkanMemoryAllocator::InvalidateAllocation | ( | xiiVulkanAllocation | allocation, |
| vk::DeviceSize | offset = 0U, | ||
| vk::DeviceSize | size = vk::WholeSize ) const |
Invalidates a memory allocation to ensure CPU visibility.
| allocation | - Allocation handle. |
| offset | - Byte offset to invalidate from. |
| size | - Number of bytes to invalidate. |
| vk::Result xiiVulkanMemoryAllocator::MapMemory | ( | xiiVulkanAllocation | allocation, |
| void ** | pData ) const |
Maps a memory allocation to a CPU-accessible pointer.
| allocation | - Allocation handle. |
| pData | - Output pointer to mapped memory. |
| void xiiVulkanMemoryAllocator::SetAllocationUserData | ( | xiiVulkanAllocation | allocation, |
| const char * | pUserData ) const |
Sets user-defined metadata for a memory allocation.
| allocation | - Allocation handle. |
| pUserData | Pointer to user data string. |
| void xiiVulkanMemoryAllocator::UnmapMemory | ( | xiiVulkanAllocation | allocation | ) | const |
Unmaps a previously mapped memory allocation.
| allocation | - Allocation handle. |