Memory allocation and resource (buffer and image) creation in Vulkan is difficult (comparing to older graphics API-s, like D3D11 or OpenGL) for several reasons:
VkDeviceMemory is allocated separately from creating VkBuffer/VkImage and they must be
bound together. The binding cannot be changed later - resource must be recreated.This library can help game developers to manage memory allocations and resource creation by offering some higher-level functions. Features of the library are divided into several layers, low level to high level:
- Required or preferred traits of the memory are expressed using higher-level description comparing to Vulkan flags.
- Library keeps track of allocated memory blocks, used and unused ranges inside them, finds best matching unused ranges for new allocations, takes all the rules of alignment and buffer/image granularity into consideration.
Additional features:
| Modifier and Type | Interface and Description |
|---|---|
| public interface | VmaAllocateDeviceMemoryFunctionI
Instances of this interface may be set to the |
| public interface | VmaCheckDefragmentationBreakFunctionI
Instances of this interface may be set to the |
| public interface | VmaFreeDeviceMemoryFunctionI
Instances of this interface may be set to the |
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | LibVma
Initializes the vma shared library. |
| public class | Vma
The Vulkan Memory Allocator. |
| public abstract class | VmaAllocateDeviceMemoryFunction
Instances of this class may be set to the |
| public class | VmaAllocationCreateInfo
Parameters of new |
| public class | VmaAllocationInfo
Parameters of |
| public class | VmaAllocatorCreateInfo
Description of an Allocator to be created. |
| public class | VmaAllocatorInfo
Information about existing |
| public class | VmaBudget
Statistics of current memory usage and available budget for a specific memory heap. |
| public abstract class | VmaCheckDefragmentationBreakFunction
Instances of this class may be set to the |
| public class | VmaDefragmentationInfo
Parameters for defragmentation. |
| public class | VmaDefragmentationMove
Single move of an allocation to be done for defragmentation. |
| public class | VmaDefragmentationPassMoveInfo
Parameters for incremental defragmentation steps. |
| public class | VmaDefragmentationStats
Statistics returned for defragmentation process in function |
| public class | VmaDetailedStatistics
More detailed statistics than |
| public class | VmaDeviceMemoryCallbacks
Set of callbacks that the library will call for |
| public abstract class | VmaFreeDeviceMemoryFunction
Instances of this class may be set to the |
| public class | VmaPoolCreateInfo
Describes parameter of created |
| public class | VmaStatistics
Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total. |
| public class | VmaTotalStatistics
General statistics from current state of the Allocator - total memory usage across all memory heaps and types. |
| public class | VmaVirtualAllocationCreateInfo
Parameters of created virtual allocation to be passed to |
| public class | VmaVirtualAllocationInfo
Parameters of an existing virtual allocation, returned by |
| public class | VmaVirtualBlockCreateInfo
Parameters of created |
| public class | VmaVulkanFunctions
Pointers to some Vulkan functions - a subset used by the library. |