Vulkan Memory Allocator: VmaAllocationCreateInfo Struct Reference

Vulkan Memory Allocator

Loading...
Searching...
No Matches
Public Attributes | List of all members
VmaAllocationCreateInfo Struct Reference
Memory allocation

Parameters of new VmaAllocation. More...

## Public Attributes
VmaAllocationCreateFlags | flags
| Use VmaAllocationCreateFlagBits enum.
VmaMemoryUsage | usage
| Intended usage of memory.
VkMemoryPropertyFlags | requiredFlags
| Flags that must be set in a Memory Type chosen for an allocation.
VkMemoryPropertyFlags | preferredFlags
| Flags that preferably should be set in a memory type chosen for an allocation.
uint32_t | memoryTypeBits
| Bitmask containing one bit set for every memory type acceptable for this allocation.
VmaPool | pool
| Pool that this allocation should be created in.
void * | pUserData
| Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData().
float | priority
| A floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations.
VkDeviceSize | minAlignment
| Additional minimum alignment to be used for this allocation. Can be 0.

## Detailed Description

Parameters of new VmaAllocation.

To be used with functions like vmaCreateBuffer(), vmaCreateImage(), and many others.

## Member Data Documentation

## ◆ flags

VmaAllocationCreateFlags VmaAllocationCreateInfo::flags

Use VmaAllocationCreateFlagBits enum.

## ◆ memoryTypeBits

uint32_t VmaAllocationCreateInfo::memoryTypeBits

Bitmask containing one bit set for every memory type acceptable for this allocation.

Value 0 is equivalent to UINT32_MAX - it means any memory type is accepted if it meets other requirements specified by this structure, with no further restrictions on memory type index.
If pool is not null, this member is ignored.

## ◆ minAlignment

VkDeviceSize VmaAllocationCreateInfo::minAlignment

Additional minimum alignment to be used for this allocation. Can be 0.

Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two.

When creating a buffer or an image, specifying a custom alignment is not needed in most cases, because Vulkan implementation inspects the CreateInfo structure (including intended usage flags) and returns required alignment through functions like vkGetBufferMemoryRequirements2, which VMA automatically uses and respects. Extra alignment may be needed in some cases, like when using a buffer for acceleration structure scratch (VkPhysicalDeviceAccelerationStructurePropertiesKHR::minAccelerationStructureScratchOffsetAlignment, see also issue #523) or when doing interop with OpenGL.

## ◆ pool

VmaPool VmaAllocationCreateInfo::pool

Pool that this allocation should be created in.

Leave VK_NULL_HANDLE to allocate from default pool. If not null, members: usage, requiredFlags, preferredFlags, memoryTypeBits are ignored.

## ◆ preferredFlags

VkMemoryPropertyFlags VmaAllocationCreateInfo::preferredFlags

Flags that preferably should be set in a memory type chosen for an allocation.

Set to 0 if no additional flags are preferred.
If pool is not null, this member is ignored.

## ◆ priority

float VmaAllocationCreateInfo::priority

A floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations.

It is used only when VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT flag was used during creation of the VmaAllocator object and this allocation ends up as dedicated or is explicitly forced as dedicated using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. Otherwise, it has the priority of a memory block where it is placed and this variable is ignored.

## ◆ pUserData

void* VmaAllocationCreateInfo::pUserData

Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData().

If VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT is used, it must be either null or pointer to a null-terminated string. The string will be then copied to internal buffer, so it doesn't need to be valid after allocation call.

## ◆ requiredFlags

VkMemoryPropertyFlags VmaAllocationCreateInfo::requiredFlags

Flags that must be set in a Memory Type chosen for an allocation.

Leave 0 if you specify memory requirements in other way.
If pool is not null, this member is ignored.

## ◆ usage

VmaMemoryUsage VmaAllocationCreateInfo::usage

Intended usage of memory.

You can leave VMA_MEMORY_USAGE_UNKNOWN if you specify memory requirements in other way.
If pool is not null, this member is ignored.

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

- C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h