Pyrogenesis  trunk
Public Member Functions | Public Attributes | List of all members
VmaAllocatorCreateInfo Struct Reference

Description of a Allocator to be created. More...

#include <vk_mem_alloc.h>

Collaboration diagram for VmaAllocatorCreateInfo:
Collaboration graph
[legend]

Public Member Functions

const VkDeviceSize *VMA_NULLABLE VMA_LEN_IF_NOT_NULL ("VkPhysicalDeviceMemoryProperties::memoryHeapCount") 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. More...
 

Public Attributes

VmaAllocatorCreateFlags flags
 Flags for created allocator. Use VmaAllocatorCreateFlagBits enum. More...
 
VkPhysicalDevice VMA_NOT_NULL physicalDevice
 Vulkan physical device. More...
 
VkDevice VMA_NOT_NULL device
 Vulkan device. More...
 
VkDeviceSize preferredLargeHeapBlockSize
 Preferred size of a single VkDeviceMemory block to be allocated from large heaps > 1 GiB. Optional. More...
 
const VkAllocationCallbacks *VMA_NULLABLE pAllocationCallbacks
 Custom CPU memory allocation callbacks. Optional. More...
 
const VmaDeviceMemoryCallbacks *VMA_NULLABLE pDeviceMemoryCallbacks
 Informative callbacks for vkAllocateMemory, vkFreeMemory. Optional. More...
 
const VmaVulkanFunctions *VMA_NULLABLE pVulkanFunctions
 Pointers to Vulkan functions. More...
 
VkInstance VMA_NOT_NULL instance
 Handle to Vulkan instance object. More...
 
uint32_t vulkanApiVersion
 Optional. More...
 

Detailed Description

Description of a Allocator to be created.

Member Function Documentation

◆ VMA_LEN_IF_NOT_NULL()

const VkDeviceSize* VMA_NULLABLE VmaAllocatorCreateInfo::VMA_LEN_IF_NOT_NULL ( "VkPhysicalDeviceMemoryProperties::memoryHeapCount"  )

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:

  • If user tries to allocate more memory from that heap using this allocator, the allocation fails with VK_ERROR_OUT_OF_DEVICE_MEMORY.
  • If the limit is smaller than heap size reported in 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.

Member Data Documentation

◆ device

VkDevice VMA_NOT_NULL VmaAllocatorCreateInfo::device

Vulkan device.

It must be valid throughout whole lifetime of created allocator.

◆ flags

VmaAllocatorCreateFlags VmaAllocatorCreateInfo::flags

Flags for created allocator. Use VmaAllocatorCreateFlagBits enum.

◆ instance

VkInstance VMA_NOT_NULL VmaAllocatorCreateInfo::instance

Handle to Vulkan instance object.

Starting from version 3.0.0 this member is no longer optional, it must be set!

◆ pAllocationCallbacks

const VkAllocationCallbacks* VMA_NULLABLE VmaAllocatorCreateInfo::pAllocationCallbacks

Custom CPU memory allocation callbacks. Optional.

Optional, can be null. When specified, will also be used for all CPU-side memory allocations.

◆ pDeviceMemoryCallbacks

const VmaDeviceMemoryCallbacks* VMA_NULLABLE VmaAllocatorCreateInfo::pDeviceMemoryCallbacks

Informative callbacks for vkAllocateMemory, vkFreeMemory. Optional.

Optional, can be null.

◆ physicalDevice

VkPhysicalDevice VMA_NOT_NULL VmaAllocatorCreateInfo::physicalDevice

Vulkan physical device.

It must be valid throughout whole lifetime of created allocator.

◆ preferredLargeHeapBlockSize

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.

◆ pVulkanFunctions

const VmaVulkanFunctions* VMA_NULLABLE VmaAllocatorCreateInfo::pVulkanFunctions

Pointers to Vulkan functions.

Can be null.

For details see Pointers to Vulkan functions.

◆ vulkanApiVersion

uint32_t VmaAllocatorCreateInfo::vulkanApiVersion

Optional.

The highest version of Vulkan that the application is designed to use.

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. It must be less or equal (preferably equal) to value as passed to vkCreateInstance as VkApplicationInfo::apiVersion. 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.


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