Vulkan Memory Allocator
|
Functions | |
VkResult | vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaMemoryRequirements *pVmaMemoryRequirements, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex) |
General purpose memory allocation. More... | |
VkResult | vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaMemoryRequirements *pMemoryRequirements, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex) |
VkResult | vmaAllocateMemoryForImage (VmaAllocator allocator, VkImage image, const VmaMemoryRequirements *pMemoryRequirements, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex) |
Function similar to vmaAllocateMemoryForBuffer(). More... | |
void | vmaFreeMemory (VmaAllocator allocator, const VkMappedMemoryRange *pMemory) |
Frees memory previously allocated using vmaAllocateMemoryForBuffer() or vmaAllocateMemoryForImage(). More... | |
VkResult | vmaMapMemory (VmaAllocator allocator, const VkMappedMemoryRange *pMemory, void **ppData) |
void | vmaUnmapMemory (VmaAllocator allocator, const VkMappedMemoryRange *pMemory) |
VkResult vmaAllocateMemory | ( | VmaAllocator | allocator, |
const VkMemoryRequirements * | pVkMemoryRequirements, | ||
const VmaMemoryRequirements * | pVmaMemoryRequirements, | ||
VkMappedMemoryRange * | pMemory, | ||
uint32_t * | pMemoryTypeIndex | ||
) |
General purpose memory allocation.
[out] | pMemory | Allocated memory. |
[out] | pMemoryTypeIndex | Optional. Index of memory type that has been chosen for this allocation. |
You should free the memory using vmaFreeMemory().
All allocated memory is also automatically freed in vmaDestroyAllocator().
It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(), vmaCreateBuffer(), vmaCreateImage() instead whenever possible.
VkResult vmaAllocateMemoryForBuffer | ( | VmaAllocator | allocator, |
VkBuffer | buffer, | ||
const VmaMemoryRequirements * | pMemoryRequirements, | ||
VkMappedMemoryRange * | pMemory, | ||
uint32_t * | pMemoryTypeIndex | ||
) |
[out] | pMemoryTypeIndex | Optional. Pass null if you don't need this information. |
You should free the memory using vmaFreeMemory().
All allocated memory is also automatically freed in vmaDestroyAllocator().
VkResult vmaAllocateMemoryForImage | ( | VmaAllocator | allocator, |
VkImage | image, | ||
const VmaMemoryRequirements * | pMemoryRequirements, | ||
VkMappedMemoryRange * | pMemory, | ||
uint32_t * | pMemoryTypeIndex | ||
) |
Function similar to vmaAllocateMemoryForBuffer().
void vmaFreeMemory | ( | VmaAllocator | allocator, |
const VkMappedMemoryRange * | pMemory | ||
) |
Frees memory previously allocated using vmaAllocateMemoryForBuffer() or vmaAllocateMemoryForImage().
VkResult vmaMapMemory | ( | VmaAllocator | allocator, |
const VkMappedMemoryRange * | pMemory, | ||
void ** | ppData | ||
) |
Feel free to use vkMapMemory on these memory blocks on you own if you want, but just for convenience and to make sure correct offset and size is always specified, usage of vmaMapMemory() / vmaUnmapMemory() is recommended.
void vmaUnmapMemory | ( | VmaAllocator | allocator, |
const VkMappedMemoryRange * | pMemory | ||
) |