Vulkan Memory Allocator: VmaPoolCreateInfo Struct Reference

Vulkan Memory Allocator

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

Describes parameter of created VmaPool. More...

## Public Attributes
uint32_t | memoryTypeIndex
| Vulkan memory type index to allocate this pool from.
VmaPoolCreateFlags | flags
| Use combination of VmaPoolCreateFlagBits.
VkDeviceSize | blockSize
| Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes. Optional.
size_t | minBlockCount
| Minimum number of blocks to be always allocated in this pool, even if they stay empty.
size_t | maxBlockCount
| Maximum number of blocks that can be allocated in this pool. Optional.
float | priority
| A floating-point value between 0 and 1, indicating the priority of the allocations in this pool relative to other memory allocations.
VkDeviceSize | minAllocationAlignment
| Additional minimum alignment to be used for all allocations created from this pool. Can be 0.
void *VkMemoryAllocateInfo | pMemoryAllocateNext
| Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this pool. Optional.

## Detailed Description

Describes parameter of created VmaPool.

## Member Data Documentation

## ◆ blockSize

VkDeviceSize VmaPoolCreateInfo::blockSize

Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes. Optional.

Specify nonzero to set explicit, constant size of memory blocks used by this pool.

Leave 0 to use default and let the library manage block sizes automatically. Sizes of particular blocks may vary. In this case, the pool will also support dedicated allocations.

## ◆ flags

VmaPoolCreateFlags VmaPoolCreateInfo::flags

Use combination of VmaPoolCreateFlagBits.

## ◆ maxBlockCount

size_t VmaPoolCreateInfo::maxBlockCount

Maximum number of blocks that can be allocated in this pool. Optional.

Set to 0 to use default, which is SIZE_MAX, which means no limit.

Set to same value as VmaPoolCreateInfo::minBlockCount to have fixed amount of memory allocated throughout whole lifetime of this pool.

## ◆ memoryTypeIndex

uint32_t VmaPoolCreateInfo::memoryTypeIndex

Vulkan memory type index to allocate this pool from.

## ◆ minAllocationAlignment

VkDeviceSize VmaPoolCreateInfo::minAllocationAlignment

Additional minimum alignment to be used for all allocations created from this pool. 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.

## ◆ minBlockCount

size_t VmaPoolCreateInfo::minBlockCount

Minimum number of blocks to be always allocated in this pool, even if they stay empty.

Set to 0 to have no preallocated blocks and allow the pool be completely empty.

## ◆ pMemoryAllocateNext

void* VkMemoryAllocateInfo VmaPoolCreateInfo::pMemoryAllocateNext

Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this pool. Optional.

Optional, can be null. If not null, it must point to a pNext chain of structures that can be attached to VkMemoryAllocateInfo. It can be useful for special needs such as adding VkExportMemoryAllocateInfoKHR. Structures pointed by this member must remain alive and unchanged for the whole lifetime of the custom pool.

Please note that some structures, e.g. VkMemoryPriorityAllocateInfoEXT, VkMemoryDedicatedAllocateInfoKHR, can be attached automatically by this library when using other, more convenient of its features.

## ◆ priority

float VmaPoolCreateInfo::priority

A floating-point value between 0 and 1, indicating the priority of the allocations in this pool 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. Otherwise, this variable is ignored.

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

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