Structs

\brief Parameters of new #VmaAllocation.

Parameters of #VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().

Description of a Allocator to be created.

Information about existing #VmaAllocator object.

\brief Statistics of current memory usage and available budget for a specific memory heap.

\brief Parameters for defragmentation.

Single move of an allocation to be done for defragmentation.

\brief Parameters for incremental defragmentation steps.

Statistics returned for defragmentation process in function vmaEndDefragmentation().

\brief More detailed statistics than #VmaStatistics.

\brief Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.

Describes parameter of created #VmaPool.

\brief Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total.

\brief General statistics from current state of the Allocator - total memory usage across all memory heaps and types.

Parameters of created virtual allocation to be passed to vmaVirtualAllocate().

Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().

Parameters of created #VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().

\brief Pointers to some Vulkan functions - a subset used by the library.

Constants

\brief Set this flag if the allocated memory will have aliasing resources.

\brief Set this flag if the allocation should have its own memory block.

Create both buffer/image and allocation, but don’t bind them together. It is useful when you want to bind yourself to do some more advanced binding, e.g. using some extensions. The flag is meaningful only with functions that bind by default: vmaCreateBuffer(), vmaCreateImage(). Otherwise it is ignored.

A bit mask to extract only STRATEGY bits from entire set of flags.

Together with #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT, it says that despite request for host access, a not-HOST_VISIBLE memory type can be selected if it may improve performance.

Requests possibility to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT).

Requests possibility to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT).

\brief Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.

\brief Set this flag to only try to allocate from existing VkDeviceMemory blocks and never create new such block.

Alias to #VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT.

Alias to #VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT.

A bit mask to extract only STRATEGY bits from entire set of flags.

Allocation strategy that chooses smallest possible free range for the allocation to minimize memory usage and fragmentation, possibly at the expense of allocation time.

Allocation strategy that chooses always the lowest offset in available space. This is not the most efficient strategy but achieves highly packed data. Used internally by defragmentation, not recommended in typical usage.

Allocation strategy that chooses first suitable free range for the allocation - not necessarily in terms of the smallest offset but the one that is easiest and fastest to find to minimize allocation time, possibly at the expense of allocation quality.

Allocation will be created from upper stack in a double stack pool.

\deprecated Preserved for backward compatibility. Consider using vmaSetAllocationName() instead.

Create allocation only if additional device memory required for it, if any, won’t exceed memory budget. Otherwise return VK_ERROR_OUT_OF_DEVICE_MEMORY.

Enables usage of VK_AMD_device_coherent_memory extension.

Enables usage of “buffer device address” feature, which allows you to use function vkGetBufferDeviceAddress* to get raw GPU pointer to a buffer and pass it for usage inside a shader.

\brief Allocator and all objects created from it will not be synchronized internally, so you must guarantee they are used from only one thread at a time or synchronized externally by you.

Enables usage of VK_EXT_memory_budget extension.

Enables usage of VK_EXT_memory_priority extension in the library.

Enables usage of VK_EXT_memory_priority extension in the library.

Enables usage of VK_KHR_bind_memory2 extension.

\brief Enables usage of VK_KHR_dedicated_allocation extension.

\brief Use the most roboust algorithm at the cost of time to compute and number of copies to make. Only available when bufferImageGranularity is greater than 1, since it aims to reduce alignment issues between different types of resources. Otherwise falls back to same behavior as #VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT.

A bit mask to extract only ALGORITHM bits from entire set of flags.

A bit mask to extract only ALGORITHM bits from entire set of flags.

Buffer/image has been recreated at dstTmpAllocation, data has been copied, old buffer/image has been destroyed. srcAllocation should be changed to point to the new place. This is the default value set by vmaBeginDefragmentationPass().

Set this value if you decide to abandon the allocation and you destroyed the buffer/image. New place reserved at dstTmpAllocation will be freed, along with srcAllocation, which will be destroyed.

Set this value if you cannot move the allocation. New place reserved at dstTmpAllocation will be freed. srcAllocation will remain unchanged.

Selects best memory type automatically. This flag is recommended for most common use cases.

Selects best memory type automatically with preference for GPU (device) memory.

Selects best memory type automatically with preference for CPU (host) memory.

\deprecated Obsolete, preserved for backward compatibility. Prefers not VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.

\deprecated Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_COHERENT_BIT.

\deprecated Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.

Lazily allocated GPU memory having VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT. Exists mostly on mobile platforms. Using it on desktop PC or other GPUs with no such memory type present will fail the allocation.

\deprecated Obsolete, preserved for backward compatibility. Prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.

\deprecated Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_HOST_CACHED_BIT.

Selects best memory type automatically with preference for CPU (host) memory.

No intended memory usage specified. Use other members of VmaAllocationCreateInfo to specify your requirements.

Bit mask to extract only ALGORITHM bits from entire set of flags.

Bit mask to extract only ALGORITHM bits from entire set of flags.

\brief Use this flag if you always allocate only buffers and linear images or only optimal images out of this pool and so Buffer-Image Granularity can be ignored.

\brief Enables alternative, linear allocation algorithm in this pool.

\brief A bit mask to extract only STRATEGY bits from entire set of flags.

\brief A bit mask to extract only STRATEGY bits from entire set of flags.

\brief Allocation strategy that tries to minimize memory usage.

