Vulkan Memory Allocator
|
Classes | |
struct | VmaDeviceMemoryCallbacks |
Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More... | |
struct | VmaAllocatorCreateInfo |
Description of a Allocator to be created. More... | |
struct | VmaStatInfo |
struct | VmaStats |
General statistics from current state of Allocator. More... | |
Macros | |
#define | VMA_STATS_STRING_ENABLED 1 |
Typedefs | |
typedef void(VKAPI_PTR * | PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size) |
Callback function called after successful vkAllocateMemory. More... | |
typedef void(VKAPI_PTR * | PFN_vmaFreeDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size) |
Callback function called before vkFreeMemory. More... | |
typedef struct VmaDeviceMemoryCallbacks | VmaDeviceMemoryCallbacks |
Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More... | |
typedef enum VmaAllocatorFlagBits | VmaAllocatorFlagBits |
Flags for created VmaAllocator. More... | |
typedef VkFlags | VmaAllocatorFlags |
typedef struct VmaAllocatorCreateInfo | VmaAllocatorCreateInfo |
Description of a Allocator to be created. More... | |
typedef struct VmaStatInfo | VmaStatInfo |
Enumerations | |
enum | VmaAllocatorFlagBits { VMA_ALLOCATOR_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001, VMA_ALLOCATOR_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } |
Flags for created VmaAllocator. More... | |
Functions | |
VkResult | vmaCreateAllocator (const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator) |
Creates Allocator object. More... | |
void | vmaDestroyAllocator (VmaAllocator allocator) |
Destroys allocator object. 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 | vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap) |
Builds and returns statistics as string in JSON format. More... | |
void | vmaFreeStatsString (VmaAllocator allocator, char *pStatsString) |
#define VMA_STATS_STRING_ENABLED 1 |
typedef void(VKAPI_PTR * PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size) |
Callback function called after successful vkAllocateMemory.
typedef void(VKAPI_PTR * PFN_vmaFreeDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size) |
Callback function called before vkFreeMemory.
typedef struct VmaAllocatorCreateInfo VmaAllocatorCreateInfo |
Description of a Allocator to be created.
typedef enum VmaAllocatorFlagBits VmaAllocatorFlagBits |
Flags for created VmaAllocator.
typedef VkFlags VmaAllocatorFlags |
typedef struct VmaDeviceMemoryCallbacks VmaDeviceMemoryCallbacks |
Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.
Provided for informative purpose, e.g. to gather statistics about number of allocations or total amount of memory allocated in Vulkan.
typedef struct VmaStatInfo VmaStatInfo |
enum VmaAllocatorFlagBits |
Flags for created VmaAllocator.
void vmaBuildStatsString | ( | VmaAllocator | allocator, |
char ** | ppStatsString, | ||
VkBool32 | detailedMap | ||
) |
Builds and returns statistics as string in JSON format.
[out] | ppStatsString | Must be freed using vmaFreeStatsString() function. |
void vmaCalculateStats | ( | VmaAllocator | allocator, |
VmaStats * | pStats | ||
) |
Retrieves statistics from current state of the Allocator.
VkResult vmaCreateAllocator | ( | const VmaAllocatorCreateInfo * | pCreateInfo, |
VmaAllocator * | pAllocator | ||
) |
Creates Allocator object.
void vmaDestroyAllocator | ( | VmaAllocator | allocator | ) |
Destroys allocator object.
void vmaFreeStatsString | ( | VmaAllocator | allocator, |
char * | pStatsString | ||
) |
void vmaGetMemoryProperties | ( | VmaAllocator | allocator, |
const VkPhysicalDeviceMemoryProperties ** | ppPhysicalDeviceMemoryProperties | ||
) |
PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator. You can access it here, without fetching it again on your own.
void vmaGetMemoryTypeProperties | ( | VmaAllocator | allocator, |
uint32_t | memoryTypeIndex, | ||
VkMemoryPropertyFlags * | pFlags | ||
) |
Given Memory Type Index, returns Property Flags of this memory type.
This is just a convenience function. Same information can be obtained using vmaGetMemoryProperties().
void vmaGetPhysicalDeviceProperties | ( | VmaAllocator | allocator, |
const VkPhysicalDeviceProperties ** | ppPhysicalDeviceProperties | ||
) |
PhysicalDeviceProperties are fetched from physicalDevice by the allocator. You can access it here, without fetching it again on your own.
void vmaSetCurrentFrameIndex | ( | VmaAllocator | allocator, |
uint32_t | frameIndex | ||
) |
Sets index of the current frame.
This function must be used if you make allocations with VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT
and VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT
flags to inform the allocator when a new frame begins. Allocations queried using vmaGetAllocationInfo() cannot become lost in the current frame.