Vulkan Memory Allocator
Classes | Macros | Typedefs | Enumerations | Functions
vk_mem_alloc.h File Reference
#include <vulkan/vulkan.h>

Classes

struct  VmaDeviceMemoryCallbacks
 Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More...
 
struct  VmaVulkanFunctions
 Pointers to some Vulkan functions - a subset used by the library. More...
 
struct  VmaAllocatorCreateInfo
 Description of a Allocator to be created. More...
 
struct  VmaAllocatorInfo
 Information about existing VmaAllocator object. More...
 
struct  VmaStatInfo
 Calculated statistics of memory usage in entire allocator. More...
 
struct  VmaStats
 General statistics from current state of Allocator. More...
 
struct  VmaBudget
 Statistics of current memory usage and available budget, in bytes, for specific memory heap. More...
 
struct  VmaAllocationCreateInfo
 
struct  VmaPoolCreateInfo
 Describes parameter of created VmaPool. More...
 
struct  VmaPoolStats
 Describes parameter of existing VmaPool. More...
 
struct  VmaAllocationInfo
 Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo(). More...
 
struct  VmaDefragmentationInfo2
 Parameters for defragmentation. More...
 
struct  VmaDefragmentationPassMoveInfo
 
struct  VmaDefragmentationPassInfo
 Parameters for incremental defragmentation steps. More...
 
struct  VmaDefragmentationInfo
 Deprecated. Optional configuration parameters to be passed to function vmaDefragment(). More...
 
struct  VmaDefragmentationStats
 Statistics returned by function vmaDefragment(). More...
 
struct  VmaVirtualBlockCreateInfo
 Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock(). More...
 
struct  VmaVirtualAllocationCreateInfo
 Parameters of created virtual allocation to be passed to vmaVirtualAllocate(). More...
 
struct  VmaVirtualAllocationInfo
 Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo(). More...
 

Macros

#define VK_ERROR_UNKNOWN   ((VkResult)-13)
 
#define VMA_DEDICATED_ALLOCATION   0
 
#define VMA_BIND_MEMORY2   0
 
#define VMA_MEMORY_BUDGET   0
 
#define VMA_BUFFER_DEVICE_ADDRESS   1
 
#define VMA_STATS_STRING_ENABLED   1
 

Typedefs

typedef enum VmaAllocatorCreateFlagBits VmaAllocatorCreateFlagBits
 Flags for created VmaAllocator. More...
 
typedef VkFlags VmaAllocatorCreateFlags
 
typedef enum VmaMemoryUsage VmaMemoryUsage
 Intended usage of the allocated memory. More...
 
typedef enum VmaAllocationCreateFlagBits VmaAllocationCreateFlagBits
 Flags to be passed as VmaAllocationCreateInfo::flags. More...
 
typedef VkFlags VmaAllocationCreateFlags
 
typedef enum VmaPoolCreateFlagBits VmaPoolCreateFlagBits
 Flags to be passed as VmaPoolCreateInfo::flags. More...
 
typedef VkFlags VmaPoolCreateFlags
 Flags to be passed as VmaPoolCreateInfo::flags. See VmaPoolCreateFlagBits. More...
 
typedef enum VmaDefragmentationFlagBits VmaDefragmentationFlagBits
 Flags to be used in vmaDefragmentationBegin(). None at the moment. Reserved for future use. More...
 
typedef VkFlags VmaDefragmentationFlags
 
typedef enum VmaVirtualBlockCreateFlagBits VmaVirtualBlockCreateFlagBits
 Flags to be passed as VmaVirtualBlockCreateInfo::flags. More...
 
typedef VkFlags VmaVirtualBlockCreateFlags
 Flags to be passed as VmaVirtualBlockCreateInfo::flags. See VmaVirtualBlockCreateFlagBits. More...
 
typedef enum VmaVirtualAllocationCreateFlagBits VmaVirtualAllocationCreateFlagBits
 Flags to be passed as VmaVirtualAllocationCreateInfo::flags. More...
 
typedef VkFlags VmaVirtualAllocationCreateFlags
 Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See VmaVirtualAllocationCreateFlagBits. More...
 
typedef void(VKAPI_PTR * PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData)
 Callback function called after successful vkAllocateMemory. More...
 
typedef void(VKAPI_PTR * PFN_vmaFreeDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData)
 Callback function called before vkFreeMemory. More...
 
typedef struct VmaDeviceMemoryCallbacks VmaDeviceMemoryCallbacks
 Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More...
 
typedef struct VmaVulkanFunctions VmaVulkanFunctions
 Pointers to some Vulkan functions - a subset used by the library. More...
 
typedef struct VmaAllocatorCreateInfo VmaAllocatorCreateInfo
 Description of a Allocator to be created. More...
 
