Vulkan Memory Allocator
|
Description of a Allocator to be created. More...
Public Attributes | |
VmaAllocatorCreateFlags | flags |
Flags for created allocator. Use VmaAllocatorCreateFlagBits enum. | |
VkPhysicalDevice | physicalDevice |
Vulkan physical device. | |
VkDevice | device |
Vulkan device. | |
VkDeviceSize | preferredLargeHeapBlockSize |
Preferred size of a single VkDeviceMemory block to be allocated from large heaps > 1 GiB. Optional. | |
const VkAllocationCallbacks * | pAllocationCallbacks |
Custom CPU memory allocation callbacks. Optional. | |
const VmaDeviceMemoryCallbacks * | pDeviceMemoryCallbacks |
Informative callbacks for vkAllocateMemory , vkFreeMemory . Optional. | |
const VkDeviceSize * | pHeapSizeLimit |
Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap. | |
const VmaVulkanFunctions * | pVulkanFunctions |
Pointers to Vulkan functions. Can be null. | |
VkInstance | instance |
Handle to Vulkan instance object. | |
uint32_t | vulkanApiVersion |
Optional. Vulkan version that the application uses. | |
const VkExternalMemoryHandleTypeFlagsKHR * | pTypeExternalMemoryHandleTypes |
Either null or a pointer to an array of external memory handle types for each Vulkan memory type. | |
Description of a Allocator to be created.
VkDevice VmaAllocatorCreateInfo::device |
Vulkan device.
It must be valid throughout whole lifetime of created allocator.
VmaAllocatorCreateFlags VmaAllocatorCreateInfo::flags |
Flags for created allocator. Use VmaAllocatorCreateFlagBits enum.
VkInstance VmaAllocatorCreateInfo::instance |
Handle to Vulkan instance object.
Starting from version 3.0.0 this member is no longer optional, it must be set!
const VkAllocationCallbacks* VmaAllocatorCreateInfo::pAllocationCallbacks |
Custom CPU memory allocation callbacks. Optional.
Optional, can be null. When specified, will also be used for all CPU-side memory allocations.
const VmaDeviceMemoryCallbacks* VmaAllocatorCreateInfo::pDeviceMemoryCallbacks |
Informative callbacks for vkAllocateMemory
, vkFreeMemory
. Optional.
Optional, can be null.
const VkDeviceSize* VmaAllocatorCreateInfo::pHeapSizeLimit |
Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap.
If not NULL, it must be a pointer to an array of VkPhysicalDeviceMemoryProperties::memoryHeapCount
elements, defining limit on maximum number of bytes that can be allocated out of particular Vulkan memory heap.
Any of the elements may be equal to VK_WHOLE_SIZE
, which means no limit on that heap. This is also the default in case of pHeapSizeLimit
= NULL.
If there is a limit defined for a heap:
VK_ERROR_OUT_OF_DEVICE_MEMORY
.VkMemoryHeap::size
, the value of this limit will be reported instead when using vmaGetMemoryProperties().Warning! Using this feature may not be equivalent to installing a GPU with smaller amount of memory, because graphics driver doesn't necessary fail new allocations with VK_ERROR_OUT_OF_DEVICE_MEMORY
result when memory capacity is exceeded. It may return success and just silently migrate some device memory blocks to system RAM. This driver behavior can also be controlled using VK_AMD_memory_overallocation_behavior extension.
VkPhysicalDevice VmaAllocatorCreateInfo::physicalDevice |
Vulkan physical device.
It must be valid throughout whole lifetime of created allocator.
VkDeviceSize VmaAllocatorCreateInfo::preferredLargeHeapBlockSize |
Preferred size of a single VkDeviceMemory
block to be allocated from large heaps > 1 GiB. Optional.
Set to 0 to use default, which is currently 256 MiB.
const VkExternalMemoryHandleTypeFlagsKHR* VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes |
Either null or a pointer to an array of external memory handle types for each Vulkan memory type.
If not NULL, it must be a pointer to an array of VkPhysicalDeviceMemoryProperties::memoryTypeCount
elements, defining external memory handle types of particular Vulkan memory type, to be passed using VkExportMemoryAllocateInfoKHR
.
Any of the elements may be equal to 0, which means not to use VkExportMemoryAllocateInfoKHR
on this memory type. This is also the default in case of pTypeExternalMemoryHandleTypes
= NULL.
const VmaVulkanFunctions* VmaAllocatorCreateInfo::pVulkanFunctions |
Pointers to Vulkan functions. Can be null.
For details see Pointers to Vulkan functions.
uint32_t VmaAllocatorCreateInfo::vulkanApiVersion |
Optional. Vulkan version that the application uses.
It must be a value in the format as created by macro VK_MAKE_VERSION
or a constant like: VK_API_VERSION_1_1
, VK_API_VERSION_1_0
. The patch version number specified is ignored. Only the major and minor versions are considered. Only versions 1.0, 1.1, 1.2, 1.3 are supported by the current implementation. Leaving it initialized to zero is equivalent to VK_API_VERSION_1_0
. It must match the Vulkan version used by the application and supported on the selected physical device, so it must be no higher than VkApplicationInfo::apiVersion
passed to vkCreateInstance
and no higher than VkPhysicalDeviceProperties::apiVersion
found on the physical device used.