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

Go to the source code of this file.

Classes

struct  VmaAllocatorCreateInfo
 Description of a Allocator to be created. More...
 
struct  VmaStatInfo
 
struct  VmaStats
 General statistics from current state of Allocator. More...
 
struct  VmaMemoryRequirements
 

Macros

#define VMA_STATS_STRING_ENABLED   1
 

Typedefs

typedef struct VmaAllocatorCreateInfo VmaAllocatorCreateInfo
 Description of a Allocator to be created. More...
 
typedef struct VmaStatInfo VmaStatInfo
 
typedef enum VmaMemoryUsage VmaMemoryUsage
 
typedef struct VmaMemoryRequirements VmaMemoryRequirements
 

Enumerations

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_MAX_ENUM = 0x7FFFFFFF
}
 

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 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)
 
VkResult vmaFindMemoryTypeIndex (VmaAllocator allocator, uint32_t memoryTypeBits, const VmaMemoryRequirements *pMemoryRequirements, uint32_t *pMemoryTypeIndex)
 
VkResult vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaMemoryRequirements *pVmaMemoryRequirements, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex)
 General purpose memory allocation. More...
 
VkResult vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaMemoryRequirements *pMemoryRequirements, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex)
 
VkResult vmaAllocateMemoryForImage (VmaAllocator allocator, VkImage image, const VmaMemoryRequirements *pMemoryRequirements, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex)
 Function similar to vmaAllocateMemoryForBuffer(). More...
 
void vmaFreeMemory (VmaAllocator allocator, const VkMappedMemoryRange *pMemory)
 Frees memory previously allocated using vmaAllocateMemoryForBuffer() or vmaAllocateMemoryForImage(). More...
 
VkResult vmaMapMemory (VmaAllocator allocator, const VkMappedMemoryRange *pMemory, void **ppData)
 
void vmaUnmapMemory (VmaAllocator allocator, const VkMappedMemoryRange *pMemory)
 
VkResult vmaCreateBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pCreateInfo, const VmaMemoryRequirements *pMemoryRequirements, VkBuffer *pBuffer, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex)
 
void vmaDestroyBuffer (VmaAllocator allocator, VkBuffer buffer)
 
VkResult vmaCreateImage (VmaAllocator allocator, const VkImageCreateInfo *pCreateInfo, const VmaMemoryRequirements *pMemoryRequirements, VkImage *pImage, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex)
 Function similar to vmaCreateBuffer(). More...
 
void vmaDestroyImage (VmaAllocator allocator, VkImage image)