typedef struct VmaAllocatorInfo VmaAllocatorInfo
 Information about existing VmaAllocator object. More...
 
typedef struct VmaStatInfo VmaStatInfo
 Calculated statistics of memory usage in entire allocator. More...
 
typedef struct VmaStats VmaStats
 General statistics from current state of Allocator. More...
 
typedef struct VmaBudget VmaBudget
 Statistics of current memory usage and available budget, in bytes, for specific memory heap. More...
 
typedef struct VmaAllocationCreateInfo VmaAllocationCreateInfo
 
typedef struct VmaPoolCreateInfo VmaPoolCreateInfo
 Describes parameter of created VmaPool. More...
 
typedef struct VmaPoolStats VmaPoolStats
 Describes parameter of existing VmaPool. More...
 
typedef struct VmaAllocationInfo VmaAllocationInfo
 Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo(). More...
 
typedef struct VmaDefragmentationInfo2 VmaDefragmentationInfo2
 Parameters for defragmentation. More...
 
typedef struct VmaDefragmentationPassMoveInfo VmaDefragmentationPassMoveInfo
 
typedef struct VmaDefragmentationPassInfo VmaDefragmentationPassInfo
 Parameters for incremental defragmentation steps. More...
 
typedef struct VmaDefragmentationInfo VmaDefragmentationInfo
 Deprecated. Optional configuration parameters to be passed to function vmaDefragment(). More...
 
typedef struct VmaDefragmentationStats VmaDefragmentationStats
 Statistics returned by function vmaDefragment(). More...
 
typedef struct VmaVirtualBlockCreateInfo VmaVirtualBlockCreateInfo
 Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock(). More...
 
typedef struct VmaVirtualAllocationCreateInfo VmaVirtualAllocationCreateInfo
 Parameters of created virtual allocation to be passed to vmaVirtualAllocate(). More...
 
typedef struct VmaVirtualAllocationInfo VmaVirtualAllocationInfo
 Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo(). More...
 

Enumerations

enum  VmaAllocatorCreateFlagBits {
  VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001 , VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT = 0x00000002 , VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT = 0x00000004 , VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT = 0x00000008 ,
  VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT = 0x00000010 , VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT = 0x00000020 , VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT = 0x00000040 , VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
}
 Flags for created VmaAllocator. More...
 
enum  VmaMemoryUsage {
  VMA_MEMORY_USAGE_UNKNOWN = 0 , VMA_MEMORY_USAGE_GPU_ONLY = 1 , VMA_MEMORY_USAGE_CPU_ONLY = 2 , VMA_MEMORY_USAGE_CPU_TO_GPU = 3 ,
  VMA_MEMORY_USAGE_GPU_TO_CPU = 4 , VMA_MEMORY_USAGE_CPU_COPY = 5 , VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED = 6 , VMA_MEMORY_USAGE_MAX_ENUM = 0x7FFFFFFF
}
 Intended usage of the allocated memory. More...
 
enum  VmaAllocationCreateFlagBits {
  VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 0x00000001 , VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 0x00000002 , VMA_ALLOCATION_CREATE_MAPPED_BIT = 0x00000004 , VMA_ALLOCATION_CREATE_RESERVED_1_BIT = 0x00000008 ,
  VMA_ALLOCATION_CREATE_RESERVED_2_BIT = 0x00000010 , VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT = 0x00000020 , VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = 0x00000040 , VMA_ALLOCATION_CREATE_DONT_BIND_BIT = 0x00000080 ,
  VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT = 0x00000100 , VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT = 0x00000200 , VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT = 0x00010000 , VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT = 0x00020000 ,
  VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT = 0x00040000 , VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT , VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT , VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT = VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT ,
  VMA_ALLOCATION_CREATE_STRATEGY_MASK , VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
}
 Flags to be passed as VmaAllocationCreateInfo::flags. More...
 
enum  VmaPoolCreateFlagBits {
  VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 0x00000002 , VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT = 0x00000004 , VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT = 0x00000008 , VMA_POOL_CREATE_TLSF_ALGORITHM_BIT = 0x00000010 ,
  VMA_POOL_CREATE_ALGORITHM_MASK , VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
}
 Flags to be passed as VmaPoolCreateInfo::flags. More...
 
enum  VmaDefragmentationFlagBits { VMA_DEFRAGMENTATION_FLAG_INCREMENTAL = 0x1 , VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF }
 Flags to be used in vmaDefragmentationBegin(). None at the moment. Reserved for future use. More...
 
enum  VmaVirtualBlockCreateFlagBits {
  VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = 0x00000001 , VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT = 0x00000002 , VMA_VIRTUAL_BLOCK_CREATE_TLSF_ALGORITHM_BIT = 0x00000004 , VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK ,
  VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
}
 Flags to be passed as VmaVirtualBlockCreateInfo::flags. More...
 