Allocation strategy that chooses always the lowest offset in available space. This is not the most efficient strategy but achieves highly packed data.

\brief Allocation strategy that tries to minimize allocation time.

\brief Allocation will be created from upper stack in a double stack pool.

\brief Bit mask to extract only ALGORITHM bits from entire set of flags.

\brief Bit mask to extract only ALGORITHM bits from entire set of flags.

\brief Enables alternative, linear allocation algorithm in this virtual block.

Functions

\brief General purpose memory allocation.

\brief Allocates memory suitable for given VkBuffer.

\brief Allocates memory suitable for given VkImage.

\brief General purpose memory allocation for multiple allocation objects at once.

\brief Begins defragmentation process.

\brief Starts single defragmentation pass.

\brief Binds buffer to allocation.

\brief Binds buffer to allocation with additional parameters.

\brief Binds image to allocation.

\brief Binds image to allocation with additional parameters.

\brief Builds and returns statistics as a null-terminated string in JSON format. \param allocator \param[out] ppStatsString Must be freed using vmaFreeStatsString() function. \param detailedMap

\brief Builds and returns a null-terminated string in JSON format with information about given #VmaVirtualBlock. \param virtualBlock Virtual block. \param[out] ppStatsString Returned string. \param detailedMap Pass VK_FALSE to only obtain statistics as returned by vmaCalculateVirtualBlockStatistics(). Pass VK_TRUE to also obtain full list of allocations and free spaces.

\brief Retrieves detailed statistics of existing #VmaPool object.

\brief Retrieves statistics from current state of the Allocator.

\brief Calculates and returns detailed statistics about virtual allocations and memory usage in given #VmaVirtualBlock.

\brief Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions.

\brief Checks magic number in margins around all allocations in given memory pool in search for corruptions.

\brief Frees all virtual allocations inside given #VmaVirtualBlock.

\brief Creates a new VkBuffer, binds already created memory for it.

Function similar to vmaCreateAliasingBuffer().

Creates #VmaAllocator object.

\brief Creates a new VkBuffer, allocates and binds memory for it.

\brief Creates a buffer with additional minimum alignment.

Function similar to vmaCreateBuffer().

\brief Allocates Vulkan device memory and creates #VmaPool object.

\brief Creates new #VmaVirtualBlock object.

Destroys allocator object.

\brief Destroys Vulkan buffer and frees allocated memory.

\brief Destroys Vulkan image and frees allocated memory.

\brief Destroys #VmaPool object and frees Vulkan device memory.

\brief Destroys #VmaVirtualBlock object.

\brief Ends defragmentation process.

\brief Ends single defragmentation pass.

\brief Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.

\brief Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.

\brief Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.

\brief Flushes memory of given allocation.

\brief Flushes memory of given set of allocations.

\brief Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage().

\brief Frees memory and destroys multiple allocations.

Frees a string returned by vmaBuildVirtualBlockStatsString().

\brief Returns current information about specified allocation.

\brief Given an allocation, returns Property Flags of its memory type.

\brief Returns information about existing #VmaAllocator object - handle to Vulkan device etc.

\brief Retrieves information about current memory usage and budget for all memory heaps.

PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator. You can access it here, without fetching it again on your own.

\brief Given Memory Type Index, returns Property Flags of this memory type.

PhysicalDeviceProperties are fetched from physicalDevice by the allocator. You can access it here, without fetching it again on your own.

\brief Retrieves name of a custom pool.

\brief Retrieves statistics of existing #VmaPool object.

\brief Returns information about a specific virtual allocation within a virtual block, like its size and pUserData pointer.

\brief Calculates and returns statistics about virtual allocations and memory usage in given #VmaVirtualBlock.

\brief Invalidates memory of given allocation.

\brief Invalidates memory of given set of allocations.

\brief Returns true of the #VmaVirtualBlock is empty - contains 0 virtual allocations and has all its space available for new allocations.

\brief Maps memory represented by given allocation and returns pointer to it.

\brief Sets pName in given allocation to new value.

\brief Sets pUserData in given allocation to new value.

\brief Sets index of the current frame.

\brief Sets name of a custom pool.

\brief Changes custom pointer associated with given virtual allocation.

\brief Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().

\brief Allocates new virtual allocation inside given #VmaVirtualBlock.

\brief Frees virtual allocation inside given #VmaVirtualBlock.

Type Definitions

Callback function called after successful vkAllocateMemory.

Callback function called before vkFreeMemory.

Flags to be passed as VmaAllocationCreateInfo::flags.

See #VmaAllocationCreateFlagBits.

Flags for created #VmaAllocator.

See #VmaAllocatorCreateFlagBits.

Flags to be passed as VmaDefragmentationInfo::flags.

See #VmaDefragmentationFlagBits.

Operation performed on single defragmentation move. See structure #VmaDefragmentationMove.

\brief Intended usage of the allocated memory.

Flags to be passed as VmaPoolCreateInfo::flags.

Flags to be passed as VmaPoolCreateInfo::flags. See #VmaPoolCreateFlagBits.

Flags to be passed as VmaVirtualAllocationCreateInfo::flags.

Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See #VmaVirtualAllocationCreateFlagBits.

Flags to be passed as VmaVirtualBlockCreateInfo::flags.

Flags to be passed as VmaVirtualBlockCreateInfo::flags. See #VmaVirtualBlockCreateFlagBits.