diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e21d9d4..26f4e9b6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,16 @@
+# 3.4.0 (2026-??-??)
+
+- Added member `VmaAllocationCreateInfo::minAlignment` (#523).
+ - Remember to always fully initialize structures with zeros and don't rely on their specific `sizeof` to ensure backward compatibility!
+ - Function `vmaCreateBufferWithAlignment` is now deprecated.
+- Improvements for external memory export & import (#503):
+ - Added functions `vmaCreateDedicatedBuffer`, `vmaCreateDedicatedImage`, `vmaAllocateDedicatedMemory` offering extra parameter `void* pMemoryAllocateNext`.
+ - Added function `vmaGetMemoryWin32Handle2` offering extra parameter `VkExternalMemoryHandleTypeFlagBits handleType`.
+- Added `VMA_VERSION` macro with library version number (#507).
+- Improvements in the algorithm choosing memory type when `VMA_MEMORY_USAGE_AUTO*` is used (#520).
+- Fixes for compatibility with C++20 modules on Clang 21 and GCC15 (#513, #514).
+- Other fixes and improvements, including compatibility with various platforms and compilers, improvements in documentation, sample application, and tests.
+
# 3.3.0 (2025-05-12)
Additions to the library API:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c284c581..1547f472 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2017-2025 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (c) 2017-2026 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -26,6 +26,7 @@ project(VMA VERSION 3.3.0 LANGUAGES CXX)
add_library(VulkanMemoryAllocator INTERFACE)
add_library(GPUOpen::VulkanMemoryAllocator ALIAS VulkanMemoryAllocator)
+add_library(VulkanMemoryAllocator::Headers ALIAS VulkanMemoryAllocator)
target_include_directories(VulkanMemoryAllocator INTERFACE $ You can annotate allocations with your own information, e.g. for debugging purposes. To do that, fill VmaAllocationCreateInfo::pUserData field when creating an allocation. It is an opaque void* pointer. You can use it e.g. as a pointer, some handle, index, key, ordinal number or any other value that would associate the allocation with your custom metadata. It is useful to identify appropriate data structures in your engine given VmaAllocation, e.g. when doing Defragmentation. You can annotate allocations with your own information, e.g. for debugging purposes. To do that, fill VmaAllocationCreateInfo::pUserData field when creating an allocation. It is an opaque void* pointer. You can use it e.g. as a pointer, some handle, index, key, ordinal number or any other value that would associate the allocation with your custom metadata. It is useful to identify appropriate data structures in your engine given VmaAllocation, e.g. when doing Defragmentation. It can also be changed using function vmaSetAllocationUserData(). Values of (non-zero) allocations' pUserData are printed in JSON report created by vmaBuildStatsString() in hexadecimal form. For more examples of creating different kinds of resources, see chapter Recommended usage patterns. See also: Memory mapping. For more examples of creating different kinds of resources, see chapter Recommended usage patterns. See also: Memory mapping. Usage values VMA_MEMORY_USAGE_AUTO* are legal to use only when the library knows about the resource being created by having VkBufferCreateInfo / VkImageCreateInfo passed, so they work with functions like: vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo() etc. If you allocate raw memory using function vmaAllocateMemory(), you have to use other means of selecting memory type, as described below. You can specify more detailed requirements by filling members VmaAllocationCreateInfo::requiredFlags and VmaAllocationCreateInfo::preferredFlags with a combination of bits from enum VkMemoryPropertyFlags. For example, if you want to create a buffer that will be persistently mapped on host (so it must be HOST_VISIBLE) and preferably will also be HOST_COHERENT and HOST_CACHED, use following code: If you allocate from custom memory pool, all the ways of specifying memory requirements described above are not applicable and the aforementioned members of VmaAllocationCreateInfo structure are ignored. Memory type is selected explicitly when creating the pool and then used to make all the allocations from that pool. For further details, see Custom memory pools. If you allocate from custom memory pool, all the ways of specifying memory requirements described above are not applicable and the aforementioned members of VmaAllocationCreateInfo structure are ignored. Memory type is selected explicitly when creating the pool and then used to make all the allocations from that pool. For further details, see Custom memory pools. Memory for allocations is reserved out of larger block of VkDeviceMemory allocated from Vulkan internally. That is the main feature of this whole library. You can still request a separate memory block to be created for an allocation, just like you would do in a trivial solution without using any allocator. In that case, a buffer or image is always bound to that memory at offset 0. This is called a "dedicated allocation". You can explicitly request it by using flag VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. The library can also internally decide to use dedicated allocation in some cases, e.g.: You have to free all allocations made from this pool before destroying it. When you free some allocations from the beginning and there is not enough free space for a new one at the end of a pool, allocator's "cursor" wraps around to the beginning and starts allocation there. Thanks to this, if you always release allocations in the same order as you created them (FIFO - First In First Out), you can achieve behavior of a ring buffer / queue. Ring buffer is available only in pools with one memory block - VmaPoolCreateInfo::maxBlockCount must be 1. Otherwise behavior is undefined.
Allocation user data
-
@@ -120,7 +120,7 @@
-Generated by 1.14.0
+Generated by
1.16.1
-Generated by 1.14.0
+Generated by
1.16.1
diff --git a/docs/html/choosing_memory_type.html b/docs/html/choosing_memory_type.html
index 3e83c9b3..b258de8f 100644
--- a/docs/html/choosing_memory_type.html
+++ b/docs/html/choosing_memory_type.html
@@ -3,7 +3,7 @@
-
+
+
Required and preferred flags
// ...
Custom memory pools
-
Dedicated allocations
-Generated by 1.14.0
+Generated by
1.16.1
diff --git a/docs/html/classes.html b/docs/html/classes.html
index 82c10757..489d8b97 100644
--- a/docs/html/classes.html
+++ b/docs/html/classes.html
@@ -3,7 +3,7 @@
-
+
-Generated by 1.14.0
+Generated by
1.16.1
diff --git a/docs/html/configuration.html b/docs/html/configuration.html
index 6b7baee5..546dad53 100644
--- a/docs/html/configuration.html
+++ b/docs/html/configuration.html
@@ -3,7 +3,7 @@
-
+
-Generated by 1.14.0
+Generated by
1.16.1
diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html
index 90449392..66eb8ca7 100644
--- a/docs/html/custom_memory_pools.html
+++ b/docs/html/custom_memory_pools.html
@@ -3,7 +3,7 @@
-
+
<
Linear allocation algorithm
@@ -222,12 +222,12 @@

+
-Generated by 1.14.0
+Generated by
1.16.1
diff --git a/docs/html/debugging_memory_usage.html b/docs/html/debugging_memory_usage.html
index aac63dff..22f08433 100644
--- a/docs/html/debugging_memory_usage.html
+++ b/docs/html/debugging_memory_usage.html
@@ -3,7 +3,7 @@
-
+
If your bug goes away after enabling margins, it means it may be caused by memory being overwritten outside of allocation boundaries. It is not 100% certain though. Change in application behavior may also be caused by different order and distribution of allocations across memory blocks after margins are applied.
Margins work with all types of memory.
Margin is applied only to allocations made out of memory blocks and not to dedicated allocations, which have their own memory block of specific size. It is thus not applied to allocations made using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag or those automatically decided to put into dedicated allocations, e.g. due to its large size or recommended by VK_KHR_dedicated_allocation extension.
-Margins appear in JSON dump as part of free space.
+Margins appear in JSON dump as part of free space.
Note that enabling margins increases memory usage and fragmentation.
-Margins do not apply to Virtual allocator.
+Margins do not apply to Virtual allocator.
You can additionally define macro VMA_DEBUG_DETECT_CORRUPTION to 1 to enable validation of contents of the margins.
@@ -120,7 +120,7 @@Although functions like vmaCreateBuffer(), vmaCreateImage(), vmaDestroyBuffer(), vmaDestroyImage() create/destroy an allocation and a buffer/image at once, these are just a shortcut for creating the resource, allocating memory, and binding them together. Defragmentation works on memory allocations only. You must handle the rest manually. Defragmentation is an iterative process that should repreat "passes" as long as related functions return VK_INCOMPLETE not VK_SUCCESS. In each pass:
Files | |
| vk_mem_alloc.h | |
| vk_mem_alloc.h | |
While VMA is useful for most applications that use the Vulkan API, there are cases when it may be a better choice not to use it. For example, if the application is very simple, e.g. serving as a sample or a learning exercise to help you understand or teach others the basics of Vulkan, and it creates only a small number of buffers and images, then including VMA may be an overkill. Developing your own memory allocator may also be a good learning exercise.
What are the benefits of using VMA?
VMA is an STB-style single-header C++ library.
You can pull the entire GitHub repository, e.g. using Git submodules. The repository contains ancillary files like the Cmake script, Doxygen config file, sample application, test suite, and others. You can compile it as a library and link with your project.
However, a simpler way is taking the single file "include/vk_mem_alloc.h" and including it in your project. This extensive file contains all you need: a copyright notice, declarations of the public library interface (API), its internal implementation, and even the documentation in form of Doxygen-style comments.
-The "STB style" means not everything is implemented as inline functions in the header file. You need to extract the internal implementation using a special macro. This means that in every .cpp file where you need to use the library you should #include "vk_mem_alloc.h" to include its public interface, but additionally in exactly one .cpp file you should #define VMA_IMPLEMENTATION before this #include to enable its internal implementation. For more information, see Project setup.
+The "STB style" means not everything is implemented as inline functions in the header file. You need to extract the internal implementation using a special macro. This means that in every .cpp file where you need to use the library you should #include "vk_mem_alloc.h" to include its public interface, but additionally in exactly one .cpp file you should #define VMA_IMPLEMENTATION before this #include to enable its internal implementation. For more information, see Project setup.
Does the library work with C or C++?
The internal implementation of VMA is written in C++. It is distributed in the source format, so you need a compiler supporting at least C++14 to build it.
However, the public interface of the library is written in C - using only enums, structs, and global functions, in the same style as Vulkan, so you can use the library in the C code.
@@ -113,7 +113,7 @@Is it available for other programming languages?
VMA is a C++ library with C interface in similar style as Vulkan. An object-oriented C++ wrapper or bindings to other programming languages are out of scope of this project, but they are welcome as external projects. Some of them are listed in README.md, "See also" section, including binding to C++, Python, Rust, and Haskell. Before using any of them, please check if they are still maintained and updated to use a recent version of VMA.
@@ -123,7 +123,7 @@No! While VMA is published by AMD, it works on any GPU that supports Vulkan, whether a discrete PC graphics card, a processor integrated graphics, or a mobile SoC. It doesn't give AMD GPUs any advantage over any other GPUs.
What Vulkan versions and extensions are supported?
VMA is updated to support the latest versions of Vulkan. It currently supports Vulkan up to 1.4. The library also supports older versions down to the first release of Vulkan 1.0. Defining a higher minimum version support would help simplify the code, but we acknowledge that developers on some platforms like Android still use older versions, so the support is provided for all of them.
-Among many extensions available for Vulkan, only a few interact with memory management. VMA can automatically take advantage of them. Some of them are: VK_EXT_memory_budget, VK_EXT_memory_priority, VK_KHR_external_memory_win32, and VK_KHR_maintenance* extensions that are later promoted to the new versions of the core Vulkan API. To use them, it is your responsibility to validate if they are available on the current system and if so, enable them while creating the Vulkan device object. You also need to pass appropriate VmaAllocatorCreateFlagBits to inform VMA that they are enabled. Then, the library will automatically take advantage of them. For more information and the full list of supported extensions, see Enabling extensions.
+Among many extensions available for Vulkan, only a few interact with memory management. VMA can automatically take advantage of them. Some of them are: VK_EXT_memory_budget, VK_EXT_memory_priority, VK_KHR_external_memory_win32, and VK_KHR_maintenance* extensions that are later promoted to the new versions of the core Vulkan API. To use them, it is your responsibility to validate if they are available on the current system and if so, enable them while creating the Vulkan device object. You also need to pass appropriate VmaAllocatorCreateFlagBits to inform VMA that they are enabled. Then, the library will automatically take advantage of them. For more information and the full list of supported extensions, see Enabling extensions.
Does it support other graphics APIs, like Microsoft DirectX(R) 12?
No, but we offer an equivalent library for DirectX 12: D3D12 Memory Allocator. It uses the same core allocation algorithm. It also shares many features with VMA, like the support for custom pools and virtual allocator. However, it is not identical in terms of the features supported. Its API also looks different, because while the interface of VMA is similar in style to Vulkan, the interface of D3D12MA is similar to DirectX 12.
Is the library lightweight?
@@ -149,13 +149,13 @@I found some compilation warnings. How can we fix them?
-Seeing compiler warnings may be annoying to some developers, but it is a design decision to not fix all of them. Due to the nature of the C++ language, certain preprocessor macros can make some variables unused, function parameters unreferenced, or conditional expressions constant in some configurations. The code of this library should not be bigger or more complicated just to silence these warnings. It is recommended to disable such warnings instead. For more information, see Features not supported.
+Seeing compiler warnings may be annoying to some developers, but it is a design decision to not fix all of them. Due to the nature of the C++ language, certain preprocessor macros can make some variables unused, function parameters unreferenced, or conditional expressions constant in some configurations. The code of this library should not be bigger or more complicated just to silence these warnings. It is recommended to disable such warnings instead. For more information, see Features not supported.
However, if you observe a warning that is really dangerous, e.g., about an implicit conversion from a larger to a smaller integer type, please report it and it will be fixed ASAP.
Classes | |
| struct | VmaAllocationCreateInfo |
| struct | VmaAllocationCreateInfo |
| Parameters of new VmaAllocation. More... | |
| struct | VmaPoolCreateInfo |
| struct | VmaPoolCreateInfo |
| Describes parameter of created VmaPool. More... | |
| struct | VmaAllocationInfo |
| struct | VmaAllocationInfo2 |
| struct | VmaAllocationInfo |
| struct | VmaAllocationInfo2 |
| Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2(). More... | |
| struct | VmaDefragmentationInfo |
| struct | VmaDefragmentationInfo |
| Parameters for defragmentation. More... | |
| struct | VmaDefragmentationMove |
| struct | VmaDefragmentationMove |
| Single move of an allocation to be done for defragmentation. More... | |
| struct | VmaDefragmentationPassMoveInfo |
| struct | VmaDefragmentationPassMoveInfo |
| Parameters for incremental defragmentation steps. More... | |
| struct | VmaDefragmentationStats |
| struct | VmaDefragmentationStats |
| Statistics returned for defragmentation process in function vmaEndDefragmentation(). More... | |
| struct | VmaPool |
| struct | VmaPool |
| Represents custom memory pool. More... | |
| struct | VmaAllocation |
| struct | VmaAllocation |
| Represents single memory allocation. More... | |
| struct | VmaDefragmentationContext |
| struct | VmaDefragmentationContext |
| An opaque object that represents started defragmentation process. More... | |
Typedefs | |
| typedef enum VmaMemoryUsage | VmaMemoryUsage |
| typedef enum VmaMemoryUsage | VmaMemoryUsage |
| Intended usage of the allocated memory. | |
| typedef enum VmaAllocationCreateFlagBits | VmaAllocationCreateFlagBits |
| typedef enum VmaAllocationCreateFlagBits | VmaAllocationCreateFlagBits |
| Flags to be passed as VmaAllocationCreateInfo::flags. | |
| typedef VkFlags | VmaAllocationCreateFlags |
| typedef VkFlags | VmaAllocationCreateFlags |
| See VmaAllocationCreateFlagBits. | |
| typedef enum VmaPoolCreateFlagBits | VmaPoolCreateFlagBits |
| typedef enum VmaPoolCreateFlagBits | VmaPoolCreateFlagBits |
| Flags to be passed as VmaPoolCreateInfo::flags. | |
| typedef VkFlags | VmaPoolCreateFlags |
| typedef VkFlags | VmaPoolCreateFlags |
| Flags to be passed as VmaPoolCreateInfo::flags. See VmaPoolCreateFlagBits. | |
| typedef enum VmaDefragmentationFlagBits | VmaDefragmentationFlagBits |
| typedef enum VmaDefragmentationFlagBits | VmaDefragmentationFlagBits |
| Flags to be passed as VmaDefragmentationInfo::flags. | |
| typedef VkFlags | VmaDefragmentationFlags |
| typedef VkFlags | VmaDefragmentationFlags |
| See VmaDefragmentationFlagBits. | |
| typedef enum VmaDefragmentationMoveOperation | VmaDefragmentationMoveOperation |
| typedef enum VmaDefragmentationMoveOperation | VmaDefragmentationMoveOperation |
| Operation performed on single defragmentation move. See structure VmaDefragmentationMove. | |
| typedef struct VmaAllocationCreateInfo | VmaAllocationCreateInfo |
| typedef struct VmaAllocationCreateInfo | VmaAllocationCreateInfo |
| Parameters of new VmaAllocation. | |
| typedef struct VmaPoolCreateInfo | VmaPoolCreateInfo |
| typedef struct VmaPoolCreateInfo | VmaPoolCreateInfo |
| Describes parameter of created VmaPool. | |
| typedef struct VmaAllocationInfo | VmaAllocationInfo |
| typedef struct VmaAllocationInfo2 | VmaAllocationInfo2 |
| typedef struct VmaAllocationInfo | VmaAllocationInfo |
| typedef struct VmaAllocationInfo2 | VmaAllocationInfo2 |
| Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2(). | |
| typedef VkBool32(VKAPI_PTR * | PFN_vmaCheckDefragmentationBreakFunction) (void *pUserData) |
| typedef struct VmaDefragmentationInfo | VmaDefragmentationInfo |
| typedef VkBool32(VKAPI_PTR * | PFN_vmaCheckDefragmentationBreakFunction) (void *pUserData) |
| typedef struct VmaDefragmentationInfo | VmaDefragmentationInfo |
| Parameters for defragmentation. | |
| typedef struct VmaDefragmentationMove | VmaDefragmentationMove |
| typedef struct VmaDefragmentationMove | VmaDefragmentationMove |
| Single move of an allocation to be done for defragmentation. | |
| typedef struct VmaDefragmentationPassMoveInfo | VmaDefragmentationPassMoveInfo |
| typedef struct VmaDefragmentationPassMoveInfo | VmaDefragmentationPassMoveInfo |
| Parameters for incremental defragmentation steps. | |
| typedef struct VmaDefragmentationStats | VmaDefragmentationStats |
| typedef struct VmaDefragmentationStats | VmaDefragmentationStats |
| Statistics returned for defragmentation process in function vmaEndDefragmentation(). | |
Functions | |
| VkResult | vmaFindMemoryTypeIndex (VmaAllocator allocator, uint32_t memoryTypeBits, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| VkResult | vmaFindMemoryTypeIndex (VmaAllocator allocator, uint32_t memoryTypeBits, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo. | |
| VkResult | vmaFindMemoryTypeIndexForBufferInfo (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| VkResult | vmaFindMemoryTypeIndexForBufferInfo (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo. | |
| VkResult | vmaFindMemoryTypeIndexForImageInfo (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| VkResult | vmaFindMemoryTypeIndexForImageInfo (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo. | |
| VkResult | vmaCreatePool (VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool) |
| VkResult | vmaCreatePool (VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool) |
| Allocates Vulkan device memory and creates VmaPool object. | |
| void | vmaDestroyPool (VmaAllocator allocator, VmaPool pool) |
| void | vmaDestroyPool (VmaAllocator allocator, VmaPool pool) |
| Destroys VmaPool object and frees Vulkan device memory. | |
| VkResult | vmaCheckPoolCorruption (VmaAllocator allocator, VmaPool pool) |
| VkResult | vmaCheckPoolCorruption (VmaAllocator allocator, VmaPool pool) |
| Checks magic number in margins around all allocations in given memory pool in search for corruptions. | |
| void | vmaGetPoolName (VmaAllocator allocator, VmaPool pool, const char **ppName) |
| void | vmaGetPoolName (VmaAllocator allocator, VmaPool pool, const char **ppName) |
| Retrieves name of a custom pool. | |
| void | vmaSetPoolName (VmaAllocator allocator, VmaPool pool, const char *pName) |
| void | vmaSetPoolName (VmaAllocator allocator, VmaPool pool, const char *pName) |
| Sets name of a custom pool. | |
| VkResult | vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| General purpose memory allocation. | |
| VkResult | vmaAllocateDedicatedMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaAllocateDedicatedMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| General purpose allocation of a dedicated memory. | |
| VkResult | vmaAllocateMemoryPages (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, size_t allocationCount, VmaAllocation *pAllocations, VmaAllocationInfo *pAllocationInfo) |
| 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. | |
| VkResult | vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Allocates memory suitable for given VkBuffer. | |
| VkResult | vmaAllocateMemoryForImage (VmaAllocator allocator, VkImage image, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaAllocateMemoryForImage (VmaAllocator allocator, VkImage image, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Allocates memory suitable for given VkImage. | |
| void | vmaFreeMemory (VmaAllocator allocator, VmaAllocation allocation) |
| void | vmaFreeMemory (VmaAllocator allocator, VmaAllocation allocation) |
| Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage(). | |
| void | vmaFreeMemoryPages (VmaAllocator allocator, size_t allocationCount, const VmaAllocation *pAllocations) |
| void | vmaFreeMemoryPages (VmaAllocator allocator, size_t allocationCount, const VmaAllocation *pAllocations) |
| Frees memory and destroys multiple allocations. | |
| void | vmaGetAllocationInfo (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo) |
| void | vmaGetAllocationInfo (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo) |
| Returns current information about specified allocation. | |
| void | vmaGetAllocationInfo2 (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo2 *pAllocationInfo) |
| void | vmaGetAllocationInfo2 (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo2 *pAllocationInfo) |
| Returns extended information about specified allocation. | |
| void | vmaSetAllocationUserData (VmaAllocator allocator, VmaAllocation allocation, void *pUserData) |
| void | vmaSetAllocationUserData (VmaAllocator allocator, VmaAllocation allocation, void *pUserData) |
| Sets pUserData in given allocation to new value. | |
| void | vmaSetAllocationName (VmaAllocator allocator, VmaAllocation allocation, const char *pName) |
| void | vmaSetAllocationName (VmaAllocator allocator, VmaAllocation allocation, const char *pName) |
| Sets pName in given allocation to new value. | |
| void | vmaGetAllocationMemoryProperties (VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags) |
| void | vmaGetAllocationMemoryProperties (VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags) |
| Given an allocation, returns Property Flags of its memory type. | |
| VkResult | vmaGetMemoryWin32Handle (VmaAllocator allocator, VmaAllocation allocation, HANDLE hTargetProcess, HANDLE *pHandle) |
| VkResult | vmaGetMemoryWin32Handle (VmaAllocator allocator, VmaAllocation allocation, HANDLE hTargetProcess, HANDLE *pHandle) |
| Given an allocation, returns Win32 handle that may be imported by other processes or APIs. | |
| VkResult | vmaGetMemoryWin32Handle2 (VmaAllocator allocator, VmaAllocation allocation, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE *pHandle) |
| VkResult | vmaGetMemoryWin32Handle2 (VmaAllocator allocator, VmaAllocation allocation, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE *pHandle) |
| Given an allocation, returns Win32 handle that may be imported by other processes or APIs. | |
| VkResult | vmaMapMemory (VmaAllocator allocator, VmaAllocation allocation, void **ppData) |
| VkResult | vmaMapMemory (VmaAllocator allocator, VmaAllocation allocation, void **ppData) |
| Maps memory represented by given allocation and returns pointer to it. | |
| void | vmaUnmapMemory (VmaAllocator allocator, VmaAllocation allocation) |
| void | vmaUnmapMemory (VmaAllocator allocator, VmaAllocation allocation) |
| Unmaps memory represented by given allocation, mapped previously using vmaMapMemory(). | |
| VkResult | vmaFlushAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) |
| VkResult | vmaFlushAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) |
| Flushes memory of given allocation. | |
| VkResult | vmaInvalidateAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) |
| VkResult | vmaInvalidateAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) |
| Invalidates memory of given allocation. | |
| VkResult | vmaFlushAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes) |
| VkResult | vmaFlushAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes) |
| Flushes memory of given set of allocations. | |
| VkResult | vmaInvalidateAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes) |
| VkResult | vmaInvalidateAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes) |
| Invalidates memory of given set of allocations. | |
| VkResult | vmaCopyMemoryToAllocation (VmaAllocator allocator, const void *pSrcHostPointer, VmaAllocation dstAllocation, VkDeviceSize dstAllocationLocalOffset, VkDeviceSize size) |
| VkResult | vmaCopyMemoryToAllocation (VmaAllocator allocator, const void *pSrcHostPointer, VmaAllocation dstAllocation, VkDeviceSize dstAllocationLocalOffset, VkDeviceSize size) |
| Maps the allocation temporarily if needed, copies data from specified host pointer to it, and flushes the memory from the host caches if needed. | |
| VkResult | vmaCopyAllocationToMemory (VmaAllocator allocator, VmaAllocation srcAllocation, VkDeviceSize srcAllocationLocalOffset, void *pDstHostPointer, VkDeviceSize size) |
| VkResult | vmaCopyAllocationToMemory (VmaAllocator allocator, VmaAllocation srcAllocation, VkDeviceSize srcAllocationLocalOffset, void *pDstHostPointer, VkDeviceSize size) |
| Invalidates memory in the host caches if needed, maps the allocation temporarily if needed, and copies data from it to a specified host pointer. | |
| VkResult | vmaCheckCorruption (VmaAllocator allocator, uint32_t memoryTypeBits) |
| 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. | |
| VkResult | vmaBeginDefragmentation (VmaAllocator allocator, const VmaDefragmentationInfo *pInfo, VmaDefragmentationContext *pContext) |
| VkResult | vmaBeginDefragmentation (VmaAllocator allocator, const VmaDefragmentationInfo *pInfo, VmaDefragmentationContext *pContext) |
| Begins defragmentation process. | |
| void | vmaEndDefragmentation (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationStats *pStats) |
| void | vmaEndDefragmentation (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationStats *pStats) |
| Ends defragmentation process. | |
| VkResult | vmaBeginDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo) |
| VkResult | vmaBeginDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo) |
| Starts single defragmentation pass. | |
| VkResult | vmaEndDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo) |
| VkResult | vmaEndDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo) |
| Ends single defragmentation pass. | |
| VkResult | vmaBindBufferMemory (VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer) |
| VkResult | vmaBindBufferMemory (VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer) |
| Binds buffer to allocation. | |
| VkResult | vmaBindBufferMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkBuffer buffer, const void *(VkBindBufferMemoryInfoKHR) pNext) |
| VkResult | vmaBindBufferMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkBuffer buffer, const void *(VkBindBufferMemoryInfoKHR) pNext) |
| Binds buffer to allocation with additional parameters. | |
| VkResult | vmaBindImageMemory (VmaAllocator allocator, VmaAllocation allocation, VkImage image) |
| VkResult | vmaBindImageMemory (VmaAllocator allocator, VmaAllocation allocation, VkImage image) |
| Binds image to allocation. | |
| VkResult | vmaBindImageMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkImage image, const void *(VkBindImageMemoryInfoKHR) pNext) |
| VkResult | vmaBindImageMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkImage image, const void *(VkBindImageMemoryInfoKHR) pNext) |
| Binds image to allocation with additional parameters. | |
| VkResult | vmaCreateBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaCreateBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Creates a new VkBuffer, allocates and binds memory for it. | |
| VkResult | vmaCreateBufferWithAlignment (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkDeviceSize minAlignment, 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. | |
| VkResult | vmaCreateDedicatedBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaCreateDedicatedBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Creates a dedicated buffer while offering extra parameter pMemoryAllocateNext. | |
| VkResult | vmaCreateAliasingBuffer (VmaAllocator allocator, VmaAllocation allocation, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer) |
| VkResult | vmaCreateAliasingBuffer (VmaAllocator allocator, VmaAllocation allocation, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer) |
| Creates a new VkBuffer, binds already created memory for it. | |
| VkResult | vmaCreateAliasingBuffer2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer) |
| VkResult | vmaCreateAliasingBuffer2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer) |
| Creates a new VkBuffer, binds already created memory for it. | |
| void | vmaDestroyBuffer (VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation) |
| void | vmaDestroyBuffer (VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation) |
| Destroys Vulkan buffer and frees allocated memory. | |
| VkResult | vmaCreateImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaCreateImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Function similar to vmaCreateBuffer() but for images. | |
| VkResult | vmaCreateDedicatedImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaCreateDedicatedImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Function similar to vmaCreateDedicatedBuffer() but for images. | |
| VkResult | vmaCreateAliasingImage (VmaAllocator allocator, VmaAllocation allocation, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage) |
| VkResult | vmaCreateAliasingImage (VmaAllocator allocator, VmaAllocation allocation, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage) |
| Function similar to vmaCreateAliasingBuffer() but for images. | |
| VkResult | vmaCreateAliasingImage2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage) |
| VkResult | vmaCreateAliasingImage2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage) |
| Function similar to vmaCreateAliasingBuffer2() but for images. | |
| void | vmaDestroyImage (VmaAllocator allocator, VkImage image, VmaAllocation allocation) |
| void | vmaDestroyImage (VmaAllocator allocator, VkImage image, VmaAllocation allocation) |
| Destroys Vulkan image and frees allocated memory. | |
API elements related to the allocation, deallocation, and management of Vulkan memory, buffers, images. Most basic ones being: vmaCreateBuffer(), vmaCreateImage().
-API elements related to the allocation, deallocation, and management of Vulkan memory, buffers, images. Most basic ones being: vmaCreateBuffer(), vmaCreateImage().
+It is valid to use this flag for allocation made from memory type that is not HOST_VISIBLE. This flag is then ignored and memory is not mapped. This is useful if you need an allocation that is efficient to use on GPU (DEVICE_LOCAL) and still want to map it directly if possible on platforms that support it (e.g. Intel GPU).
-Set this flag to treat VmaAllocationCreateInfo::pUserData as pointer to a null-terminated string. Instead of copying pointer value, a local copy of the string is made and stored in allocation's pName. The string is automatically freed together with the allocation. It is also used in vmaBuildStatsString().
Allocation will be created from upper stack in a double stack pool.
@@ -635,7 +635,7 @@Requests possibility to map the allocation (using vmaMapMemory() or VMA_ALLOCATION_CREATE_MAPPED_BIT).
Declares that mapped memory will only be written sequentially, e.g. using memcpy() or a loop writing number-by-number, never read or accessed randomly, so a memory type can be selected that is uncached and write-combined.
Requests possibility to map the allocation (using vmaMapMemory() or VMA_ALLOCATION_CREATE_MAPPED_BIT).
Declares that mapped memory can be read, written, and accessed in random order, so a HOST_CACHED memory type is preferred.
No intended memory usage specified. Use other members of VmaAllocationCreateInfo to specify your requirements.
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.
Usage: Memory for transient attachment images (color attachments, depth attachments etc.), created with VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT.
@@ -785,7 +785,7 @@Enables alternative, linear allocation algorithm in this pool.
Specify this flag to enable linear allocation algorithm, which always creates new allocations after last one and doesn't reuse space from allocations freed in between. It trades memory consumption for simplified algorithm and data structure, which has better performance and uses less memory for metadata.
-By using this flag, you can achieve behavior of free-at-once, stack, ring buffer, and double stack. For details, see documentation chapter Linear allocation algorithm.
+By using this flag, you can achieve behavior of free-at-once, stack, ring buffer, and double stack. For details, see documentation chapter Linear allocation algorithm.
Bit mask to extract only ALGORITHM bits from entire set of flags.
General purpose allocation of a dedicated memory.
-This function is similar vmaAllocateMemory(), but it always allocates dedicated memory - flag VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is implied. It offers additional parameter pMemoryAllocateNext, which can be used to attach pNext chain to the VkMemoryAllocateInfo structure. It can be useful for importing external memory. For more information, see Interop with other graphics APIs.
+This function is similar vmaAllocateMemory(), but it always allocates dedicated memory - flag VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is implied. It offers additional parameter pMemoryAllocateNext, which can be used to attach pNext chain to the VkMemoryAllocateInfo structure. It can be useful for importing external memory. For more information, see Interop with other graphics APIs.
@@ -1092,7 +1092,7 @@For more information about defragmentation, see documentation chapter: Defragmentation.
+For more information about defragmentation, see documentation chapter: Defragmentation.
@@ -1324,7 +1324,7 @@Corruption detection is enabled only when VMA_DEBUG_DETECT_CORRUPTION macro is defined to nonzero, VMA_DEBUG_MARGIN is defined to nonzero and only for memory types that are HOST_VISIBLE and HOST_COHERENT. For more information, see Corruption detection.
Possible return values:
Checks magic number in margins around all allocations in given memory pool in search for corruptions.
-Corruption detection is enabled only when VMA_DEBUG_DETECT_CORRUPTION macro is defined to nonzero, VMA_DEBUG_MARGIN is defined to nonzero and the pool is created in memory type that is HOST_VISIBLE and HOST_COHERENT. For more information, see Corruption detection.
+Corruption detection is enabled only when VMA_DEBUG_DETECT_CORRUPTION macro is defined to nonzero, VMA_DEBUG_MARGIN is defined to nonzero and the pool is created in memory type that is HOST_VISIBLE and HOST_COHERENT. For more information, see Corruption detection.
Possible return values:
If VK_KHR_dedicated_allocation extenion or Vulkan version >= 1.1 is used, the function queries the driver whether it requires or prefers the new buffer to have dedicated allocation. If yes, and if dedicated allocation is possible (VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates dedicated allocation for this buffer, just like when using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
There are also extended versions of this function available:
There is also an extended versions of this function available with additional parameter pMemoryAllocateNext - see vmaCreateDedicatedBuffer().
@@ -1758,7 +1755,8 @@Creates a buffer with additional minimum alignment.
-Similar to vmaCreateBuffer() but provides additional parameter minAlignment which allows to specify custom, minimum alignment to be used when placing the buffer inside a larger memory block, which may be needed e.g. for interop with OpenGL.
+Similar to vmaCreateBuffer() but provides additional parameter minAlignment which allows to specify custom, minimum alignment to be used when placing the buffer inside a larger memory block, which may be needed e.g. for interop with OpenGL.
+Creates a dedicated buffer while offering extra parameter pMemoryAllocateNext.
-This function is similar vmaCreateBuffer(), but it always allocates dedicated memory for the buffer - flag VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is implied. It offers additional parameter pMemoryAllocateNext, which can be used to attach pNext chain to the VkMemoryAllocateInfo structure. It can be useful for importing external memory. For more information, see Interop with other graphics APIs.
+This function is similar vmaCreateBuffer(), but it always allocates dedicated memory for the buffer - flag VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is implied. It offers additional parameter pMemoryAllocateNext, which can be used to attach pNext chain to the VkMemoryAllocateInfo structure. It can be useful for importing external memory. For more information, see Interop with other graphics APIs.
@@ -1856,7 +1854,7 @@Function similar to vmaCreateDedicatedBuffer() but for images.
-This function is similar vmaCreateImage(), but it always allocates dedicated memory for the image - flag VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is implied. It offers additional parameter pMemoryAllocateNext, which can be used to attach pNext chain to the VkMemoryAllocateInfo structure. It can be useful for importing external memory. For more information, see Interop with other graphics APIs.
+This function is similar vmaCreateImage(), but it always allocates dedicated memory for the image - flag VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is implied. It offers additional parameter pMemoryAllocateNext, which can be used to attach pNext chain to the VkMemoryAllocateInfo structure. It can be useful for importing external memory. For more information, see Interop with other graphics APIs.
@@ -2500,7 +2498,7 @@This function is available compile-time only when VK_KHR_external_memory_win32 extension is available. It can be manually disabled by predefining VMA_EXTERNAL_MEMORY_WIN32=0 macro.
If the function fails with VK_ERROR_FEATURE_NOT_PRESENT error code, please double-check that VmaVulkanFunctions::vkGetMemoryWin32HandleKHR function pointer is set, e.g. either by using macro VMA_DYNAMIC_VULKAN_FUNCTIONS or by manually passing it through VmaAllocatorCreateInfo::pVulkanFunctions.
-For more information, see chapter Interop with other graphics APIs.
+For more information, see chapter Interop with other graphics APIs.
@@ -2564,7 +2562,7 @@This function is available compile-time only when VK_KHR_external_memory_win32 extension is available. It can be manually disabled by predefining VMA_EXTERNAL_MEMORY_WIN32=0 macro.
If the function fails with VK_ERROR_FEATURE_NOT_PRESENT error code, please double-check that VmaVulkanFunctions::vkGetMemoryWin32HandleKHR function pointer is set, e.g. either by using macro VMA_DYNAMIC_VULKAN_FUNCTIONS or by manually passing it through VmaAllocatorCreateInfo::pVulkanFunctions.
-For more information, see chapter Interop with other graphics APIs.
+For more information, see chapter Interop with other graphics APIs.
@@ -2841,7 +2839,7 @@Classes | |
| struct | VmaDeviceMemoryCallbacks |
| struct | VmaDeviceMemoryCallbacks |
| Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More... | |
| struct | VmaVulkanFunctions |
| struct | VmaVulkanFunctions |
| Pointers to some Vulkan functions - a subset used by the library. More... | |
| struct | VmaAllocatorCreateInfo |
| struct | VmaAllocatorCreateInfo |
| Description of a Allocator to be created. More... | |
| struct | VmaAllocatorInfo |
| struct | VmaAllocatorInfo |
| Information about existing VmaAllocator object. More... | |
| struct | VmaAllocator |
| struct | VmaAllocator |
| Represents main object of this library initialized. More... | |
Typedefs | |
| typedef enum VmaAllocatorCreateFlagBits | VmaAllocatorCreateFlagBits |
| typedef enum VmaAllocatorCreateFlagBits | VmaAllocatorCreateFlagBits |
| Flags for created VmaAllocator. | |
| typedef VkFlags | VmaAllocatorCreateFlags |
| typedef VkFlags | VmaAllocatorCreateFlags |
| See VmaAllocatorCreateFlagBits. | |
| typedef void(VKAPI_PTR * | PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData) |
| typedef void(VKAPI_PTR * | PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData) |
| Callback function called after successful vkAllocateMemory. | |
| typedef void(VKAPI_PTR * | PFN_vmaFreeDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData) |
| typedef void(VKAPI_PTR * | PFN_vmaFreeDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData) |
| Callback function called before vkFreeMemory. | |
| typedef struct VmaDeviceMemoryCallbacks | VmaDeviceMemoryCallbacks |
| typedef struct VmaDeviceMemoryCallbacks | VmaDeviceMemoryCallbacks |
| Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. | |
| typedef struct VmaVulkanFunctions | VmaVulkanFunctions |
| typedef struct VmaVulkanFunctions | VmaVulkanFunctions |
| Pointers to some Vulkan functions - a subset used by the library. | |
| typedef struct VmaAllocatorCreateInfo | VmaAllocatorCreateInfo |
| typedef struct VmaAllocatorCreateInfo | VmaAllocatorCreateInfo |
| Description of a Allocator to be created. | |
| typedef struct VmaAllocatorInfo | VmaAllocatorInfo |
| typedef struct VmaAllocatorInfo | VmaAllocatorInfo |
| Information about existing VmaAllocator object. | |
Enumerations | |
| enum | VmaAllocatorCreateFlagBits { + |
| 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 @@ -137,24 +137,24 @@ |
Functions | |
| VkResult | vmaImportVulkanFunctionsFromVolk (const VmaAllocatorCreateInfo *pAllocatorCreateInfo, VmaVulkanFunctions *pDstVulkanFunctions) |
| VkResult | vmaImportVulkanFunctionsFromVolk (const VmaAllocatorCreateInfo *pAllocatorCreateInfo, VmaVulkanFunctions *pDstVulkanFunctions) |
| Fully initializes pDstVulkanFunctions structure with Vulkan functions needed by VMA using volk library. | |
| VkResult | vmaCreateAllocator (const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator) |
| VkResult | vmaCreateAllocator (const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator) |
| Creates VmaAllocator object. | |
| void | vmaDestroyAllocator (VmaAllocator allocator) |
| void | vmaDestroyAllocator (VmaAllocator allocator) |
| Destroys allocator object. | |
| void | vmaGetAllocatorInfo (VmaAllocator allocator, VmaAllocatorInfo *pAllocatorInfo) |
| void | vmaGetAllocatorInfo (VmaAllocator allocator, VmaAllocatorInfo *pAllocatorInfo) |
| Returns information about existing VmaAllocator object - handle to Vulkan device etc. | |
| void | vmaGetPhysicalDeviceProperties (VmaAllocator allocator, const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties) |
| void | vmaGetMemoryProperties (VmaAllocator allocator, const VkPhysicalDeviceMemoryProperties **ppPhysicalDeviceMemoryProperties) |
| void | vmaGetMemoryTypeProperties (VmaAllocator allocator, uint32_t memoryTypeIndex, VkMemoryPropertyFlags *pFlags) |
| 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. | |
| void | vmaSetCurrentFrameIndex (VmaAllocator allocator, uint32_t frameIndex) |
| void | vmaSetCurrentFrameIndex (VmaAllocator allocator, uint32_t frameIndex) |
| Sets index of the current frame. | |
API elements related to the initialization and management of the entire library, especially VmaAllocator object.
-API elements related to the initialization and management of the entire library, especially VmaAllocator object.
+When this flag is set, you can create buffers with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT using VMA. The library automatically adds VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT to allocated memory blocks wherever it might be needed.
-For more information, see documentation chapter Enabling buffer device address.
+For more information, see documentation chapter Enabling buffer device address.
Enables usage of VK_EXT_memory_priority extension in the library.
You may set this flag only if you found available and enabled this device extension, along with VkPhysicalDeviceMemoryPriorityFeaturesEXT::memoryPriority == VK_TRUE, while creating Vulkan device passed as VmaAllocatorCreateInfo::device.
@@ -357,7 +357,7 @@Enables usage of VK_KHR_external_memory_win32 extension in the library.
-You should set this flag if you found available and enabled this device extension, while creating Vulkan device passed as VmaAllocatorCreateInfo::device. For more information, see Interop with other graphics APIs.
+You should set this flag if you found available and enabled this device extension, while creating Vulkan device passed as VmaAllocatorCreateInfo::device. For more information, see Interop with other graphics APIs.
API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. See documentation chapter: Statistics. +
API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. See documentation chapter: Statistics. More...
Classes | |
| struct | VmaStatistics |
| struct | VmaStatistics |
| Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total. More... | |
| struct | VmaDetailedStatistics |
| struct | VmaDetailedStatistics |
| More detailed statistics than VmaStatistics. More... | |
| struct | VmaTotalStatistics |
| struct | VmaTotalStatistics |
| General statistics from current state of the Allocator - total memory usage across all memory heaps and types. More... | |
| struct | VmaBudget |
| struct | VmaBudget |
| Statistics of current memory usage and available budget for a specific memory heap. More... | |
Typedefs | |
| typedef struct VmaStatistics | VmaStatistics |
| typedef struct VmaStatistics | VmaStatistics |
| Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total. | |
| typedef struct VmaDetailedStatistics | VmaDetailedStatistics |
| typedef struct VmaDetailedStatistics | VmaDetailedStatistics |
| More detailed statistics than VmaStatistics. | |
| typedef struct VmaTotalStatistics | VmaTotalStatistics |
| typedef struct VmaTotalStatistics | VmaTotalStatistics |
| General statistics from current state of the Allocator - total memory usage across all memory heaps and types. | |
| typedef struct VmaBudget | VmaBudget |
| typedef struct VmaBudget | VmaBudget |
| Statistics of current memory usage and available budget for a specific memory heap. | |
Functions | |
| void | vmaCalculateStatistics (VmaAllocator allocator, VmaTotalStatistics *pStats) |
| void | vmaCalculateStatistics (VmaAllocator allocator, VmaTotalStatistics *pStats) |
| Retrieves statistics from current state of the Allocator. | |
| void | vmaGetHeapBudgets (VmaAllocator allocator, VmaBudget *pBudgets) |
| void | vmaGetHeapBudgets (VmaAllocator allocator, VmaBudget *pBudgets) |
| Retrieves information about current memory usage and budget for all memory heaps. | |
| void | vmaGetPoolStatistics (VmaAllocator allocator, VmaPool pool, VmaStatistics *pPoolStats) |
| void | vmaGetPoolStatistics (VmaAllocator allocator, VmaPool pool, VmaStatistics *pPoolStats) |
| Retrieves statistics of existing VmaPool object. | |
| void | vmaCalculatePoolStatistics (VmaAllocator allocator, VmaPool pool, VmaDetailedStatistics *pPoolStats) |
| void | vmaCalculatePoolStatistics (VmaAllocator allocator, VmaPool pool, VmaDetailedStatistics *pPoolStats) |
| Retrieves detailed statistics of existing VmaPool object. | |
| void | vmaBuildVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char **ppStatsString, VkBool32 detailedMap) |
| void | vmaBuildVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char **ppStatsString, VkBool32 detailedMap) |
| Builds and returns a null-terminated string in JSON format with information about given VmaVirtualBlock. | |
| void | vmaFreeVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char *pStatsString) |
| void | vmaFreeVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char *pStatsString) |
| Frees a string returned by vmaBuildVirtualBlockStatsString(). | |
| void | vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap) |
| void | vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap) |
| Builds and returns statistics as a null-terminated string in JSON format. | |
| void | vmaFreeStatsString (VmaAllocator allocator, char *pStatsString) |
| void | vmaFreeStatsString (VmaAllocator allocator, char *pStatsString) |
API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. See documentation chapter: Statistics.
-API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. See documentation chapter: Statistics.
+API elements related to the mechanism of Virtual allocator - using the core allocation algorithm for user-defined purpose without allocating any real GPU memory. +
API elements related to the mechanism of Virtual allocator - using the core allocation algorithm for user-defined purpose without allocating any real GPU memory. More...
Classes | |
| struct | VmaVirtualBlockCreateInfo |
| struct | VmaVirtualBlockCreateInfo |
| Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock(). More... | |
| struct | VmaVirtualAllocationCreateInfo |
| struct | VmaVirtualAllocationCreateInfo |
| Parameters of created virtual allocation to be passed to vmaVirtualAllocate(). More... | |
| struct | VmaVirtualAllocationInfo |
| struct | VmaVirtualAllocationInfo |
| Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo(). More... | |
| struct | VmaVirtualAllocation |
| struct | VmaVirtualAllocation |
| Represents single memory allocation done inside VmaVirtualBlock. More... | |
| struct | VmaVirtualBlock |
| struct | VmaVirtualBlock |
| Handle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory. More... | |
Enumerations | |
| enum | VmaVirtualBlockCreateFlagBits { VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = 0x00000001 + |
| enum | VmaVirtualBlockCreateFlagBits { VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = 0x00000001 , 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 { + |
| 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 @@ -134,30 +134,30 @@ |
Functions | |
| VkResult | vmaCreateVirtualBlock (const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock) |
| VkResult | vmaCreateVirtualBlock (const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock) |
| Creates new VmaVirtualBlock object. | |
| void | vmaDestroyVirtualBlock (VmaVirtualBlock virtualBlock) |
| void | vmaDestroyVirtualBlock (VmaVirtualBlock virtualBlock) |
| Destroys VmaVirtualBlock object. | |
| VkBool32 | vmaIsVirtualBlockEmpty (VmaVirtualBlock virtualBlock) |
| VkBool32 | vmaIsVirtualBlockEmpty (VmaVirtualBlock virtualBlock) |
| Returns true of the VmaVirtualBlock is empty - contains 0 virtual allocations and has all its space available for new allocations. | |
| void | vmaGetVirtualAllocationInfo (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, VmaVirtualAllocationInfo *pVirtualAllocInfo) |
| 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. | |
| VkResult | vmaVirtualAllocate (VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VmaVirtualAllocation *pAllocation, VkDeviceSize *pOffset) |
| VkResult | vmaVirtualAllocate (VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VmaVirtualAllocation *pAllocation, VkDeviceSize *pOffset) |
| Allocates new virtual allocation inside given VmaVirtualBlock. | |
| void | vmaVirtualFree (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation) |
| void | vmaVirtualFree (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation) |
| Frees virtual allocation inside given VmaVirtualBlock. | |
| void | vmaClearVirtualBlock (VmaVirtualBlock virtualBlock) |
| void | vmaClearVirtualBlock (VmaVirtualBlock virtualBlock) |
| Frees all virtual allocations inside given VmaVirtualBlock. | |
| void | vmaSetVirtualAllocationUserData (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, void *pUserData) |
| void | vmaSetVirtualAllocationUserData (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, void *pUserData) |
| Changes custom pointer associated with given virtual allocation. | |
| void | vmaGetVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaStatistics *pStats) |
| void | vmaGetVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaStatistics *pStats) |
| Calculates and returns statistics about virtual allocations and memory usage in given VmaVirtualBlock. | |
| void | vmaCalculateVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaDetailedStatistics *pStats) |
| void | vmaCalculateVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaDetailedStatistics *pStats) |
| Calculates and returns detailed statistics about virtual allocations and memory usage in given VmaVirtualBlock. | |
API elements related to the mechanism of Virtual allocator - using the core allocation algorithm for user-defined purpose without allocating any real GPU memory.
-API elements related to the mechanism of Virtual allocator - using the core allocation algorithm for user-defined purpose without allocating any real GPU memory.
+Enables alternative, linear allocation algorithm in this virtual block.
Specify this flag to enable linear allocation algorithm, which always creates new allocations after last one and doesn't reuse space from allocations freed in between. It trades memory consumption for simplified algorithm and data structure, which has better performance and uses less memory for metadata.
-By using this flag, you can achieve behavior of free-at-once, stack, ring buffer, and double stack. For details, see documentation chapter Linear allocation algorithm.
+By using this flag, you can achieve behavior of free-at-once, stack, ring buffer, and double stack. For details, see documentation chapter Linear allocation algorithm.
Bit mask to extract only ALGORITHM bits from entire set of flags.
Version 3.4.0-development
-Copyright (c) 2017-2025 Advanced Micro Devices, Inc. All rights reserved.
+
Copyright (c) 2017-2026 Advanced Micro Devices, Inc. All rights reserved.
License: MIT
See also: product page on GPUOpen, repository on GitHub
API documentation divided into groups: Topics
General documentation chapters:
Memory in Vulkan doesn't need to be unmapped before using it on GPU, but unless a memory types has VK_MEMORY_PROPERTY_HOST_COHERENT_BIT flag set, you need to manually invalidate cache before reading of mapped pointer and flush cache after writing to mapped pointer. Map/unmap operations don't do that automatically. Vulkan provides following functions for this purpose vkFlushMappedMemoryRanges(), vkInvalidateMappedMemoryRanges(), but this library provides more convenient functions that refer to given allocation object: vmaFlushAllocation(), vmaInvalidateAllocation(), or multiple objects at once: vmaFlushAllocations(), vmaInvalidateAllocations().
@@ -169,7 +169,7 @@2) Check if "VK_KHR_external_memory_win32" is available among device extensions. Enable it when creating the VkDevice object.
3) Enable the usage of this extension in VMA by setting flag VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT when calling vmaCreateAllocator().
-4) Make sure that VMA has access to the vkGetMemoryWin32HandleKHR function by either enabling VMA_DYNAMIC_VULKAN_FUNCTIONS macro or setting VmaVulkanFunctions::vkGetMemoryWin32HandleKHR explicitly. For more information, see Importing Vulkan functions.
+4) Make sure that VMA has access to the vkGetMemoryWin32HandleKHR function by either enabling VMA_DYNAMIC_VULKAN_FUNCTIONS macro or setting VmaVulkanFunctions::vkGetMemoryWin32HandleKHR explicitly. For more information, see Importing Vulkan functions.
You can find example usage among tests, in file "Tests.cpp", function TestWin32Handles().
-To use the extenion, buffers need to be created with VkExternalMemoryBufferCreateInfoKHR attached to their pNext chain, and memory allocations need to be made with VkExportMemoryAllocateInfoKHR attached to their pNext chain. To make use of them, you need to use Custom memory pools. Example:
+To use the extenion, buffers need to be created with VkExternalMemoryBufferCreateInfoKHR attached to their pNext chain, and memory allocations need to be made with VkExportMemoryAllocateInfoKHR attached to their pNext chain. To make use of them, you need to use Custom memory pools. Example:
Note that the structure passed as VmaPoolCreateInfo::pMemoryAllocateNext must remain alive and unchanged for the whole lifetime of the custom pool, because it will be used when the pool allocates a new device memory block. No copy is made internally. This is why variable exportMemAllocInfo is defined as static.
If you want to export all memory allocated by VMA from certain memory types, including dedicated allocations and allocations made from default pools, an alternative solution is to fill in VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes. It should point to an array with VkExternalMemoryHandleTypeFlagsKHR to be automatically passed by the library through VkExportMemoryAllocateInfoKHR on each allocation made from a specific memory type. You should not mix these two methods in a way that allows to apply both to the same memory type. Otherwise, VkExportMemoryAllocateInfoKHR structure would be attached twice to the pNext chain of VkMemoryAllocateInfo.
@@ -176,6 +176,7 @@If you need each allocation to have its own device memory block and start at offset 0, you can still do by using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag. It works also with custom pools.
+Alternatively, you can use convenient functions vmaCreateDedicatedBuffer(), vmaCreateDedicatedImage() that always allocate dedicated memory for the buffer/image created, and also allow specifying custom pNext chain for the VkMemoryAllocateInfo structure.
After the allocation is created, you can acquire a Win32 HANDLE to the VkDeviceMemory block it belongs to. VMA function vmaGetMemoryWin32Handle2() is a replacement of the Vulkan function vkGetMemoryWin32HandleKHR.
@@ -196,8 +197,8 @@Buffers or images exported to a different API like OpenGL may require a different alignment, higher than the one used by the library automatically, queried from functions like vkGetBufferMemoryRequirements. To impose such alignment:
-You can create Custom memory pools for such allocations. Set VmaPoolCreateInfo::minAllocationAlignment member to the minimum alignment required for each allocation to be made out of this pool. The alignment actually used will be the maximum of this member and the alignment returned for the specific buffer or image from a function like vkGetBufferMemoryRequirements, which is called by VMA automatically.
-If you want to create a buffer with a specific minimum alignment out of default pools, you can use special function vmaCreateBufferWithAlignment(), which takes additional parameter minAlignment.
+You can create Custom memory pools for such allocations. Set VmaPoolCreateInfo::minAllocationAlignment member to the minimum alignment required for each allocation to be made out of this pool. The alignment actually used will be the maximum of this member and the alignment returned for the specific buffer or image from a function like vkGetBufferMemoryRequirements, which is called by VMA automatically.
+If you want to create a buffer/image/allocate memory with a specific minimum alignment out of default pools, you can use VmaAllocationCreateInfo::minAlignment.
Note the problem of alignment affects only resources placed inside bigger VkDeviceMemory blocks and not dedicated allocations, as these, by definition, always have alignment = 0 because the resource is bound to the beginning of its dedicated block. You can ensure that an allocation is created as dedicated by using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. Contrary to Direct3D 12, Vulkan doesn't have a concept of alignment of the entire memory block passed on its allocation.
VMA supports Vulkan version down to 1.0, for backward compatibility. If you want to use higher version, you need to inform the library about it. This is a two-step process.
-Step 1: Compile time. By default, VMA compiles with code supporting the highest Vulkan version found in the included <vulkan/vulkan.h> that is also supported by the library. If this is OK, you don't need to do anything. However, if you want to compile VMA as if only some lower Vulkan version was available, define macro VMA_VULKAN_VERSION before every #include "vk_mem_alloc.h". It should have decimal numeric value in form of ABBBCCC, where A = major, BBB = minor, CCC = patch Vulkan version. For example, to compile against Vulkan 1.2:
+Step 1: Compile time. By default, VMA compiles with code supporting the highest Vulkan version found in the included <vulkan/vulkan.h> that is also supported by the library. If this is OK, you don't need to do anything. However, if you want to compile VMA as if only some lower Vulkan version was available, define macro VMA_VULKAN_VERSION before every #include "vk_mem_alloc.h". It should have decimal numeric value in form of ABBBCCC, where A = major, BBB = minor, CCC = patch Vulkan version. For example, to compile against Vulkan 1.2:
Step 2: Runtime. Even when compiled with higher Vulkan version available, VMA can use only features of a lower version, which is configurable during creation of the VmaAllocator object. By default, only Vulkan 1.0 is used. To initialize the allocator with support for higher Vulkan version, you need to set member VmaAllocatorCreateInfo::vulkanApiVersion to an appropriate value, e.g. using constants like VK_API_VERSION_1_2. See code sample below.
@@ -200,7 +200,7 @@There are additional configuration options available through preprocessor macros that you can define before including VMA header and through parameters passed in VmaAllocatorCreateInfo. They include a possibility to use your own callbacks for host memory allocations (VkAllocationCallbacks), callbacks for device memory allocations (instead of vkAllocateMemory, vkFreeMemory), or your custom VMA_ASSERT macro, among others. For more information, see: Configuration.
+There are additional configuration options available through preprocessor macros that you can define before including VMA header and through parameters passed in VmaAllocatorCreateInfo. They include a possibility to use your own callbacks for host memory allocations (VkAllocationCallbacks), callbacks for device memory allocations (instead of vkAllocateMemory, vkFreeMemory), or your custom VMA_ASSERT macro, among others. For more information, see: Configuration.
When you want to create a buffer or image:
@@ -227,12 +227,12 @@Don't forget to destroy your buffer and allocation objects when no longer needed:
If you need to map the buffer, you must set flag VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT in VmaAllocationCreateInfo::flags. There are many additional parameters that can control the choice of memory type to be used for the allocation and other features. For more information, see documentation chapters: Choosing memory type, Memory mapping.
+If you need to map the buffer, you must set flag VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT in VmaAllocationCreateInfo::flags. There are many additional parameters that can control the choice of memory type to be used for the allocation and other features. For more information, see documentation chapters: Choosing memory type, Memory mapping.
This library contains several functions that return information about its internal state, especially the amount of memory allocated from Vulkan.
If you need to obtain basic statistics about memory usage per heap, together with current budget, you can call function vmaGetHeapBudgets() and inspect structure VmaBudget. This is useful to keep track of memory usage and stay within budget (see also Staying within budget). Example:
+If you need to obtain basic statistics about memory usage per heap, together with current budget, you can call function vmaGetHeapBudgets() and inspect structure VmaBudget. This is useful to keep track of memory usage and stay within budget (see also Staying within budget). Example:
You can query for information about a specific allocation using function vmaGetAllocationInfo(). It fill structure VmaAllocationInfo.
You can dump internal state of the allocator to a string in JSON format using function vmaBuildStatsString(). The result is guaranteed to be correct JSON. It uses ANSI encoding. Any strings provided by user (see Allocation names) are copied as-is and properly escaped for JSON, so if they use UTF-8, ISO-8859-2 or any other encoding, this JSON string can be treated as using this encoding. It must be freed using function vmaFreeStatsString().
+You can dump internal state of the allocator to a string in JSON format using function vmaBuildStatsString(). The result is guaranteed to be correct JSON. It uses ANSI encoding. Any strings provided by user (see Allocation names) are copied as-is and properly escaped for JSON, so if they use UTF-8, ISO-8859-2 or any other encoding, this JSON string can be treated as using this encoding. It must be freed using function vmaFreeStatsString().
The format of this JSON string is not part of official documentation of the library, but it will not change in backward-incompatible way without increasing library major version number and appropriate mention in changelog.
The JSON string contains all the data that can be obtained using vmaCalculateStatistics(). It can also contain detailed map of allocated memory blocks and their regions - free and occupied by allocations. This allows e.g. to visualize the memory or assess fragmentation.
On AMD graphics cards there is a custom vendor extension available: VK_AMD_memory_overallocation_behavior that allows to control the behavior of the Vulkan implementation in out-of-memory cases - whether it should fail with an error code or still allow the allocation. Usage of this extension involves only passing extra structure on Vulkan device creation, so it is out of scope of this library.
Finally, you can also use VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT flag to make sure a new allocation is created only when it fits inside one of the existing memory blocks. If it would require to allocate a new block, if fails instead with VK_ERROR_OUT_OF_DEVICE_MEMORY. This also ensures that the function call is very fast because it never goes to Vulkan to obtain a new block.
-Represents single memory allocation.
It may be either dedicated block of VkDeviceMemory or a specific region of a bigger block of this type plus unique offset.
-There are multiple ways to create such object. You need to fill structure VmaAllocationCreateInfo. For more information see Choosing memory type.
+There are multiple ways to create such object. You need to fill structure VmaAllocationCreateInfo. For more information see Choosing memory type.
Although the library provides convenience functions that create Vulkan buffer or image, allocate memory for it and bind them together, binding of the allocation to a buffer or an image is out of scope of the allocation itself. Allocation object can exist without buffer/image bound, binding can be done manually by the user, and destruction of it can be done independently of destruction of the allocation.
The object also remembers its size and some other information. To retrieve this information, use function vmaGetAllocationInfo() and inspect returned structure VmaAllocationInfo.
Public Attributes | |
| VmaAllocationCreateFlags | flags |
| VmaAllocationCreateFlags | flags |
| Use VmaAllocationCreateFlagBits enum. | |
| VmaMemoryUsage | usage |
| VmaMemoryUsage | usage |
| Intended usage of memory. | |
| VkMemoryPropertyFlags | requiredFlags |
| VkMemoryPropertyFlags | requiredFlags |
| Flags that must be set in a Memory Type chosen for an allocation. | |
| VkMemoryPropertyFlags | preferredFlags |
| VkMemoryPropertyFlags | preferredFlags |
| Flags that preferably should be set in a memory type chosen for an allocation. | |
| uint32_t | memoryTypeBits |
| uint32_t | memoryTypeBits |
| Bitmask containing one bit set for every memory type acceptable for this allocation. | |
| VmaPool | pool |
| VmaPool | pool |
| Pool that this allocation should be created in. | |
| void * | pUserData |
| void * | pUserData |
| Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData(). | |
| float | priority |
| float | priority |
| A floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations. | |
| VkDeviceSize | minAlignment |
| Additional minimum alignment to be used for this allocation. Can be 0. | |
Parameters of new VmaAllocation.
@@ -134,7 +136,25 @@| VkDeviceSize VmaAllocationCreateInfo::minAlignment | +
Additional minimum alignment to be used for this allocation. Can be 0.
+Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two.
+When creating a buffer or an image, specifying a custom alignment is not needed in most cases, because Vulkan implementation inspects the CreateInfo structure (including intended usage flags) and returns required alignment through functions like vkGetBufferMemoryRequirements2, which VMA automatically uses and respects. Extra alignment may be needed in some cases, like when using a buffer for acceleration structure scratch (VkPhysicalDeviceAccelerationStructurePropertiesKHR::minAccelerationStructureScratchOffsetAlignment, see also issue #523) or when doing interop with OpenGL.
Pool that this allocation should be created in.
-Leave VK_NULL_HANDLE to allocate from default pool. If not null, members: usage, requiredFlags, preferredFlags, memoryTypeBits are ignored.
+Leave VK_NULL_HANDLE to allocate from default pool. If not null, members: usage, requiredFlags, preferredFlags, memoryTypeBits are ignored.
@@ -169,7 +189,7 @@Public Attributes | |
| uint32_t | memoryType |
| uint32_t | memoryType |
| Memory type index that this allocation was allocated from. | |
| VkDeviceMemory | deviceMemory |
| VkDeviceMemory | deviceMemory |
| Handle to Vulkan memory object. | |
| VkDeviceSize | offset |
| Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation. | |
| VkDeviceSize | size |
| VkDeviceSize | offset |
| Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation. | |
| VkDeviceSize | size |
| Size of this allocation, in bytes. | |
| void * | pMappedData |
| void * | pMappedData |
| Pointer to the beginning of this allocation as mapped data. | |
| void * | pUserData |
| void * | pUserData |
| Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData(). | |
| const char * | pName |
| const char * | pName |
| Custom allocation name that was set with vmaSetAllocationName(). | |
It can change after the allocation is moved during Defragmentation.
@@ -146,9 +146,9 @@Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.
+Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.
You usually don't need to use this offset. If you create a buffer or an image together with the allocation using e.g. function vmaCreateBuffer(), vmaCreateImage(), functions that operate on these resources refer to the beginning of the buffer or image, not entire device memory block. Functions like vmaMapMemory(), vmaBindBufferMemory() also refer to the beginning of the allocation and apply this offset automatically.
-It can change after the allocation is moved during Defragmentation.
+It can change after the allocation is moved during Defragmentation.
@@ -166,7 +166,7 @@It can change after call to vmaMapMemory(), vmaUnmapMemory(). It can also change after the allocation is moved during Defragmentation.
+It can change after call to vmaMapMemory(), vmaUnmapMemory(). It can also change after the allocation is moved during Defragmentation.
@@ -229,7 +229,7 @@Public Attributes | |
| VmaAllocationInfo | allocationInfo |
| VmaAllocationInfo | allocationInfo |
| Basic parameters of the allocation. | |
| VkDeviceSize | blockSize |
| VkDeviceSize | blockSize |
| Size of the VkDeviceMemory block that the allocation belongs to. | |
| VkBool32 | dedicatedMemory |
| VkBool32 | dedicatedMemory |
| VK_TRUE if the allocation has dedicated memory, VK_FALSE if it was placed as part of a larger memory block. | |
Public Attributes | |
| VmaAllocatorCreateFlags | flags |
| VmaAllocatorCreateFlags | flags |
| Flags for created allocator. Use VmaAllocatorCreateFlagBits enum. | |
| VkPhysicalDevice | physicalDevice |
| VkPhysicalDevice | physicalDevice |
| Vulkan physical device. | |
| VkDevice | device |
| VkDevice | device |
| Vulkan device. | |
| VkDeviceSize | preferredLargeHeapBlockSize |
| VkDeviceSize | preferredLargeHeapBlockSize |
| Preferred size of a single VkDeviceMemory block to be allocated from large heaps > 1 GiB. Optional. | |
| const VkAllocationCallbacks * | pAllocationCallbacks |
| const VkAllocationCallbacks * | pAllocationCallbacks |
| Custom CPU memory allocation callbacks. Optional. | |
| const VmaDeviceMemoryCallbacks * | pDeviceMemoryCallbacks |
| const VmaDeviceMemoryCallbacks * | pDeviceMemoryCallbacks |
| Informative callbacks for vkAllocateMemory, vkFreeMemory. Optional. | |
| const VkDeviceSize * | pHeapSizeLimit |
| const VkDeviceSize * | pHeapSizeLimit |
| Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap. | |
| const VmaVulkanFunctions * | pVulkanFunctions |
| const VmaVulkanFunctions * | pVulkanFunctions |
| Pointers to Vulkan functions. Can be null. | |
| VkInstance | instance |
| VkInstance | instance |
| Handle to Vulkan instance object. | |
| uint32_t | vulkanApiVersion |
| uint32_t | vulkanApiVersion |
| Optional. Vulkan version that the application uses. | |
| const VkExternalMemoryHandleTypeFlagsKHR * | pTypeExternalMemoryHandleTypes |
| const VkExternalMemoryHandleTypeFlagsKHR * | pTypeExternalMemoryHandleTypes |
| Either null or a pointer to an array of external memory handle types for each Vulkan memory type. | |
Any of the elements may be equal to VK_WHOLE_SIZE, which means no limit on that heap. This is also the default in case of pHeapSizeLimit = NULL.
+Any of the elements may be equal to VK_WHOLE_SIZE, which means no limit on that heap. This is also the default in case of pHeapSizeLimit = NULL.
If there is a limit defined for a heap:
Any of the elements may be equal to 0, which means not to use VkExportMemoryAllocateInfoKHR on this memory type. This is also the default in case of pTypeExternalMemoryHandleTypes = NULL.
+Any of the elements may be equal to 0, which means not to use VkExportMemoryAllocateInfoKHR on this memory type. This is also the default in case of pTypeExternalMemoryHandleTypes = NULL.
@@ -282,7 +282,7 @@Pointers to Vulkan functions. Can be null.
-For details see Pointers to Vulkan functions.
+For details see Pointers to Vulkan functions.
@@ -309,7 +309,7 @@Public Attributes | |
| VkInstance | instance |
| VkInstance | instance |
| Handle to Vulkan instance object. | |
| VkPhysicalDevice | physicalDevice |
| VkPhysicalDevice | physicalDevice |
| Handle to Vulkan physical device object. | |
| VkDevice | device |
| VkDevice | device |
| Handle to Vulkan device object. | |
Public Attributes | |
| VmaStatistics | statistics |
| VmaStatistics | statistics |
| Statistics fetched from the library. | |
| VkDeviceSize | usage |
| VkDeviceSize | usage |
| Estimated current memory usage of the program, in bytes. | |
| VkDeviceSize | budget |
| VkDeviceSize | budget |
| Estimated amount of memory available to the program, in bytes. | |
It might be different (most probably smaller) than VkMemoryHeap::size[heapIndex] due to factors external to the program, decided by the operating system. Difference budget - usage is the amount of additional memory that can probably be allocated without problems. Exceeding the budget may result in various problems.
@@ -152,7 +152,7 @@Public Attributes | |
| VmaDefragmentationFlags | flags |
| VmaDefragmentationFlags | flags |
| Use combination of VmaDefragmentationFlagBits. | |
| VmaPool | pool |
| VmaPool | pool |
| Custom pool to be defragmented. | |
| VkDeviceSize | maxBytesPerPass |
| VkDeviceSize | maxBytesPerPass |
| Maximum numbers of bytes that can be copied during single pass, while moving allocations to different places. | |
| uint32_t | maxAllocationsPerPass |
| uint32_t | maxAllocationsPerPass |
| Maximum number of allocations that can be moved during single pass to a different place. | |
| PFN_vmaCheckDefragmentationBreakFunction | pfnBreakCallback |
| PFN_vmaCheckDefragmentationBreakFunction | pfnBreakCallback |
| Optional custom callback for stopping vmaBeginDefragmentation(). | |
| void * | pBreakCallbackUserData |
| void * | pBreakCallbackUserData |
| Optional data to pass to custom callback for stopping pass of defragmentation. | |
Public Attributes | |
| VmaDefragmentationMoveOperation | operation |
| VmaDefragmentationMoveOperation | operation |
| Operation to be performed on the allocation by vmaEndDefragmentationPass(). Default value is VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY. You can modify it. | |
| VmaAllocation | srcAllocation |
| VmaAllocation | srcAllocation |
| Allocation that should be moved. | |
| VmaAllocation | dstTmpAllocation |
| Temporary allocation pointing to destination memory that will replace srcAllocation. | |
| VmaAllocation | dstTmpAllocation |
| Temporary allocation pointing to destination memory that will replace srcAllocation. | |
Single move of an allocation to be done for defragmentation.
@@ -105,8 +105,8 @@Temporary allocation pointing to destination memory that will replace srcAllocation.
-Temporary allocation pointing to destination memory that will replace srcAllocation.
+Public Attributes | |
| uint32_t | moveCount |
| Number of elements in the pMoves array. | |
| VmaDefragmentationMove * | pMoves |
| uint32_t | moveCount |
| Number of elements in the pMoves array. | |
| VmaDefragmentationMove * | pMoves |
| Array of moves to be performed by the user in the current defragmentation pass. | |
Number of elements in the pMoves array.
+Number of elements in the pMoves array.
@@ -121,7 +121,7 @@Array of moves to be performed by the user in the current defragmentation pass.
-Pointer to an array of moveCount elements, owned by VMA, created in vmaBeginDefragmentationPass(), destroyed in vmaEndDefragmentationPass().
+Pointer to an array of moveCount elements, owned by VMA, created in vmaBeginDefragmentationPass(), destroyed in vmaEndDefragmentationPass().
For each element, you should:
Public Attributes | |
| VkDeviceSize | bytesMoved |
| VkDeviceSize | bytesMoved |
| Total number of bytes that have been copied while moving allocations to different places. | |
| VkDeviceSize | bytesFreed |
| VkDeviceSize | bytesFreed |
| Total number of bytes that have been released to the system by freeing empty VkDeviceMemory objects. | |
| uint32_t | allocationsMoved |
| uint32_t | allocationsMoved |
| Number of allocations that have been moved to different places. | |
| uint32_t | deviceMemoryBlocksFreed |
| uint32_t | deviceMemoryBlocksFreed |
| Number of empty VkDeviceMemory objects that have been released to the system. | |
Public Attributes | |
| VmaStatistics | statistics |
| VmaStatistics | statistics |
| Basic statistics. | |
| uint32_t | unusedRangeCount |
| uint32_t | unusedRangeCount |
| Number of free ranges of memory between allocations. | |
| VkDeviceSize | allocationSizeMin |
| VkDeviceSize | allocationSizeMin |
| Smallest allocation size. VK_WHOLE_SIZE if there are 0 allocations. | |
| VkDeviceSize | allocationSizeMax |
| VkDeviceSize | allocationSizeMax |
| Largest allocation size. 0 if there are 0 allocations. | |
| VkDeviceSize | unusedRangeSizeMin |
| VkDeviceSize | unusedRangeSizeMin |
| Smallest empty range size. VK_WHOLE_SIZE if there are 0 empty ranges. | |
| VkDeviceSize | unusedRangeSizeMax |
| VkDeviceSize | unusedRangeSizeMax |
| Largest empty range size. 0 if there are 0 empty ranges. | |
Public Attributes | |
| PFN_vmaAllocateDeviceMemoryFunction | pfnAllocate |
| PFN_vmaAllocateDeviceMemoryFunction | pfnAllocate |
| Optional, can be null. | |
| PFN_vmaFreeDeviceMemoryFunction | pfnFree |
| PFN_vmaFreeDeviceMemoryFunction | pfnFree |
| Optional, can be null. | |
| void * | pUserData |
| void * | pUserData |
| Optional, can be null. | |
Represents custom memory pool.
Fill structure VmaPoolCreateInfo and call function vmaCreatePool() to create it. Call function vmaDestroyPool() to destroy it.
-For more information see Custom memory pools.
+For more information see Custom memory pools.
Public Attributes | |
| uint32_t | memoryTypeIndex |
| uint32_t | memoryTypeIndex |
| Vulkan memory type index to allocate this pool from. | |
| VmaPoolCreateFlags | flags |
| VmaPoolCreateFlags | flags |
| Use combination of VmaPoolCreateFlagBits. | |
| VkDeviceSize | blockSize |
| VkDeviceSize | blockSize |
| Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes. Optional. | |
| size_t | minBlockCount |
| size_t | minBlockCount |
| Minimum number of blocks to be always allocated in this pool, even if they stay empty. | |
| size_t | maxBlockCount |
| size_t | maxBlockCount |
| Maximum number of blocks that can be allocated in this pool. Optional. | |
| float | priority |
| float | priority |
| A floating-point value between 0 and 1, indicating the priority of the allocations in this pool relative to other memory allocations. | |
| VkDeviceSize | minAllocationAlignment |
| VkDeviceSize | minAllocationAlignment |
| Additional minimum alignment to be used for all allocations created from this pool. Can be 0. | |
| void *VkMemoryAllocateInfo | pMemoryAllocateNext |
| void *VkMemoryAllocateInfo | pMemoryAllocateNext |
| Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this pool. Optional. | |
Additional minimum alignment to be used for all allocations created from this pool. Can be 0.
-Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two. It can be useful in cases where alignment returned by Vulkan by functions like vkGetBufferMemoryRequirements is not enough, e.g. when doing interop with OpenGL.
+Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two.
+When creating a buffer or an image, specifying a custom alignment is not needed in most cases, because Vulkan implementation inspects the CreateInfo structure (including intended usage flags) and returns required alignment through functions like vkGetBufferMemoryRequirements2, which VMA automatically uses and respects. Extra alignment may be needed in some cases, like when using a buffer for acceleration structure scratch (VkPhysicalDeviceAccelerationStructurePropertiesKHR::minAccelerationStructureScratchOffsetAlignment, see also issue #523) or when doing interop with OpenGL.
@@ -246,7 +247,7 @@Public Attributes | |
| uint32_t | blockCount |
| uint32_t | blockCount |
| Number of VkDeviceMemory objects - Vulkan memory blocks allocated. | |
| uint32_t | allocationCount |
| uint32_t | allocationCount |
| Number of VmaAllocation objects allocated. | |
| VkDeviceSize | blockBytes |
| VkDeviceSize | blockBytes |
| Number of bytes allocated in VkDeviceMemory blocks. | |
| VkDeviceSize | allocationBytes |
| VkDeviceSize | allocationBytes |
| Total number of bytes occupied by all VmaAllocation objects. | |
Total number of bytes occupied by all VmaAllocation objects.
-Always less or equal than blockBytes. Difference (blockBytes - allocationBytes) is the amount of memory allocated from Vulkan but unused by any VmaAllocation.
+Always less or equal than blockBytes. Difference (blockBytes - allocationBytes) is the amount of memory allocated from Vulkan but unused by any VmaAllocation.
@@ -126,7 +126,7 @@Number of VmaAllocation objects allocated.
-Dedicated allocations have their own blocks, so each one adds 1 to allocationCount as well as blockCount.
+Dedicated allocations have their own blocks, so each one adds 1 to allocationCount as well as blockCount.
@@ -169,7 +169,7 @@Public Attributes | |
| VmaDetailedStatistics | memoryType [VK_MAX_MEMORY_TYPES] |
| VmaDetailedStatistics | memoryHeap [VK_MAX_MEMORY_HEAPS] |
| VmaDetailedStatistics | total |
| VmaDetailedStatistics | memoryType [VK_MAX_MEMORY_TYPES] |
| VmaDetailedStatistics | memoryHeap [VK_MAX_MEMORY_HEAPS] |
| VmaDetailedStatistics | total |
General statistics from current state of the Allocator - total memory usage across all memory heaps and types.
@@ -139,7 +139,7 @@Public Attributes | |
| VkDeviceSize | size |
| VkDeviceSize | size |
| Size of the allocation. | |
| VkDeviceSize | alignment |
| VkDeviceSize | alignment |
| Required alignment of the allocation. Optional. | |
| VmaVirtualAllocationCreateFlags | flags |
| VmaVirtualAllocationCreateFlags | flags |
| Use combination of VmaVirtualAllocationCreateFlagBits. | |
| void * | pUserData |
| void * | pUserData |
| Custom pointer to be associated with the allocation. Optional. | |
Public Attributes | |
| VkDeviceSize | offset |
| VkDeviceSize | offset |
| Offset of the allocation. | |
| VkDeviceSize | size |
| VkDeviceSize | size |
| Size of the allocation. | |
| void * | pUserData |
| void * | pUserData |
| Custom pointer associated with the allocation. | |
Handle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory.
-Fill in VmaVirtualBlockCreateInfo structure and use vmaCreateVirtualBlock() to create it. Use vmaDestroyVirtualBlock() to destroy it. For more information, see documentation chapter Virtual allocator.
+Fill in VmaVirtualBlockCreateInfo structure and use vmaCreateVirtualBlock() to create it. Use vmaDestroyVirtualBlock() to destroy it. For more information, see documentation chapter Virtual allocator.
This object is not thread-safe - should not be used from multiple threads simultaneously, must be synchronized externally.
Public Attributes | |
| VkDeviceSize | size |
| VkDeviceSize | size |
| Total size of the virtual block. | |
| VmaVirtualBlockCreateFlags | flags |
| VmaVirtualBlockCreateFlags | flags |
| Use combination of VmaVirtualBlockCreateFlagBits. | |
| const VkAllocationCallbacks * | pAllocationCallbacks |
| const VkAllocationCallbacks * | pAllocationCallbacks |
| Custom CPU memory allocation callbacks. Optional. | |
Public Attributes | |
| PFN_vkGetInstanceProcAddr | vkGetInstanceProcAddr |
| PFN_vkGetInstanceProcAddr | vkGetInstanceProcAddr |
| Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS. | |
| PFN_vkGetDeviceProcAddr | vkGetDeviceProcAddr |
| PFN_vkGetDeviceProcAddr | vkGetDeviceProcAddr |
| Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS. | |
| PFN_vkGetPhysicalDeviceProperties | vkGetPhysicalDeviceProperties |
| PFN_vkGetPhysicalDeviceMemoryProperties | vkGetPhysicalDeviceMemoryProperties |
| PFN_vkAllocateMemory | vkAllocateMemory |
| PFN_vkFreeMemory | vkFreeMemory |
| PFN_vkMapMemory | vkMapMemory |
| PFN_vkUnmapMemory | vkUnmapMemory |
| PFN_vkFlushMappedMemoryRanges | vkFlushMappedMemoryRanges |
| PFN_vkInvalidateMappedMemoryRanges | vkInvalidateMappedMemoryRanges |
| PFN_vkBindBufferMemory | vkBindBufferMemory |
| PFN_vkBindImageMemory | vkBindImageMemory |
| PFN_vkGetBufferMemoryRequirements | vkGetBufferMemoryRequirements |
| PFN_vkGetImageMemoryRequirements | vkGetImageMemoryRequirements |
| PFN_vkCreateBuffer | vkCreateBuffer |
| PFN_vkDestroyBuffer | vkDestroyBuffer |
| PFN_vkCreateImage | vkCreateImage |
| PFN_vkDestroyImage | vkDestroyImage |
| PFN_vkCmdCopyBuffer | vkCmdCopyBuffer |
| PFN_vkGetBufferMemoryRequirements2KHR | vkGetBufferMemoryRequirements2KHR |
| PFN_vkGetPhysicalDeviceProperties | vkGetPhysicalDeviceProperties |
| PFN_vkGetPhysicalDeviceMemoryProperties | vkGetPhysicalDeviceMemoryProperties |
| PFN_vkAllocateMemory | vkAllocateMemory |
| PFN_vkFreeMemory | vkFreeMemory |
| PFN_vkMapMemory | vkMapMemory |
| PFN_vkUnmapMemory | vkUnmapMemory |
| PFN_vkFlushMappedMemoryRanges | vkFlushMappedMemoryRanges |
| PFN_vkInvalidateMappedMemoryRanges | vkInvalidateMappedMemoryRanges |
| PFN_vkBindBufferMemory | vkBindBufferMemory |
| PFN_vkBindImageMemory | vkBindImageMemory |
| PFN_vkGetBufferMemoryRequirements | vkGetBufferMemoryRequirements |
| PFN_vkGetImageMemoryRequirements | vkGetImageMemoryRequirements |
| PFN_vkCreateBuffer | vkCreateBuffer |
| PFN_vkDestroyBuffer | vkDestroyBuffer |
| PFN_vkCreateImage | vkCreateImage |
| PFN_vkDestroyImage | vkDestroyImage |
| PFN_vkCmdCopyBuffer | vkCmdCopyBuffer |
| PFN_vkGetBufferMemoryRequirements2KHR | vkGetBufferMemoryRequirements2KHR |
| Fetch "vkGetBufferMemoryRequirements2" on Vulkan >= 1.1, fetch "vkGetBufferMemoryRequirements2KHR" when using VK_KHR_dedicated_allocation extension. | |
| PFN_vkGetImageMemoryRequirements2KHR | vkGetImageMemoryRequirements2KHR |
| PFN_vkGetImageMemoryRequirements2KHR | vkGetImageMemoryRequirements2KHR |
| Fetch "vkGetImageMemoryRequirements2" on Vulkan >= 1.1, fetch "vkGetImageMemoryRequirements2KHR" when using VK_KHR_dedicated_allocation extension. | |
| PFN_vkBindBufferMemory2KHR | vkBindBufferMemory2KHR |
| PFN_vkBindBufferMemory2KHR | vkBindBufferMemory2KHR |
| Fetch "vkBindBufferMemory2" on Vulkan >= 1.1, fetch "vkBindBufferMemory2KHR" when using VK_KHR_bind_memory2 extension. | |
| PFN_vkBindImageMemory2KHR | vkBindImageMemory2KHR |
| PFN_vkBindImageMemory2KHR | vkBindImageMemory2KHR |
| Fetch "vkBindImageMemory2" on Vulkan >= 1.1, fetch "vkBindImageMemory2KHR" when using VK_KHR_bind_memory2 extension. | |
| PFN_vkGetPhysicalDeviceMemoryProperties2KHR | vkGetPhysicalDeviceMemoryProperties2KHR |
| PFN_vkGetPhysicalDeviceMemoryProperties2KHR | vkGetPhysicalDeviceMemoryProperties2KHR |
| Fetch from "vkGetPhysicalDeviceMemoryProperties2" on Vulkan >= 1.1, but you can also fetch it from "vkGetPhysicalDeviceMemoryProperties2KHR" if you enabled extension VK_KHR_get_physical_device_properties2. | |
| PFN_vkGetDeviceBufferMemoryRequirementsKHR | vkGetDeviceBufferMemoryRequirements |
| PFN_vkGetDeviceBufferMemoryRequirementsKHR | vkGetDeviceBufferMemoryRequirements |
| Fetch from "vkGetDeviceBufferMemoryRequirements" on Vulkan >= 1.3, but you can also fetch it from "vkGetDeviceBufferMemoryRequirementsKHR" if you enabled extension VK_KHR_maintenance4. | |
| PFN_vkGetDeviceImageMemoryRequirementsKHR | vkGetDeviceImageMemoryRequirements |
| PFN_vkGetDeviceImageMemoryRequirementsKHR | vkGetDeviceImageMemoryRequirements |
| Fetch from "vkGetDeviceImageMemoryRequirements" on Vulkan >= 1.3, but you can also fetch it from "vkGetDeviceImageMemoryRequirementsKHR" if you enabled extension VK_KHR_maintenance4. | |
| PFN_vkGetMemoryWin32HandleKHR | vkGetMemoryWin32HandleKHR |
| PFN_vkGetMemoryWin32HandleKHR | vkGetMemoryWin32HandleKHR |
Pointers to some Vulkan functions - a subset used by the library.
@@ -526,7 +526,7 @@| Library initialization | API elements related to the initialization and management of the entire library, especially VmaAllocator object |
| Memory allocation | API elements related to the allocation, deallocation, and management of Vulkan memory, buffers, images. Most basic ones being: vmaCreateBuffer(), vmaCreateImage() |
| Virtual allocator | API elements related to the mechanism of Virtual allocator - using the core allocation algorithm for user-defined purpose without allocating any real GPU memory |
| Statistics | API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. See documentation chapter: Statistics |
| Virtual allocator | API elements related to the mechanism of Virtual allocator - using the core allocation algorithm for user-defined purpose without allocating any real GPU memory |
| Statistics | API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. See documentation chapter: Statistics |
Also consider: You can map the allocation using vmaMapMemory() or you can create it as persistenly mapped using VMA_ALLOCATION_CREATE_MAPPED_BIT, as in the example above.
It feels natural to express sizes and offsets in bytes. If an offset of an allocation needs to be aligned to a multiply of some number (e.g. 4 bytes), you can fill optional member VmaVirtualAllocationCreateInfo::alignment to request it. Example:
@@ -160,7 +160,7 @@Alignments of different allocations made from one block may vary. However, if all alignments and sizes are always multiply of some size e.g. 4 B or sizeof(MyDataStruct), you can express all sizes, alignments, and offsets in multiples of that size instead of individual bytes. It might be more convenient, but you need to make sure to use this new unit consistently in all the places:
The "virtual allocator" functionality is implemented on a level of individual memory blocks. Keeping track of a whole collection of blocks, allocating new ones when out of free space, deleting empty ones, and deciding which one to try first for a new allocation must be implemented by the user.
-Alternative allocation algorithms are supported, just like in custom pools of the real GPU memory. See enum VmaVirtualBlockCreateFlagBits to learn how to specify them (e.g. VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT). You can find their description in chapter Custom memory pools. Allocation strategies are also supported. See enum VmaVirtualAllocationCreateFlagBits to learn how to specify them (e.g. VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT).
+Alternative allocation algorithms are supported, just like in custom pools of the real GPU memory. See enum VmaVirtualBlockCreateFlagBits to learn how to specify them (e.g. VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT). You can find their description in chapter Custom memory pools. Allocation strategies are also supported. See enum VmaVirtualAllocationCreateFlagBits to learn how to specify them (e.g. VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT).
Following features are supported only by the allocator of the real GPU memory and not by virtual allocations: buffer-image granularity, VMA_DEBUG_MARGIN, VMA_MIN_ALIGNMENT.
Classes | |
| struct | VmaDeviceMemoryCallbacks |
| struct | VmaDeviceMemoryCallbacks |
| Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More... | |
| struct | VmaVulkanFunctions |
| struct | VmaVulkanFunctions |
| Pointers to some Vulkan functions - a subset used by the library. More... | |
| struct | VmaAllocatorCreateInfo |
| struct | VmaAllocatorCreateInfo |
| Description of a Allocator to be created. More... | |
| struct | VmaAllocatorInfo |
| struct | VmaAllocatorInfo |
| Information about existing VmaAllocator object. More... | |
| struct | VmaStatistics |
| struct | VmaStatistics |
| Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total. More... | |
| struct | VmaDetailedStatistics |
| struct | VmaDetailedStatistics |
| More detailed statistics than VmaStatistics. More... | |
| struct | VmaTotalStatistics |
| struct | VmaTotalStatistics |
| General statistics from current state of the Allocator - total memory usage across all memory heaps and types. More... | |
| struct | VmaBudget |
| struct | VmaBudget |
| Statistics of current memory usage and available budget for a specific memory heap. More... | |
| struct | VmaAllocationCreateInfo |
| struct | VmaAllocationCreateInfo |
| Parameters of new VmaAllocation. More... | |
| struct | VmaPoolCreateInfo |
| struct | VmaPoolCreateInfo |
| Describes parameter of created VmaPool. More... | |
| struct | VmaAllocationInfo |
| struct | VmaAllocationInfo2 |
| struct | VmaAllocationInfo |
| struct | VmaAllocationInfo2 |
| Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2(). More... | |
| struct | VmaDefragmentationInfo |
| struct | VmaDefragmentationInfo |
| Parameters for defragmentation. More... | |
| struct | VmaDefragmentationMove |
| struct | VmaDefragmentationMove |
| Single move of an allocation to be done for defragmentation. More... | |
| struct | VmaDefragmentationPassMoveInfo |
| struct | VmaDefragmentationPassMoveInfo |
| Parameters for incremental defragmentation steps. More... | |
| struct | VmaDefragmentationStats |
| struct | VmaDefragmentationStats |
| Statistics returned for defragmentation process in function vmaEndDefragmentation(). More... | |
| struct | VmaVirtualBlockCreateInfo |
| struct | VmaVirtualBlockCreateInfo |
| Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock(). More... | |
| struct | VmaVirtualAllocationCreateInfo |
| struct | VmaVirtualAllocationCreateInfo |
| Parameters of created virtual allocation to be passed to vmaVirtualAllocate(). More... | |
| struct | VmaVirtualAllocationInfo |
| struct | VmaVirtualAllocationInfo |
| Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo(). More... | |
Macros | |
| #define | VMA_VERSION (VK_MAKE_VERSION(3, 4, 0)) |
| #define | VMA_VERSION (VK_MAKE_VERSION(3, 4, 0)) |
Typedefs | |
| typedef enum VmaAllocatorCreateFlagBits | VmaAllocatorCreateFlagBits |
| typedef enum VmaAllocatorCreateFlagBits | VmaAllocatorCreateFlagBits |
| Flags for created VmaAllocator. | |
| typedef VkFlags | VmaAllocatorCreateFlags |
| typedef VkFlags | VmaAllocatorCreateFlags |
| See VmaAllocatorCreateFlagBits. | |
| typedef enum VmaMemoryUsage | VmaMemoryUsage |
| typedef enum VmaMemoryUsage | VmaMemoryUsage |
| Intended usage of the allocated memory. | |
| typedef enum VmaAllocationCreateFlagBits | VmaAllocationCreateFlagBits |
| typedef enum VmaAllocationCreateFlagBits | VmaAllocationCreateFlagBits |
| Flags to be passed as VmaAllocationCreateInfo::flags. | |
| typedef VkFlags | VmaAllocationCreateFlags |
| typedef VkFlags | VmaAllocationCreateFlags |
| See VmaAllocationCreateFlagBits. | |
| typedef enum VmaPoolCreateFlagBits | VmaPoolCreateFlagBits |
| typedef enum VmaPoolCreateFlagBits | VmaPoolCreateFlagBits |
| Flags to be passed as VmaPoolCreateInfo::flags. | |
| typedef VkFlags | VmaPoolCreateFlags |
| typedef VkFlags | VmaPoolCreateFlags |
| Flags to be passed as VmaPoolCreateInfo::flags. See VmaPoolCreateFlagBits. | |
| typedef enum VmaDefragmentationFlagBits | VmaDefragmentationFlagBits |
| typedef enum VmaDefragmentationFlagBits | VmaDefragmentationFlagBits |
| Flags to be passed as VmaDefragmentationInfo::flags. | |
| typedef VkFlags | VmaDefragmentationFlags |
| typedef VkFlags | VmaDefragmentationFlags |
| See VmaDefragmentationFlagBits. | |
| typedef enum VmaDefragmentationMoveOperation | VmaDefragmentationMoveOperation |
| typedef enum VmaDefragmentationMoveOperation | VmaDefragmentationMoveOperation |
| Operation performed on single defragmentation move. See structure VmaDefragmentationMove. | |
| typedef enum VmaVirtualBlockCreateFlagBits | VmaVirtualBlockCreateFlagBits |
| typedef enum VmaVirtualBlockCreateFlagBits | VmaVirtualBlockCreateFlagBits |
| Flags to be passed as VmaVirtualBlockCreateInfo::flags. | |
| typedef VkFlags | VmaVirtualBlockCreateFlags |
| typedef VkFlags | VmaVirtualBlockCreateFlags |
| Flags to be passed as VmaVirtualBlockCreateInfo::flags. See VmaVirtualBlockCreateFlagBits. | |
| typedef enum VmaVirtualAllocationCreateFlagBits | VmaVirtualAllocationCreateFlagBits |
| typedef enum VmaVirtualAllocationCreateFlagBits | VmaVirtualAllocationCreateFlagBits |
| Flags to be passed as VmaVirtualAllocationCreateInfo::flags. | |
| typedef VkFlags | VmaVirtualAllocationCreateFlags |
| typedef VkFlags | VmaVirtualAllocationCreateFlags |
| Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See VmaVirtualAllocationCreateFlagBits. | |
| typedef void(VKAPI_PTR * | PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData) |
| typedef void(VKAPI_PTR * | PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData) |
| Callback function called after successful vkAllocateMemory. | |
| typedef void(VKAPI_PTR * | PFN_vmaFreeDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData) |
| typedef void(VKAPI_PTR * | PFN_vmaFreeDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData) |
| Callback function called before vkFreeMemory. | |
| typedef struct VmaDeviceMemoryCallbacks | VmaDeviceMemoryCallbacks |
| typedef struct VmaDeviceMemoryCallbacks | VmaDeviceMemoryCallbacks |
| Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. | |
| typedef struct VmaVulkanFunctions | VmaVulkanFunctions |
| typedef struct VmaVulkanFunctions | VmaVulkanFunctions |
| Pointers to some Vulkan functions - a subset used by the library. | |
| typedef struct VmaAllocatorCreateInfo | VmaAllocatorCreateInfo |
| typedef struct VmaAllocatorCreateInfo | VmaAllocatorCreateInfo |
| Description of a Allocator to be created. | |
| typedef struct VmaAllocatorInfo | VmaAllocatorInfo |
| typedef struct VmaAllocatorInfo | VmaAllocatorInfo |
| Information about existing VmaAllocator object. | |
| typedef struct VmaStatistics | VmaStatistics |
| typedef struct VmaStatistics | VmaStatistics |
| Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total. | |
| typedef struct VmaDetailedStatistics | VmaDetailedStatistics |
| typedef struct VmaDetailedStatistics | VmaDetailedStatistics |
| More detailed statistics than VmaStatistics. | |
| typedef struct VmaTotalStatistics | VmaTotalStatistics |
| typedef struct VmaTotalStatistics | VmaTotalStatistics |
| General statistics from current state of the Allocator - total memory usage across all memory heaps and types. | |
| typedef struct VmaBudget | VmaBudget |
| typedef struct VmaBudget | VmaBudget |
| Statistics of current memory usage and available budget for a specific memory heap. | |
| typedef struct VmaAllocationCreateInfo | VmaAllocationCreateInfo |
| typedef struct VmaAllocationCreateInfo | VmaAllocationCreateInfo |
| Parameters of new VmaAllocation. | |
| typedef struct VmaPoolCreateInfo | VmaPoolCreateInfo |
| typedef struct VmaPoolCreateInfo | VmaPoolCreateInfo |
| Describes parameter of created VmaPool. | |
| typedef struct VmaAllocationInfo | VmaAllocationInfo |
| typedef struct VmaAllocationInfo2 | VmaAllocationInfo2 |
| typedef struct VmaAllocationInfo | VmaAllocationInfo |
| typedef struct VmaAllocationInfo2 | VmaAllocationInfo2 |
| Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2(). | |
| typedef VkBool32(VKAPI_PTR * | PFN_vmaCheckDefragmentationBreakFunction) (void *pUserData) |
| typedef struct VmaDefragmentationInfo | VmaDefragmentationInfo |
| typedef VkBool32(VKAPI_PTR * | PFN_vmaCheckDefragmentationBreakFunction) (void *pUserData) |
| typedef struct VmaDefragmentationInfo | VmaDefragmentationInfo |
| Parameters for defragmentation. | |
| typedef struct VmaDefragmentationMove | VmaDefragmentationMove |
| typedef struct VmaDefragmentationMove | VmaDefragmentationMove |
| Single move of an allocation to be done for defragmentation. | |
| typedef struct VmaDefragmentationPassMoveInfo | VmaDefragmentationPassMoveInfo |
| typedef struct VmaDefragmentationPassMoveInfo | VmaDefragmentationPassMoveInfo |
| Parameters for incremental defragmentation steps. | |
| typedef struct VmaDefragmentationStats | VmaDefragmentationStats |
| typedef struct VmaDefragmentationStats | VmaDefragmentationStats |
| Statistics returned for defragmentation process in function vmaEndDefragmentation(). | |
| typedef struct VmaVirtualBlockCreateInfo | VmaVirtualBlockCreateInfo |
| typedef struct VmaVirtualBlockCreateInfo | VmaVirtualBlockCreateInfo |
| Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock(). | |
| typedef struct VmaVirtualAllocationCreateInfo | VmaVirtualAllocationCreateInfo |
| typedef struct VmaVirtualAllocationCreateInfo | VmaVirtualAllocationCreateInfo |
| Parameters of created virtual allocation to be passed to vmaVirtualAllocate(). | |
| typedef struct VmaVirtualAllocationInfo | VmaVirtualAllocationInfo |
| typedef struct VmaVirtualAllocationInfo | VmaVirtualAllocationInfo |
| Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo(). | |
Functions | |
| VkResult | vmaImportVulkanFunctionsFromVolk (const VmaAllocatorCreateInfo *pAllocatorCreateInfo, VmaVulkanFunctions *pDstVulkanFunctions) |
| VkResult | vmaImportVulkanFunctionsFromVolk (const VmaAllocatorCreateInfo *pAllocatorCreateInfo, VmaVulkanFunctions *pDstVulkanFunctions) |
| Fully initializes pDstVulkanFunctions structure with Vulkan functions needed by VMA using volk library. | |
| VkResult | vmaCreateAllocator (const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator) |
| VkResult | vmaCreateAllocator (const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator) |
| Creates VmaAllocator object. | |
| void | vmaDestroyAllocator (VmaAllocator allocator) |
| void | vmaDestroyAllocator (VmaAllocator allocator) |
| Destroys allocator object. | |
| void | vmaGetAllocatorInfo (VmaAllocator allocator, VmaAllocatorInfo *pAllocatorInfo) |
| void | vmaGetAllocatorInfo (VmaAllocator allocator, VmaAllocatorInfo *pAllocatorInfo) |
| Returns information about existing VmaAllocator object - handle to Vulkan device etc. | |
| void | vmaGetPhysicalDeviceProperties (VmaAllocator allocator, const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties) |
| void | vmaGetMemoryProperties (VmaAllocator allocator, const VkPhysicalDeviceMemoryProperties **ppPhysicalDeviceMemoryProperties) |
| void | vmaGetMemoryTypeProperties (VmaAllocator allocator, uint32_t memoryTypeIndex, VkMemoryPropertyFlags *pFlags) |
| 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. | |
| void | vmaSetCurrentFrameIndex (VmaAllocator allocator, uint32_t frameIndex) |
| void | vmaSetCurrentFrameIndex (VmaAllocator allocator, uint32_t frameIndex) |
| Sets index of the current frame. | |
| void | vmaCalculateStatistics (VmaAllocator allocator, VmaTotalStatistics *pStats) |
| void | vmaCalculateStatistics (VmaAllocator allocator, VmaTotalStatistics *pStats) |
| Retrieves statistics from current state of the Allocator. | |
| void | vmaGetHeapBudgets (VmaAllocator allocator, VmaBudget *pBudgets) |
| void | vmaGetHeapBudgets (VmaAllocator allocator, VmaBudget *pBudgets) |
| Retrieves information about current memory usage and budget for all memory heaps. | |
| VkResult | vmaFindMemoryTypeIndex (VmaAllocator allocator, uint32_t memoryTypeBits, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| VkResult | vmaFindMemoryTypeIndex (VmaAllocator allocator, uint32_t memoryTypeBits, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo. | |
| VkResult | vmaFindMemoryTypeIndexForBufferInfo (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| VkResult | vmaFindMemoryTypeIndexForBufferInfo (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo. | |
| VkResult | vmaFindMemoryTypeIndexForImageInfo (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| VkResult | vmaFindMemoryTypeIndexForImageInfo (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo. | |
| VkResult | vmaCreatePool (VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool) |
| VkResult | vmaCreatePool (VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool) |
| Allocates Vulkan device memory and creates VmaPool object. | |
| void | vmaDestroyPool (VmaAllocator allocator, VmaPool pool) |
| void | vmaDestroyPool (VmaAllocator allocator, VmaPool pool) |
| Destroys VmaPool object and frees Vulkan device memory. | |
| void | vmaGetPoolStatistics (VmaAllocator allocator, VmaPool pool, VmaStatistics *pPoolStats) |
| void | vmaGetPoolStatistics (VmaAllocator allocator, VmaPool pool, VmaStatistics *pPoolStats) |
| Retrieves statistics of existing VmaPool object. | |
| void | vmaCalculatePoolStatistics (VmaAllocator allocator, VmaPool pool, VmaDetailedStatistics *pPoolStats) |
| void | vmaCalculatePoolStatistics (VmaAllocator allocator, VmaPool pool, VmaDetailedStatistics *pPoolStats) |
| Retrieves detailed statistics of existing VmaPool object. | |
| VkResult | vmaCheckPoolCorruption (VmaAllocator allocator, VmaPool pool) |
| VkResult | vmaCheckPoolCorruption (VmaAllocator allocator, VmaPool pool) |
| Checks magic number in margins around all allocations in given memory pool in search for corruptions. | |
| void | vmaGetPoolName (VmaAllocator allocator, VmaPool pool, const char **ppName) |
| void | vmaGetPoolName (VmaAllocator allocator, VmaPool pool, const char **ppName) |
| Retrieves name of a custom pool. | |
| void | vmaSetPoolName (VmaAllocator allocator, VmaPool pool, const char *pName) |
| void | vmaSetPoolName (VmaAllocator allocator, VmaPool pool, const char *pName) |
| Sets name of a custom pool. | |
| VkResult | vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| General purpose memory allocation. | |
| VkResult | vmaAllocateDedicatedMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaAllocateDedicatedMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| General purpose allocation of a dedicated memory. | |
| VkResult | vmaAllocateMemoryPages (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, size_t allocationCount, VmaAllocation *pAllocations, VmaAllocationInfo *pAllocationInfo) |
| 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. | |
| VkResult | vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Allocates memory suitable for given VkBuffer. | |
| VkResult | vmaAllocateMemoryForImage (VmaAllocator allocator, VkImage image, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaAllocateMemoryForImage (VmaAllocator allocator, VkImage image, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Allocates memory suitable for given VkImage. | |
| void | vmaFreeMemory (VmaAllocator allocator, VmaAllocation allocation) |
| void | vmaFreeMemory (VmaAllocator allocator, VmaAllocation allocation) |
| Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage(). | |
| void | vmaFreeMemoryPages (VmaAllocator allocator, size_t allocationCount, const VmaAllocation *pAllocations) |
| void | vmaFreeMemoryPages (VmaAllocator allocator, size_t allocationCount, const VmaAllocation *pAllocations) |
| Frees memory and destroys multiple allocations. | |
| void | vmaGetAllocationInfo (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo) |
| void | vmaGetAllocationInfo (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo) |
| Returns current information about specified allocation. | |
| void | vmaGetAllocationInfo2 (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo2 *pAllocationInfo) |
| void | vmaGetAllocationInfo2 (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo2 *pAllocationInfo) |
| Returns extended information about specified allocation. | |
| void | vmaSetAllocationUserData (VmaAllocator allocator, VmaAllocation allocation, void *pUserData) |
| void | vmaSetAllocationUserData (VmaAllocator allocator, VmaAllocation allocation, void *pUserData) |
| Sets pUserData in given allocation to new value. | |
| void | vmaSetAllocationName (VmaAllocator allocator, VmaAllocation allocation, const char *pName) |
| void | vmaSetAllocationName (VmaAllocator allocator, VmaAllocation allocation, const char *pName) |
| Sets pName in given allocation to new value. | |
| void | vmaGetAllocationMemoryProperties (VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags) |
| void | vmaGetAllocationMemoryProperties (VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags) |
| Given an allocation, returns Property Flags of its memory type. | |
| VkResult | vmaGetMemoryWin32Handle (VmaAllocator allocator, VmaAllocation allocation, HANDLE hTargetProcess, HANDLE *pHandle) |
| VkResult | vmaGetMemoryWin32Handle (VmaAllocator allocator, VmaAllocation allocation, HANDLE hTargetProcess, HANDLE *pHandle) |
| Given an allocation, returns Win32 handle that may be imported by other processes or APIs. | |
| VkResult | vmaGetMemoryWin32Handle2 (VmaAllocator allocator, VmaAllocation allocation, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE *pHandle) |
| VkResult | vmaGetMemoryWin32Handle2 (VmaAllocator allocator, VmaAllocation allocation, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE *pHandle) |
| Given an allocation, returns Win32 handle that may be imported by other processes or APIs. | |
| VkResult | vmaMapMemory (VmaAllocator allocator, VmaAllocation allocation, void **ppData) |
| VkResult | vmaMapMemory (VmaAllocator allocator, VmaAllocation allocation, void **ppData) |
| Maps memory represented by given allocation and returns pointer to it. | |
| void | vmaUnmapMemory (VmaAllocator allocator, VmaAllocation allocation) |
| void | vmaUnmapMemory (VmaAllocator allocator, VmaAllocation allocation) |
| Unmaps memory represented by given allocation, mapped previously using vmaMapMemory(). | |
| VkResult | vmaFlushAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) |
| VkResult | vmaFlushAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) |
| Flushes memory of given allocation. | |
| VkResult | vmaInvalidateAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) |
| VkResult | vmaInvalidateAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) |
| Invalidates memory of given allocation. | |
| VkResult | vmaFlushAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes) |
| VkResult | vmaFlushAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes) |
| Flushes memory of given set of allocations. | |
| VkResult | vmaInvalidateAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes) |
| VkResult | vmaInvalidateAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes) |
| Invalidates memory of given set of allocations. | |
| VkResult | vmaCopyMemoryToAllocation (VmaAllocator allocator, const void *pSrcHostPointer, VmaAllocation dstAllocation, VkDeviceSize dstAllocationLocalOffset, VkDeviceSize size) |
| VkResult | vmaCopyMemoryToAllocation (VmaAllocator allocator, const void *pSrcHostPointer, VmaAllocation dstAllocation, VkDeviceSize dstAllocationLocalOffset, VkDeviceSize size) |
| Maps the allocation temporarily if needed, copies data from specified host pointer to it, and flushes the memory from the host caches if needed. | |
| VkResult | vmaCopyAllocationToMemory (VmaAllocator allocator, VmaAllocation srcAllocation, VkDeviceSize srcAllocationLocalOffset, void *pDstHostPointer, VkDeviceSize size) |
| VkResult | vmaCopyAllocationToMemory (VmaAllocator allocator, VmaAllocation srcAllocation, VkDeviceSize srcAllocationLocalOffset, void *pDstHostPointer, VkDeviceSize size) |
| Invalidates memory in the host caches if needed, maps the allocation temporarily if needed, and copies data from it to a specified host pointer. | |
| VkResult | vmaCheckCorruption (VmaAllocator allocator, uint32_t memoryTypeBits) |
| 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. | |
| VkResult | vmaBeginDefragmentation (VmaAllocator allocator, const VmaDefragmentationInfo *pInfo, VmaDefragmentationContext *pContext) |
| VkResult | vmaBeginDefragmentation (VmaAllocator allocator, const VmaDefragmentationInfo *pInfo, VmaDefragmentationContext *pContext) |
| Begins defragmentation process. | |
| void | vmaEndDefragmentation (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationStats *pStats) |
| void | vmaEndDefragmentation (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationStats *pStats) |
| Ends defragmentation process. | |
| VkResult | vmaBeginDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo) |
| VkResult | vmaBeginDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo) |
| Starts single defragmentation pass. | |
| VkResult | vmaEndDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo) |
| VkResult | vmaEndDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo) |
| Ends single defragmentation pass. | |
| VkResult | vmaBindBufferMemory (VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer) |
| VkResult | vmaBindBufferMemory (VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer) |
| Binds buffer to allocation. | |
| VkResult | vmaBindBufferMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkBuffer buffer, const void *(VkBindBufferMemoryInfoKHR) pNext) |
| VkResult | vmaBindBufferMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkBuffer buffer, const void *(VkBindBufferMemoryInfoKHR) pNext) |
| Binds buffer to allocation with additional parameters. | |
| VkResult | vmaBindImageMemory (VmaAllocator allocator, VmaAllocation allocation, VkImage image) |
| VkResult | vmaBindImageMemory (VmaAllocator allocator, VmaAllocation allocation, VkImage image) |
| Binds image to allocation. | |
| VkResult | vmaBindImageMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkImage image, const void *(VkBindImageMemoryInfoKHR) pNext) |
| VkResult | vmaBindImageMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkImage image, const void *(VkBindImageMemoryInfoKHR) pNext) |
| Binds image to allocation with additional parameters. | |
| VkResult | vmaCreateBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaCreateBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Creates a new VkBuffer, allocates and binds memory for it. | |
| VkResult | vmaCreateBufferWithAlignment (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkDeviceSize minAlignment, 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. | |
| VkResult | vmaCreateDedicatedBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaCreateDedicatedBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Creates a dedicated buffer while offering extra parameter pMemoryAllocateNext. | |
| VkResult | vmaCreateAliasingBuffer (VmaAllocator allocator, VmaAllocation allocation, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer) |
| VkResult | vmaCreateAliasingBuffer (VmaAllocator allocator, VmaAllocation allocation, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer) |
| Creates a new VkBuffer, binds already created memory for it. | |
| VkResult | vmaCreateAliasingBuffer2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer) |
| VkResult | vmaCreateAliasingBuffer2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer) |
| Creates a new VkBuffer, binds already created memory for it. | |
| void | vmaDestroyBuffer (VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation) |
| void | vmaDestroyBuffer (VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation) |
| Destroys Vulkan buffer and frees allocated memory. | |
| VkResult | vmaCreateImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaCreateImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Function similar to vmaCreateBuffer() but for images. | |
| VkResult | vmaCreateDedicatedImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| VkResult | vmaCreateDedicatedImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) |
| Function similar to vmaCreateDedicatedBuffer() but for images. | |
| VkResult | vmaCreateAliasingImage (VmaAllocator allocator, VmaAllocation allocation, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage) |
| VkResult | vmaCreateAliasingImage (VmaAllocator allocator, VmaAllocation allocation, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage) |
| Function similar to vmaCreateAliasingBuffer() but for images. | |
| VkResult | vmaCreateAliasingImage2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage) |
| VkResult | vmaCreateAliasingImage2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage) |
| Function similar to vmaCreateAliasingBuffer2() but for images. | |
| void | vmaDestroyImage (VmaAllocator allocator, VkImage image, VmaAllocation allocation) |
| void | vmaDestroyImage (VmaAllocator allocator, VkImage image, VmaAllocation allocation) |
| Destroys Vulkan image and frees allocated memory. | |
| VkResult | vmaCreateVirtualBlock (const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock) |
| VkResult | vmaCreateVirtualBlock (const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock) |
| Creates new VmaVirtualBlock object. | |
| void | vmaDestroyVirtualBlock (VmaVirtualBlock virtualBlock) |
| void | vmaDestroyVirtualBlock (VmaVirtualBlock virtualBlock) |
| Destroys VmaVirtualBlock object. | |
| VkBool32 | vmaIsVirtualBlockEmpty (VmaVirtualBlock virtualBlock) |
| VkBool32 | vmaIsVirtualBlockEmpty (VmaVirtualBlock virtualBlock) |
| Returns true of the VmaVirtualBlock is empty - contains 0 virtual allocations and has all its space available for new allocations. | |
| void | vmaGetVirtualAllocationInfo (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, VmaVirtualAllocationInfo *pVirtualAllocInfo) |
| 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. | |
| VkResult | vmaVirtualAllocate (VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VmaVirtualAllocation *pAllocation, VkDeviceSize *pOffset) |
| VkResult | vmaVirtualAllocate (VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VmaVirtualAllocation *pAllocation, VkDeviceSize *pOffset) |
| Allocates new virtual allocation inside given VmaVirtualBlock. | |
| void | vmaVirtualFree (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation) |
| void | vmaVirtualFree (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation) |
| Frees virtual allocation inside given VmaVirtualBlock. | |
| void | vmaClearVirtualBlock (VmaVirtualBlock virtualBlock) |
| void | vmaClearVirtualBlock (VmaVirtualBlock virtualBlock) |
| Frees all virtual allocations inside given VmaVirtualBlock. | |
| void | vmaSetVirtualAllocationUserData (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, void *pUserData) |
| void | vmaSetVirtualAllocationUserData (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, void *pUserData) |
| Changes custom pointer associated with given virtual allocation. | |
| void | vmaGetVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaStatistics *pStats) |
| void | vmaGetVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaStatistics *pStats) |
| Calculates and returns statistics about virtual allocations and memory usage in given VmaVirtualBlock. | |
| void | vmaCalculateVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaDetailedStatistics *pStats) |
| void | vmaCalculateVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaDetailedStatistics *pStats) |
| Calculates and returns detailed statistics about virtual allocations and memory usage in given VmaVirtualBlock. | |
| void | vmaBuildVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char **ppStatsString, VkBool32 detailedMap) |
| void | vmaBuildVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char **ppStatsString, VkBool32 detailedMap) |
| Builds and returns a null-terminated string in JSON format with information about given VmaVirtualBlock. | |
| void | vmaFreeVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char *pStatsString) |
| void | vmaFreeVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char *pStatsString) |
| Frees a string returned by vmaBuildVirtualBlockStatsString(). | |
| void | vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap) |
| void | vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap) |
| Builds and returns statistics as a null-terminated string in JSON format. | |
| void | vmaFreeStatsString (VmaAllocator allocator, char *pStatsString) |
| void | vmaFreeStatsString (VmaAllocator allocator, char *pStatsString) |