enum  VmaVirtualAllocationCreateFlagBits {
  VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT , VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT , VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT , VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT ,
  VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK = VMA_ALLOCATION_CREATE_STRATEGY_MASK , VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
}
 Flags to be passed as VmaVirtualAllocationCreateInfo::flags. More...
 

Functions

 VK_DEFINE_NON_DISPATCHABLE_HANDLE (VmaVirtualAllocation)
 
VkResult vmaCreateAllocator (const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator)
 Creates VmaAllocator object. More...
 
void vmaDestroyAllocator (VmaAllocator allocator)
 Destroys allocator object. More...
 
void vmaGetAllocatorInfo (VmaAllocator allocator, VmaAllocatorInfo *pAllocatorInfo)
 Returns information about existing VmaAllocator object - handle to Vulkan device etc. More...
 
void vmaGetPhysicalDeviceProperties (VmaAllocator allocator, const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties)
 
void vmaGetMemoryProperties (VmaAllocator allocator, const VkPhysicalDeviceMemoryProperties **ppPhysicalDeviceMemoryProperties)
 
void vmaGetMemoryTypeProperties (VmaAllocator allocator, uint32_t memoryTypeIndex, VkMemoryPropertyFlags *pFlags)
 Given Memory Type Index, returns Property Flags of this memory type. More...
 
void vmaSetCurrentFrameIndex (VmaAllocator allocator, uint32_t frameIndex)
 Sets index of the current frame. More...
 
void vmaCalculateStats (VmaAllocator allocator, VmaStats *pStats)
 Retrieves statistics from current state of the Allocator. More...
 
void vmaGetHeapBudgets (VmaAllocator allocator, VmaBudget *pBudgets)
 Retrieves information about current memory budget for all memory heaps. More...
 
VkResult vmaFindMemoryTypeIndex (VmaAllocator allocator, uint32_t memoryTypeBits, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
 Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo. More...
 
VkResult vmaFindMemoryTypeIndexForBufferInfo (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
 Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo. More...
 
VkResult vmaFindMemoryTypeIndexForImageInfo (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
 Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo. More...
 
VkResult vmaCreatePool (VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
 Allocates Vulkan device memory and creates VmaPool object. More...
 
void vmaDestroyPool (VmaAllocator allocator, VmaPool pool)
 Destroys VmaPool object and frees Vulkan device memory. More...
 
void vmaGetPoolStats (VmaAllocator allocator, VmaPool pool, VmaPoolStats *pPoolStats)
 Retrieves statistics of existing VmaPool object. More...
 
VkResult vmaCheckPoolCorruption (VmaAllocator allocator, VmaPool pool)
 Checks magic number in margins around all allocations in given memory pool in search for corruptions. More...
 
void vmaGetPoolName (VmaAllocator allocator, VmaPool pool, const char **ppName)
 Retrieves name of a custom pool. More...
 
void vmaSetPoolName (VmaAllocator allocator, VmaPool pool, const char *pName)
 Sets name of a custom pool. More...
 
VkResult vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
 General purpose memory allocation. More...
 
VkResult vmaAllocateMemoryPages (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, size_t allocationCount, VmaAllocation *pAllocations, VmaAllocationInfo *pAllocationInfo)
 General purpose memory allocation for multiple allocation objects at once. More...
 
VkResult vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
 
VkResult vmaAllocateMemoryForImage (VmaAllocator allocator, VkImage image, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
 Function similar to vmaAllocateMemoryForBuffer(). More...
 
void vmaFreeMemory (VmaAllocator allocator, const VmaAllocation allocation)
 Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage(). More...
 
void vmaFreeMemoryPages (VmaAllocator allocator, size_t allocationCount, const VmaAllocation *pAllocations)
 Frees memory and destroys multiple allocations. More...
 
void vmaGetAllocationInfo (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
 Returns current information about specified allocation. More...
 
void vmaSetAllocationUserData (VmaAllocator allocator, VmaAllocation allocation, void *pUserData)
 Sets pUserData in given allocation to new value. More...
 
void vmaGetAllocationMemoryProperties (VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags)
 Given an allocation, returns Property Flags of its memory type. More...
 
VkResult vmaMapMemory (VmaAllocator allocator, VmaAllocation allocation, void **ppData)
 Maps memory represented by given allocation and returns pointer to it. More...
 
void vmaUnmapMemory (VmaAllocator allocator, VmaAllocation allocation)
 Unmaps memory represented by given allocation, mapped previously using vmaMapMemory(). More...
 
VkResult vmaFlushAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
 Flushes memory of given allocation. More...
 
VkResult vmaInvalidateAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
 Invalidates memory of given allocation. More...
 
VkResult vmaFlushAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes)
 Flushes memory of given set of allocations. More...
 
VkResult vmaInvalidateAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes)
 Invalidates memory of given set of allocations. More...
 
VkResult vmaCheckCorruption (VmaAllocator allocator, uint32_t memoryTypeBits)
 Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions. More...
 
VkResult vmaDefragmentationBegin (VmaAllocator allocator, const VmaDefragmentationInfo2 *pInfo, VmaDefragmentationStats *pStats, VmaDefragmentationContext *pContext)
 Begins defragmentation process. More...
 
VkResult vmaDefragmentationEnd (VmaAllocator allocator, VmaDefragmentationContext context)
 Ends defragmentation process. More...
 
VkResult vmaBeginDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassInfo *pInfo)
 
VkResult vmaEndDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context)
 
VkResult vmaDefragment (VmaAllocator allocator, const VmaAllocation *pAllocations, size_t allocationCount, VkBool32 *pAllocationsChanged, const VmaDefragmentationInfo *pDefragmentationInfo, VmaDefragmentationStats *pDefragmentationStats)
 Deprecated. Compacts memory by moving allocations. More...
 
VkResult vmaBindBufferMemory (VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer)
 Binds buffer to allocation. More...
 
VkResult vmaBindBufferMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkBuffer buffer, const void *pNext)
 Binds buffer to allocation with additional parameters. More...
 
VkResult vmaBindImageMemory (VmaAllocator allocator, VmaAllocation allocation, VkImage image)
 Binds image to allocation. More...
 
VkResult vmaBindImageMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkImage image, const void *pNext)
 Binds image to allocation with additional parameters. More...
 
VkResult vmaCreateBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
 
VkResult vmaCreateBufferWithAlignment (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkDeviceSize minAlignment, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
 Creates a buffer with additional minimum alignment. More...
 
void vmaDestroyBuffer (VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)
 Destroys Vulkan buffer and frees allocated memory. More...
 
VkResult vmaCreateImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
 Function similar to vmaCreateBuffer(). More...
 
void vmaDestroyImage (VmaAllocator allocator, VkImage image, VmaAllocation allocation)
 Destroys Vulkan image and frees allocated memory. More...
 
VkResult vmaCreateVirtualBlock (const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock)
 Creates new VmaVirtualBlock object. More...
 
void vmaDestroyVirtualBlock (VmaVirtualBlock virtualBlock)
 Destroys VmaVirtualBlock object. More...
 
VkBool32 vmaIsVirtualBlockEmpty (VmaVirtualBlock virtualBlock)
 Returns true of the VmaVirtualBlock is empty - contains 0 virtual allocations and has all its space available for new allocations. More...
 
void vmaGetVirtualAllocationInfo (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, VmaVirtualAllocationInfo *pVirtualAllocInfo)
 Returns information about a specific virtual allocation within a virtual block, like its size and pUserData pointer. More...
 
VkResult vmaVirtualAllocate (VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VmaVirtualAllocation *pAllocation, VkDeviceSize *pOffset)
 Allocates new virtual allocation inside given VmaVirtualBlock. More...
 
void vmaVirtualFree (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation)
 Frees virtual allocation inside given VmaVirtualBlock. More...
 
void vmaClearVirtualBlock (VmaVirtualBlock virtualBlock)
 Frees all virtual allocations inside given VmaVirtualBlock. More...
 
void vmaSetVirtualAllocationUserData (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, void *pUserData)
 Changes custom pointer associated with given virtual allocation. More...
 
void vmaCalculateVirtualBlockStats (VmaVirtualBlock virtualBlock, VmaStatInfo *pStatInfo)
 Calculates and returns statistics about virtual allocations and memory usage in given VmaVirtualBlock. More...
 
void vmaBuildVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char **ppStatsString, VkBool32 detailedMap)
 Builds and returns a null-terminated string in JSON format with information about given VmaVirtualBlock. More...
 
void vmaFreeVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char *pStatsString)
 Frees a string returned by vmaBuildVirtualBlockStatsString(). More...
 
void vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap)
 Builds and returns statistics as a null-terminated string in JSON format. More...
 
void vmaFreeStatsString (VmaAllocator allocator, char *pStatsString)
 

Macro Definition Documentation

◆ VK_ERROR_UNKNOWN

#define VK_ERROR_UNKNOWN   ((VkResult)-13)

◆ VMA_BIND_MEMORY2

#define VMA_BIND_MEMORY2   0

◆ VMA_BUFFER_DEVICE_ADDRESS

#define VMA_BUFFER_DEVICE_ADDRESS   1

◆ VMA_DEDICATED_ALLOCATION

#define VMA_DEDICATED_ALLOCATION   0

◆ VMA_MEMORY_BUDGET

#define VMA_MEMORY_BUDGET   0

◆ VMA_STATS_STRING_ENABLED

#define VMA_STATS_STRING_ENABLED   1