diff --git a/docs/html/allocation_annotation.html b/docs/html/allocation_annotation.html
index c60bdf0..05094ab 100644
--- a/docs/html/allocation_annotation.html
+++ b/docs/html/allocation_annotation.html
@@ -84,18 +84,18 @@ Allocation user data
VkBuffer buffer;
vmaCreateBuffer(allocator, &bufferInfo, &allocCreateInfo, &buffer, &allocation,
nullptr);
-Definition: vk_mem_alloc.h:1009
-void * pUserData
Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
Definition: vk_mem_alloc.h:1048
-VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1017
+Definition: vk_mem_alloc.h:1100
+void * pUserData
Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
Definition: vk_mem_alloc.h:1139
+VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1108
Represents single memory allocation.
-@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:845
+@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:458
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
The pointer may be later retrieved as VmaAllocationInfo::pUserData:
MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.
pUserData;
-
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1374
-
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:1423
+
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1248
+
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:1297
void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
Returns current information about specified allocation and atomically marks it as used in current fra...
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.
@@ -116,9 +116,9 @@ Allocation names
VkImage image;
vmaCreateImage(allocator, &imageInfo, &allocCreateInfo, &image, &allocation,
nullptr);
-VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1011
+VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1102
VkResult vmaCreateImage(VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
Function similar to vmaCreateBuffer().
-@ VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT
Definition: vk_mem_alloc.h:948
+@ VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT
Definition: vk_mem_alloc.h:562
The value of pUserData
pointer of the allocation will be different than the one you passed when setting allocation's name - pointing to a buffer managed internally that holds copy of the string.
diff --git a/docs/html/choosing_memory_type.html b/docs/html/choosing_memory_type.html
index 06a56fc..c52e967 100644
--- a/docs/html/choosing_memory_type.html
+++ b/docs/html/choosing_memory_type.html
@@ -93,10 +93,10 @@ Usage
VkBuffer buffer;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation,
nullptr);
-
Definition: vk_mem_alloc.h:1009
-
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1017
+
Definition: vk_mem_alloc.h:1100
+
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1108
Represents single memory allocation.
-
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:845
+
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:458
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
Required and preferred flags
@@ -109,10 +109,10 @@ Required and preferred flags
VkBuffer buffer;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation,
nullptr);
-VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition: vk_mem_alloc.h:1027
-VkMemoryPropertyFlags requiredFlags
Flags that must be set in a Memory Type chosen for an allocation.
Definition: vk_mem_alloc.h:1022
-VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1011
-@ VMA_ALLOCATION_CREATE_MAPPED_BIT
Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
Definition: vk_mem_alloc.h:922
+VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition: vk_mem_alloc.h:1118
+VkMemoryPropertyFlags requiredFlags
Flags that must be set in a Memory Type chosen for an allocation.
Definition: vk_mem_alloc.h:1113
+VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1102
+@ VMA_ALLOCATION_CREATE_MAPPED_BIT
Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
Definition: vk_mem_alloc.h:536
A memory type is chosen that has all the required flags and as many preferred flags set as possible.
If you use VmaAllocationCreateInfo::usage, it is just internally converted to a set of required and preferred flags.
@@ -127,7 +127,7 @@ Explicit memory types
VkBuffer buffer;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation,
nullptr);
-uint32_t memoryTypeBits
Bitmask containing one bit set for every memory type acceptable for this allocation.
Definition: vk_mem_alloc.h:1035
+uint32_t memoryTypeBits
Bitmask containing one bit set for every memory type acceptable for this allocation.
Definition: vk_mem_alloc.h:1126
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.
diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html
index 84a6dd7..be622a7 100644
--- a/docs/html/custom_memory_pools.html
+++ b/docs/html/custom_memory_pools.html
@@ -106,13 +106,13 @@ $(function() {
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
-Definition: vk_mem_alloc.h:1009
-VmaPool pool
Pool that this allocation should be created in.
Definition: vk_mem_alloc.h:1041
+Definition: vk_mem_alloc.h:1100
+VmaPool pool
Pool that this allocation should be created in.
Definition: vk_mem_alloc.h:1132
Represents single memory allocation.
-Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1374
-Describes parameter of created VmaPool.
Definition: vk_mem_alloc.h:1175
-uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition: vk_mem_alloc.h:1178
-size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition: vk_mem_alloc.h:1203
+Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1248
+Describes parameter of created VmaPool.
Definition: vk_mem_alloc.h:1151
+uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition: vk_mem_alloc.h:1154
+size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition: vk_mem_alloc.h:1179
Represents custom memory pool.
VkResult vmaCreatePool(VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
Allocates Vulkan device memory and creates VmaPool object.
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
@@ -137,8 +137,8 @@ Choosing memory type index
-VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1017
-@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:845
+VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1108
+@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:458
VkResult vmaFindMemoryTypeIndexForBufferInfo(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
When creating buffers/images allocated in that pool, provide following parameters:
diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html
index 53d59a8..c6448d9 100644
--- a/docs/html/defragmentation.html
+++ b/docs/html/defragmentation.html
@@ -129,15 +129,15 @@ Defragmenting CPU memory
}
}
-Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1374
+Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1248
Represents main object of this library initialized.
Represents Opaque object that represents started defragmentation process.
-Parameters for defragmentation.
Definition: vk_mem_alloc.h:1791
-uint32_t allocationCount
Number of allocations in pAllocations array.
Definition: vk_mem_alloc.h:1797
-VkBool32 * pAllocationsChanged
Optional, output. Pointer to array that will be filled with information whether the allocation at cer...
Definition: vk_mem_alloc.h:1812
-uint32_t maxCpuAllocationsToMove
Maximum number of allocations that can be moved to a different place using transfers on CPU side,...
Definition: vk_mem_alloc.h:1841
-const VmaAllocation * pAllocations
Pointer to array of allocations that can be defragmented.
Definition: vk_mem_alloc.h:1806
-VkDeviceSize maxCpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:1836
+Parameters for defragmentation.
Definition: vk_mem_alloc.h:1305
+uint32_t allocationCount
Number of allocations in pAllocations array.
Definition: vk_mem_alloc.h:1311
+VkBool32 * pAllocationsChanged
Optional, output. Pointer to array that will be filled with information whether the allocation at cer...
Definition: vk_mem_alloc.h:1326
+uint32_t maxCpuAllocationsToMove
Maximum number of allocations that can be moved to a different place using transfers on CPU side,...
Definition: vk_mem_alloc.h:1355
+const VmaAllocation * pAllocations
Pointer to array of allocations that can be defragmented.
Definition: vk_mem_alloc.h:1320
+VkDeviceSize maxCpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:1350
VkResult vmaDefragmentationBegin(VmaAllocator allocator, const VmaDefragmentationInfo2 *pInfo, VmaDefragmentationStats *pStats, VmaDefragmentationContext *pContext)
Begins defragmentation process.
VkResult vmaBindBufferMemory(VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer)
Binds buffer to allocation.
void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
Returns current information about specified allocation and atomically marks it as used in current fra...
@@ -203,9 +203,9 @@ Defragmenting GPU memory
}
}
-uint32_t maxGpuAllocationsToMove
Maximum number of allocations that can be moved to a different place using transfers on GPU side,...
Definition: vk_mem_alloc.h:1851
-VkDeviceSize maxGpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:1846
-VkCommandBuffer commandBuffer
Optional. Command buffer where GPU copy commands will be posted.
Definition: vk_mem_alloc.h:1860
+uint32_t maxGpuAllocationsToMove
Maximum number of allocations that can be moved to a different place using transfers on GPU side,...
Definition: vk_mem_alloc.h:1365
+VkDeviceSize maxGpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:1360
+VkCommandBuffer commandBuffer
Optional. Command buffer where GPU copy commands will be posted.
Definition: vk_mem_alloc.h:1374
You can combine these two methods by specifying non-zero maxGpu*
as well as maxCpu*
parameters. The library automatically chooses best method to defragment each memory pool.
You may try not to block your entire program to wait until defragmentation finishes, but do it in the background, as long as you carefully fullfill requirements described in function vmaDefragmentationBegin().
diff --git a/docs/html/globals.html b/docs/html/globals.html
index 714e723..a755c83 100644
--- a/docs/html/globals.html
+++ b/docs/html/globals.html
@@ -71,7 +71,6 @@ $(function() {
- v -
-- VK_DEFINE_HANDLE() : vk_mem_alloc.h
- VK_ERROR_UNKNOWN : vk_mem_alloc.h
- VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT : vk_mem_alloc.h
- VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT : vk_mem_alloc.h
diff --git a/docs/html/globals_func.html b/docs/html/globals_func.html
index 3574644..c8ba547 100644
--- a/docs/html/globals_func.html
+++ b/docs/html/globals_func.html
@@ -65,7 +65,6 @@ $(function() {
- v -
-- VK_DEFINE_HANDLE() : vk_mem_alloc.h
- vmaAllocateMemory() : vk_mem_alloc.h
- vmaAllocateMemoryForBuffer() : vk_mem_alloc.h
- vmaAllocateMemoryForImage() : vk_mem_alloc.h
diff --git a/docs/html/lost_allocations.html b/docs/html/lost_allocations.html
index eb64bdc..b33aa82 100644
--- a/docs/html/lost_allocations.html
+++ b/docs/html/lost_allocations.html
@@ -117,16 +117,16 @@ $(function() {
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &m_Buf, &m_Alloc,
nullptr);
}
-Definition: vk_mem_alloc.h:1009
-VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1017
-VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1011
+Definition: vk_mem_alloc.h:1100
+VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1108
+VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1102
Represents single memory allocation.
void vmaDestroyBuffer(VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)
Destroys Vulkan buffer and frees allocated memory.
VkBool32 vmaTouchAllocation(VmaAllocator allocator, VmaAllocation allocation)
Returns VK_TRUE if allocation is not lost and atomically marks it as used in current frame.
-@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:845
+@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:458
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
-@ VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT
Definition: vk_mem_alloc.h:935
-@ VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT
Definition: vk_mem_alloc.h:942
+@ VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT
Definition: vk_mem_alloc.h:549
+@ VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT
Definition: vk_mem_alloc.h:556
When using lost allocations, you may see some Vulkan validation layer warnings about overlapping regions of memory bound to different kinds of buffers and images. This is still valid as long as you implement proper handling of lost allocations (like in the example above) and don't use them.
You can create an allocation that is already in lost state from the beginning using function vmaCreateLostAllocation(). It may be useful if you need a "dummy" allocation that is not null.
You can call function vmaMakePoolAllocationsLost() to set all eligible allocations in a specified custom pool to lost state. Allocations that have been "touched" in current frame or VmaPoolCreateInfo::frameInUseCount frames back cannot become lost.
diff --git a/docs/html/memory_mapping.html b/docs/html/memory_mapping.html
index 43f9996..833f24f 100644
--- a/docs/html/memory_mapping.html
+++ b/docs/html/memory_mapping.html
@@ -116,14 +116,14 @@ Persistently mapped memory
memcpy(allocInfo.
pMappedData, &constantBufferData,
sizeof(constantBufferData));
-Definition: vk_mem_alloc.h:1009
-VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1017
-VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1011
-Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1374
-void * pMappedData
Pointer to the beginning of this allocation as mapped data.
Definition: vk_mem_alloc.h:1418
-@ VMA_MEMORY_USAGE_CPU_ONLY
Definition: vk_mem_alloc.h:855
+Definition: vk_mem_alloc.h:1100
+VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1108
+VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:1102
+Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:1248
+void * pMappedData
Pointer to the beginning of this allocation as mapped data.
Definition: vk_mem_alloc.h:1292
+@ VMA_MEMORY_USAGE_CPU_ONLY
Definition: vk_mem_alloc.h:468
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
-@ VMA_ALLOCATION_CREATE_MAPPED_BIT
Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
Definition: vk_mem_alloc.h:922
+@ VMA_ALLOCATION_CREATE_MAPPED_BIT
Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
Definition: vk_mem_alloc.h:536
There are some exceptions though, when you should consider mapping memory only for a short period of time:
- When operating system is Windows 7 or 8.x (Windows 10 is not affected because it uses WDDM2), device is discrete AMD GPU, and memory type is the special 256 MiB pool of
DEVICE_LOCAL + HOST_VISIBLE
memory (selected when you use VMA_MEMORY_USAGE_CPU_TO_GPU), then whenever a memory block allocated from this memory type stays mapped for the time of any call to vkQueueSubmit()
or vkQueuePresentKHR()
, this block is migrated by WDDM to system RAM, which degrades performance. It doesn't matter if that particular memory block is actually used by the command buffer being submitted.
@@ -166,9 +166,9 @@ Finding out if memory is mappable
}
-VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition: vk_mem_alloc.h:1027
+VkMemoryPropertyFlags preferredFlags
Flags that preferably should be set in a memory type chosen for an allocation.
Definition: vk_mem_alloc.h:1118
void vmaGetAllocationMemoryProperties(VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags)
Given an allocation, returns Property Flags of its memory type.
-@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:845
+@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:458
You can even use VMA_ALLOCATION_CREATE_MAPPED_BIT flag while creating allocations that are not necessarily HOST_VISIBLE
(e.g. using VMA_MEMORY_USAGE_GPU_ONLY). If the allocation ends up in memory type that is HOST_VISIBLE
, it will be persistently mapped and you can use it directly. If not, the flag is just ignored. Example:
VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
bufCreateInfo.size = sizeof(ConstantBuffer);
diff --git a/docs/html/quick_start.html b/docs/html/quick_start.html
index ea55094..c317bf6 100644
--- a/docs/html/quick_start.html
+++ b/docs/html/quick_start.html
@@ -104,11 +104,11 @@ Initialization
-
Description of a Allocator to be created.
Definition: vk_mem_alloc.h:521
-
VkPhysicalDevice physicalDevice
Vulkan physical device.
Definition: vk_mem_alloc.h:526
-
VkInstance instance
Handle to Vulkan instance object.
Definition: vk_mem_alloc.h:595
-
VkDevice device
Vulkan device.
Definition: vk_mem_alloc.h:529
-
uint32_t vulkanApiVersion
Optional. The highest version of Vulkan that the application is designed to use.
Definition: vk_mem_alloc.h:604
+
Description of a Allocator to be created.
Definition: vk_mem_alloc.h:916
+
VkPhysicalDevice physicalDevice
Vulkan physical device.
Definition: vk_mem_alloc.h:921
+
VkInstance instance
Handle to Vulkan instance object.
Definition: vk_mem_alloc.h:990
+
VkDevice device
Vulkan device.
Definition: vk_mem_alloc.h:924
+
uint32_t vulkanApiVersion
Optional. The highest version of Vulkan that the application is designed to use.
Definition: vk_mem_alloc.h:999
Represents main object of this library initialized.
VkResult vmaCreateAllocator(const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator)
Creates Allocator object.
Only members physicalDevice
, device
, instance
are required. However, you should inform the library which Vulkan version do you use by setting VmaAllocatorCreateInfo::vulkanApiVersion and which extensions did you enable by setting VmaAllocatorCreateInfo::flags (like VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT for VK_KHR_buffer_device_address). Otherwise, VMA would use only features of Vulkan 1.0 core with no extensions.
@@ -130,10 +130,10 @@ Resource allocation
VkBuffer buffer;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation,
nullptr);
-Definition: vk_mem_alloc.h:1009
-VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1017
+Definition: vk_mem_alloc.h:1100
+VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1108
Represents single memory allocation.
-@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:845
+@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:458
VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
Don't forget to destroy your objects when no longer needed:
diff --git a/docs/html/resource_aliasing.html b/docs/html/resource_aliasing.html
index 85430b0..a11de3b 100644
--- a/docs/html/resource_aliasing.html
+++ b/docs/html/resource_aliasing.html
@@ -137,12 +137,12 @@ $(function() {
vkDestroyImage(allocator, img2, nullptr);
vkDestroyImage(allocator, img1, nullptr);
-
Definition: vk_mem_alloc.h:1009
-
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1017
+
Definition: vk_mem_alloc.h:1100
+
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:1108
Represents single memory allocation.
VkResult vmaBindImageMemory(VmaAllocator allocator, VmaAllocation allocation, VkImage image)
Binds image to allocation.
void vmaFreeMemory(VmaAllocator allocator, const VmaAllocation allocation)
Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(),...
-
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:845
+
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:458
VkResult vmaAllocateMemory(VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
General purpose memory allocation.
Remember that using resources that alias in memory requires proper synchronization. You need to issue a memory barrier to make sure commands that use img1
and img2
don't overlap on GPU timeline. You also need to treat a resource after aliasing as uninitialized - containing garbage data. For example, if you use img1
and then want to use img2
, you need to issue an image memory barrier for img2
with oldLayout
= VK_IMAGE_LAYOUT_UNDEFINED
.
Additional considerations:
diff --git a/docs/html/search/all_11.js b/docs/html/search/all_11.js
index ab074ee..ddd0a12 100644
--- a/docs/html/search/all_11.js
+++ b/docs/html/search/all_11.js
@@ -2,197 +2,196 @@ var searchData=
[
['virtual_20allocator_0',['Virtual allocator',['../virtual_allocator.html',1,'index']]],
['vk_5famd_5fdevice_5fcoherent_5fmemory_1',['VK_AMD_device_coherent_memory',['../vk_amd_device_coherent_memory.html',1,'index']]],
- ['vk_5fdefine_5fhandle_2',['VK_DEFINE_HANDLE',['../vk__mem__alloc_8h.html#a916e5291bb205e995aa87aee1d6dbbfc',1,'vk_mem_alloc.h']]],
- ['vk_5ferror_5funknown_3',['VK_ERROR_UNKNOWN',['../vk__mem__alloc_8h.html#a162894cbe84f7d76632eb9af1e4b3558',1,'vk_mem_alloc.h']]],
- ['vk_5fkhr_5fdedicated_5fallocation_4',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]],
- ['vk_5fmem_5falloc_2eh_5',['vk_mem_alloc.h',['../vk__mem__alloc_8h.html',1,'']]],
- ['vkallocatememory_6',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]],
- ['vkbindbuffermemory_7',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]],
- ['vkbindbuffermemory2khr_8',['vkBindBufferMemory2KHR',['../struct_vma_vulkan_functions.html#a0c4907235aab9df2767b79836afa2dc9',1,'VmaVulkanFunctions']]],
- ['vkbindimagememory_9',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]],
- ['vkbindimagememory2khr_10',['vkBindImageMemory2KHR',['../struct_vma_vulkan_functions.html#ab95aaa73ab8a3fe9fd3daaaec4e0b2bf',1,'VmaVulkanFunctions']]],
- ['vkcmdcopybuffer_11',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]],
- ['vkcreatebuffer_12',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]],
- ['vkcreateimage_13',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]],
- ['vkdestroybuffer_14',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]],
- ['vkdestroyimage_15',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]],
- ['vkflushmappedmemoryranges_16',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]],
- ['vkfreememory_17',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]],
- ['vkgetbuffermemoryrequirements_18',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]],
- ['vkgetbuffermemoryrequirements2khr_19',['vkGetBufferMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9d8d1b05d2b1e7e1d9b27f6f585acf9c',1,'VmaVulkanFunctions']]],
- ['vkgetdeviceprocaddr_20',['vkGetDeviceProcAddr',['../struct_vma_vulkan_functions.html#ac383ab9af127e5e136622fa4ebea9e57',1,'VmaVulkanFunctions']]],
- ['vkgetimagememoryrequirements_21',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]],
- ['vkgetimagememoryrequirements2khr_22',['vkGetImageMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9cdcdc1e2b2ea7c571f7d27e30ba6875',1,'VmaVulkanFunctions']]],
- ['vkgetinstanceprocaddr_23',['vkGetInstanceProcAddr',['../struct_vma_vulkan_functions.html#a3eafa102f5f8915f093f40675636b849',1,'VmaVulkanFunctions']]],
- ['vkgetphysicaldevicememoryproperties_24',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]],
- ['vkgetphysicaldevicememoryproperties2khr_25',['vkGetPhysicalDeviceMemoryProperties2KHR',['../struct_vma_vulkan_functions.html#a0d992896e6ffcf92b9d7ea049fa5c445',1,'VmaVulkanFunctions']]],
- ['vkgetphysicaldeviceproperties_26',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]],
- ['vkinvalidatemappedmemoryranges_27',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]],
- ['vkmapmemory_28',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]],
- ['vkunmapmemory_29',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]],
- ['vma_5fallocation_5fcreate_5fcan_5falias_5fbit_30',['VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597afb0ee060cd733aaa5e249704ff589ad6',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fcan_5fbecome_5flost_5fbit_31',['VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fcan_5fmake_5fother_5flost_5fbit_32',['VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fdedicated_5fmemory_5fbit_33',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_34',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_35',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fmapped_5fbit_36',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_37',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_38',['VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a839826775c62319466441f86496f036d',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5ffirst_5ffit_5fbit_39',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fmask_40',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_41',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a621b704103eb3360230c860acf36e706',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_42',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8af1210cf591784afa026d94998f735d',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_43',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a0729e932b7ea170e3a128cad96c5cf6d',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fworst_5ffit_5fbit_44',['VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad242a04f802e25fef0b880afe8bb0a62',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fupper_5faddress_5fbit_45',['VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a42ba3a2d2c7117953210b7c3ef8da0df',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fuser_5fdata_5fcopy_5fstring_5fbit_46',['VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fwithin_5fbudget_5fbit_47',['VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ab8b1764f3e9022368e440c057783b92d',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5famd_5fdevice_5fcoherent_5fmemory_5fbit_48',['VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca2acce4886d8078552efa38878413970f',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fbuffer_5fdevice_5faddress_5fbit_49',['VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca5f1b28b0414319d1687e1f2b30ab0089',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fext_5fmemory_5fbudget_5fbit_50',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4d4687863f7bd4b418c6006dc04400b0',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fext_5fmemory_5fpriority_5fbit_51',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7caffdd7a5169be3dbd7cbf6b3619e4f78a',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fexternally_5fsynchronized_5fbit_52',['VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fflag_5fbits_5fmax_5fenum_53',['VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cae4d5ad929caba5f23eb502b13bd5286c',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fkhr_5fbind_5fmemory2_5fbit_54',['VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca8fb75bf07cd184ab903596295e863dee',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fkhr_5fdedicated_5fallocation_5fbit_55',['VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878',1,'vk_mem_alloc.h']]],
- ['vma_5fbind_5fmemory2_56',['VMA_BIND_MEMORY2',['../vk__mem__alloc_8h.html#a88bef97f86d70a34a4c0746e09a2680d',1,'vk_mem_alloc.h']]],
- ['vma_5fbuffer_5fdevice_5faddress_57',['VMA_BUFFER_DEVICE_ADDRESS',['../vk__mem__alloc_8h.html#a7f9d5e71b70dd1a137c303a8a8262c10',1,'vk_mem_alloc.h']]],
- ['vma_5fdedicated_5fallocation_58',['VMA_DEDICATED_ALLOCATION',['../vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4',1,'vk_mem_alloc.h']]],
- ['vma_5fdefragmentation_5fflag_5fbits_5fmax_5fenum_59',['VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50cab87ec33154803bfeb5ac2b379f1d6a97',1,'vk_mem_alloc.h']]],
- ['vma_5fdefragmentation_5fflag_5fincremental_60',['VMA_DEFRAGMENTATION_FLAG_INCREMENTAL',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50ca31af49446af2459284a568ce2f3fdd33',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fbudget_61',['VMA_MEMORY_BUDGET',['../vk__mem__alloc_8h.html#a05decf1cf4ebf767beba7acca6c1ec3a',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fcpu_5fcopy_62',['VMA_MEMORY_USAGE_CPU_COPY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca416a444d4d0fc20067c3f76f32ff2500',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fcpu_5fonly_63',['VMA_MEMORY_USAGE_CPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fcpu_5fto_5fgpu_64',['VMA_MEMORY_USAGE_CPU_TO_GPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fgpu_5flazily_5fallocated_65',['VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca835333d9072db63a653818030e17614d',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fgpu_5fonly_66',['VMA_MEMORY_USAGE_GPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fgpu_5fto_5fcpu_67',['VMA_MEMORY_USAGE_GPU_TO_CPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca7b586d2fdaf82a463b58f581ed72be27',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fmax_5fenum_68',['VMA_MEMORY_USAGE_MAX_ENUM',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5funknown_69',['VMA_MEMORY_USAGE_UNKNOWN',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5falgorithm_5fmask_70',['VMA_POOL_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7af4d270f8f42517a0f70037ceb6ac1d9c',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5fbuddy_5falgorithm_5fbit_71',['VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a97a0dc38e5161b780594d998d313d35e',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_72',['VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5fignore_5fbuffer_5fimage_5fgranularity_5fbit_73',['VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5flinear_5falgorithm_5fbit_74',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]],
- ['vma_5frecord_5fflag_5fbits_5fmax_5fenum_75',['VMA_RECORD_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e',1,'vk_mem_alloc.h']]],
- ['vma_5frecord_5fflush_5fafter_5fcall_5fbit_76',['VMA_RECORD_FLUSH_AFTER_CALL_BIT',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7',1,'vk_mem_alloc.h']]],
- ['vma_5frecording_5fenabled_77',['VMA_RECORDING_ENABLED',['../vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c',1,'vk_mem_alloc.h']]],
- ['vma_5fstats_5fstring_5fenabled_78',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_79',['VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac1163c03ea837fa663462dc286d6a1a9',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmask_80',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac5b5e45c335368d18df59c9f27df17e3',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_81',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9aa0c32667ba2deaa9cdeac6149ec47a',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_82',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ae2a9591a62b5e3b1bdcbc81c6188a1bf',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_83',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a562d10a46012719d33167d3dc5dbbf9b',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fallocation_5fcreate_5fupper_5faddress_5fbit_84',['VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9524a329a55b5ec390d57d90b67ad78e',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fblock_5fcreate_5falgorithm_5fmask_85',['VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaaf9487467136e1a9e371894dc3a7c4844',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fblock_5fcreate_5fbuddy_5falgorithm_5fbit_86',['VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa923116612509e26bf84982b9baf25c63',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fblock_5fcreate_5fflag_5fbits_5fmax_5fenum_87',['VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa5fc0d333c3d5687a8bbf57df9b377a87',1,'vk_mem_alloc.h']]],
- ['vma_5fvirtual_5fblock_5fcreate_5flinear_5falgorithm_5fbit_88',['VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaae6423e2fa2f3c9211b21c819e3f10f96',1,'vk_mem_alloc.h']]],
- ['vmaallocatememory_89',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]],
- ['vmaallocatememoryforbuffer_90',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]],
- ['vmaallocatememoryforimage_91',['vmaAllocateMemoryForImage',['../vk__mem__alloc_8h.html#a0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]],
- ['vmaallocatememorypages_92',['vmaAllocateMemoryPages',['../vk__mem__alloc_8h.html#ad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]],
- ['vmaallocation_93',['VmaAllocation',['../struct_vma_allocation.html',1,'']]],
- ['vmaallocationcreateflagbits_94',['VmaAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a4fceecc301f4064dc808d3cd6c038941',1,'VmaAllocationCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597',1,'VmaAllocationCreateFlagBits(): vk_mem_alloc.h']]],
- ['vmaallocationcreateflags_95',['VmaAllocationCreateFlags',['../vk__mem__alloc_8h.html#a5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]],
- ['vmaallocationcreateinfo_96',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'VmaAllocationCreateInfo'],['../vk__mem__alloc_8h.html#a3bf110892ea2fb4649fedb68488d026a',1,'VmaAllocationCreateInfo(): vk_mem_alloc.h']]],
- ['vmaallocationinfo_97',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'VmaAllocationInfo'],['../vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50',1,'VmaAllocationInfo(): vk_mem_alloc.h']]],
- ['vmaallocator_98',['VmaAllocator',['../struct_vma_allocator.html',1,'']]],
- ['vmaallocatorcreateflagbits_99',['VmaAllocatorCreateFlagBits',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7c',1,'VmaAllocatorCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#afd73b95e737ee7e76f827cb5472f559f',1,'VmaAllocatorCreateFlagBits(): vk_mem_alloc.h']]],
- ['vmaallocatorcreateflags_100',['VmaAllocatorCreateFlags',['../vk__mem__alloc_8h.html#acfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]],
- ['vmaallocatorcreateinfo_101',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'VmaAllocatorCreateInfo'],['../vk__mem__alloc_8h.html#aad9652301d33759b83e52d4f3605a14a',1,'VmaAllocatorCreateInfo(): vk_mem_alloc.h']]],
- ['vmaallocatorinfo_102',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'VmaAllocatorInfo'],['../vk__mem__alloc_8h.html#a1988031b0223fdbd564250fa1edd942c',1,'VmaAllocatorInfo(): vk_mem_alloc.h']]],
- ['vmabegindefragmentationpass_103',['vmaBeginDefragmentationPass',['../vk__mem__alloc_8h.html#ac0f01545b6262f7d4d128fc8f8e5c77b',1,'vk_mem_alloc.h']]],
- ['vmabindbuffermemory_104',['vmaBindBufferMemory',['../vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]],
- ['vmabindbuffermemory2_105',['vmaBindBufferMemory2',['../vk__mem__alloc_8h.html#a927c944f45e0f2941182abb6f608e64a',1,'vk_mem_alloc.h']]],
- ['vmabindimagememory_106',['vmaBindImageMemory',['../vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]],
- ['vmabindimagememory2_107',['vmaBindImageMemory2',['../vk__mem__alloc_8h.html#aa8251ee81b0045a443e35b8e8aa021bc',1,'vk_mem_alloc.h']]],
- ['vmabudget_108',['VmaBudget',['../struct_vma_budget.html',1,'VmaBudget'],['../vk__mem__alloc_8h.html#aa078667e71b1ef24e87a6a30d128381d',1,'VmaBudget(): vk_mem_alloc.h']]],
- ['vmabuildstatsstring_109',['vmaBuildStatsString',['../vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]],
- ['vmabuildvirtualblockstatsstring_110',['vmaBuildVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]],
- ['vmacalculatestats_111',['vmaCalculateStats',['../vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3',1,'vk_mem_alloc.h']]],
- ['vmacalculatevirtualblockstats_112',['vmaCalculateVirtualBlockStats',['../vk__mem__alloc_8h.html#a95169b4730e94757897470086ec2768a',1,'vk_mem_alloc.h']]],
- ['vmacheckcorruption_113',['vmaCheckCorruption',['../vk__mem__alloc_8h.html#a49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]],
- ['vmacheckpoolcorruption_114',['vmaCheckPoolCorruption',['../vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]],
- ['vmaclearvirtualblock_115',['vmaClearVirtualBlock',['../vk__mem__alloc_8h.html#a5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]],
- ['vmacreateallocator_116',['vmaCreateAllocator',['../vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]],
- ['vmacreatebuffer_117',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]],
- ['vmacreatebufferwithalignment_118',['vmaCreateBufferWithAlignment',['../vk__mem__alloc_8h.html#aa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]],
- ['vmacreateimage_119',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]],
- ['vmacreatelostallocation_120',['vmaCreateLostAllocation',['../vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1',1,'vk_mem_alloc.h']]],
- ['vmacreatepool_121',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]],
- ['vmacreatevirtualblock_122',['vmaCreateVirtualBlock',['../vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]],
- ['vmadefragment_123',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationbegin_124',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationcontext_125',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]],
- ['vmadefragmentationend_126',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationflagbits_127',['VmaDefragmentationFlagBits',['../vk__mem__alloc_8h.html#a13415cc0b443353a7b5abda300b833fc',1,'VmaDefragmentationFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50c',1,'VmaDefragmentationFlagBits(): vk_mem_alloc.h']]],
- ['vmadefragmentationflags_128',['VmaDefragmentationFlags',['../vk__mem__alloc_8h.html#a88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationinfo_129',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'VmaDefragmentationInfo'],['../vk__mem__alloc_8h.html#a2bf47f96bf92bed2a49461bd9af3acfa',1,'VmaDefragmentationInfo(): vk_mem_alloc.h']]],
- ['vmadefragmentationinfo2_130',['VmaDefragmentationInfo2',['../struct_vma_defragmentation_info2.html',1,'VmaDefragmentationInfo2'],['../vk__mem__alloc_8h.html#ad6daeffaa670ce6d11a203a6224c9937',1,'VmaDefragmentationInfo2(): vk_mem_alloc.h']]],
- ['vmadefragmentationpassinfo_131',['VmaDefragmentationPassInfo',['../vk__mem__alloc_8h.html#a72aebd522242d56abea67b4f47f6549e',1,'VmaDefragmentationPassInfo(): vk_mem_alloc.h'],['../struct_vma_defragmentation_pass_info.html',1,'VmaDefragmentationPassInfo']]],
- ['vmadefragmentationpassmoveinfo_132',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'VmaDefragmentationPassMoveInfo'],['../vk__mem__alloc_8h.html#ad6799e8e2b1527abfc84d33bc44aeaf5',1,'VmaDefragmentationPassMoveInfo(): vk_mem_alloc.h']]],
- ['vmadefragmentationstats_133',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'VmaDefragmentationStats'],['../vk__mem__alloc_8h.html#ad94034192259c2e34a4d1c5e27810403',1,'VmaDefragmentationStats(): vk_mem_alloc.h']]],
- ['vmadestroyallocator_134',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]],
- ['vmadestroybuffer_135',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]],
- ['vmadestroyimage_136',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]],
- ['vmadestroypool_137',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]],
- ['vmadestroyvirtualblock_138',['vmaDestroyVirtualBlock',['../vk__mem__alloc_8h.html#a3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]],
- ['vmadevicememorycallbacks_139',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'VmaDeviceMemoryCallbacks'],['../vk__mem__alloc_8h.html#a77692d3c8770ea8882d573206bd27b2b',1,'VmaDeviceMemoryCallbacks(): vk_mem_alloc.h']]],
- ['vmaenddefragmentationpass_140',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindex_141',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindexforbufferinfo_142',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindexforimageinfo_143',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]],
- ['vmaflushallocation_144',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]],
- ['vmaflushallocations_145',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]],
- ['vmafreememory_146',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]],
- ['vmafreememorypages_147',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]],
- ['vmafreestatsstring_148',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]],
- ['vmafreevirtualblockstatsstring_149',['vmaFreeVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]],
- ['vmagetallocationinfo_150',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]],
- ['vmagetallocationmemoryproperties_151',['vmaGetAllocationMemoryProperties',['../vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]],
- ['vmagetallocatorinfo_152',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]],
- ['vmagetheapbudgets_153',['vmaGetHeapBudgets',['../vk__mem__alloc_8h.html#a9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]],
- ['vmagetmemoryproperties_154',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]],
- ['vmagetmemorytypeproperties_155',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]],
- ['vmagetphysicaldeviceproperties_156',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]],
- ['vmagetpoolname_157',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]],
- ['vmagetpoolstats_158',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]],
- ['vmagetvirtualallocationinfo_159',['vmaGetVirtualAllocationInfo',['../vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e',1,'vk_mem_alloc.h']]],
- ['vmainvalidateallocation_160',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]],
- ['vmainvalidateallocations_161',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]],
- ['vmaisvirtualblockempty_162',['vmaIsVirtualBlockEmpty',['../vk__mem__alloc_8h.html#acd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]],
- ['vmamakepoolallocationslost_163',['vmaMakePoolAllocationsLost',['../vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024',1,'vk_mem_alloc.h']]],
- ['vmamapmemory_164',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]],
- ['vmamemoryusage_165',['VmaMemoryUsage',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc',1,'VmaMemoryUsage(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a806e8499dde802e59eb72a1dc811c35f',1,'VmaMemoryUsage(): vk_mem_alloc.h']]],
- ['vmapool_166',['VmaPool',['../struct_vma_pool.html',1,'']]],
- ['vmapoolcreateflagbits_167',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a4d4f2efc2509157a9e4ecd4fd7942303',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h']]],
- ['vmapoolcreateflags_168',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]],
- ['vmapoolcreateinfo_169',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'VmaPoolCreateInfo'],['../vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67',1,'VmaPoolCreateInfo(): vk_mem_alloc.h']]],
- ['vmapoolstats_170',['VmaPoolStats',['../struct_vma_pool_stats.html',1,'VmaPoolStats'],['../vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1',1,'VmaPoolStats(): vk_mem_alloc.h']]],
- ['vmarecordflagbits_171',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2',1,'VmaRecordFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#acd24d5eb58abff7e1f43cb32a1ba1413',1,'VmaRecordFlagBits(): vk_mem_alloc.h']]],
- ['vmarecordflags_172',['VmaRecordFlags',['../vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828',1,'vk_mem_alloc.h']]],
- ['vmarecordsettings_173',['VmaRecordSettings',['../vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc',1,'VmaRecordSettings(): vk_mem_alloc.h'],['../struct_vma_record_settings.html',1,'VmaRecordSettings']]],
- ['vmasetallocationuserdata_174',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]],
- ['vmasetcurrentframeindex_175',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]],
- ['vmasetpoolname_176',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]],
- ['vmasetvirtualallocationuserdata_177',['vmaSetVirtualAllocationUserData',['../vk__mem__alloc_8h.html#a4b96f835d38686df937e097a0c7db5e9',1,'vk_mem_alloc.h']]],
- ['vmastatinfo_178',['VmaStatInfo',['../struct_vma_stat_info.html',1,'VmaStatInfo'],['../vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878',1,'VmaStatInfo(): vk_mem_alloc.h']]],
- ['vmastats_179',['VmaStats',['../struct_vma_stats.html',1,'VmaStats'],['../vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034',1,'VmaStats(): vk_mem_alloc.h']]],
- ['vmatouchallocation_180',['vmaTouchAllocation',['../vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a',1,'vk_mem_alloc.h']]],
- ['vmaunmapmemory_181',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]],
- ['vmavirtualallocate_182',['vmaVirtualAllocate',['../vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2',1,'vk_mem_alloc.h']]],
- ['vmavirtualallocationcreateflagbits_183',['VmaVirtualAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6',1,'VmaVirtualAllocationCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a936815e64946a6b6d812d08d10184c23',1,'VmaVirtualAllocationCreateFlagBits(): vk_mem_alloc.h']]],
- ['vmavirtualallocationcreateflags_184',['VmaVirtualAllocationCreateFlags',['../vk__mem__alloc_8h.html#ae96ffc099bf898257fb19e9410ed08a7',1,'vk_mem_alloc.h']]],
- ['vmavirtualallocationcreateinfo_185',['VmaVirtualAllocationCreateInfo',['../vk__mem__alloc_8h.html#ac3c90d80bedc6847a41b82d0e2158c9e',1,'VmaVirtualAllocationCreateInfo(): vk_mem_alloc.h'],['../struct_vma_virtual_allocation_create_info.html',1,'VmaVirtualAllocationCreateInfo']]],
- ['vmavirtualallocationinfo_186',['VmaVirtualAllocationInfo',['../struct_vma_virtual_allocation_info.html',1,'VmaVirtualAllocationInfo'],['../vk__mem__alloc_8h.html#a75bc33ff7cf18c98e101f570dc2a5ebc',1,'VmaVirtualAllocationInfo(): vk_mem_alloc.h']]],
- ['vmavirtualblock_187',['VmaVirtualBlock',['../struct_vma_virtual_block.html',1,'']]],
- ['vmavirtualblockcreateflagbits_188',['VmaVirtualBlockCreateFlagBits',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bca',1,'VmaVirtualBlockCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a0860ba1c0a67178fae4aecb63a78573e',1,'VmaVirtualBlockCreateFlagBits(): vk_mem_alloc.h']]],
- ['vmavirtualblockcreateflags_189',['VmaVirtualBlockCreateFlags',['../vk__mem__alloc_8h.html#a4e49c2f0ab7f6b4868833e5bac78d91e',1,'vk_mem_alloc.h']]],
- ['vmavirtualblockcreateinfo_190',['VmaVirtualBlockCreateInfo',['../struct_vma_virtual_block_create_info.html',1,'VmaVirtualBlockCreateInfo'],['../vk__mem__alloc_8h.html#a4753d42d40217a3a652a3cdf253ad773',1,'VmaVirtualBlockCreateInfo(): vk_mem_alloc.h']]],
- ['vmavirtualfree_191',['vmaVirtualFree',['../vk__mem__alloc_8h.html#a13f01c44b3c1a06e695f1f5d24b80639',1,'vk_mem_alloc.h']]],
- ['vmavulkanfunctions_192',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074',1,'VmaVulkanFunctions(): vk_mem_alloc.h'],['../struct_vma_vulkan_functions.html',1,'VmaVulkanFunctions']]],
- ['vulkan_20memory_20allocator_193',['Vulkan Memory Allocator',['../index.html',1,'']]],
- ['vulkanapiversion_194',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]]
+ ['vk_5ferror_5funknown_2',['VK_ERROR_UNKNOWN',['../vk__mem__alloc_8h.html#a162894cbe84f7d76632eb9af1e4b3558',1,'vk_mem_alloc.h']]],
+ ['vk_5fkhr_5fdedicated_5fallocation_3',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]],
+ ['vk_5fmem_5falloc_2eh_4',['vk_mem_alloc.h',['../vk__mem__alloc_8h.html',1,'']]],
+ ['vkallocatememory_5',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]],
+ ['vkbindbuffermemory_6',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]],
+ ['vkbindbuffermemory2khr_7',['vkBindBufferMemory2KHR',['../struct_vma_vulkan_functions.html#a0c4907235aab9df2767b79836afa2dc9',1,'VmaVulkanFunctions']]],
+ ['vkbindimagememory_8',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]],
+ ['vkbindimagememory2khr_9',['vkBindImageMemory2KHR',['../struct_vma_vulkan_functions.html#ab95aaa73ab8a3fe9fd3daaaec4e0b2bf',1,'VmaVulkanFunctions']]],
+ ['vkcmdcopybuffer_10',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]],
+ ['vkcreatebuffer_11',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]],
+ ['vkcreateimage_12',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]],
+ ['vkdestroybuffer_13',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]],
+ ['vkdestroyimage_14',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]],
+ ['vkflushmappedmemoryranges_15',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]],
+ ['vkfreememory_16',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]],
+ ['vkgetbuffermemoryrequirements_17',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]],
+ ['vkgetbuffermemoryrequirements2khr_18',['vkGetBufferMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9d8d1b05d2b1e7e1d9b27f6f585acf9c',1,'VmaVulkanFunctions']]],
+ ['vkgetdeviceprocaddr_19',['vkGetDeviceProcAddr',['../struct_vma_vulkan_functions.html#ac383ab9af127e5e136622fa4ebea9e57',1,'VmaVulkanFunctions']]],
+ ['vkgetimagememoryrequirements_20',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]],
+ ['vkgetimagememoryrequirements2khr_21',['vkGetImageMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9cdcdc1e2b2ea7c571f7d27e30ba6875',1,'VmaVulkanFunctions']]],
+ ['vkgetinstanceprocaddr_22',['vkGetInstanceProcAddr',['../struct_vma_vulkan_functions.html#a3eafa102f5f8915f093f40675636b849',1,'VmaVulkanFunctions']]],
+ ['vkgetphysicaldevicememoryproperties_23',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]],
+ ['vkgetphysicaldevicememoryproperties2khr_24',['vkGetPhysicalDeviceMemoryProperties2KHR',['../struct_vma_vulkan_functions.html#a0d992896e6ffcf92b9d7ea049fa5c445',1,'VmaVulkanFunctions']]],
+ ['vkgetphysicaldeviceproperties_25',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]],
+ ['vkinvalidatemappedmemoryranges_26',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]],
+ ['vkmapmemory_27',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]],
+ ['vkunmapmemory_28',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]],
+ ['vma_5fallocation_5fcreate_5fcan_5falias_5fbit_29',['VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597afb0ee060cd733aaa5e249704ff589ad6',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fcan_5fbecome_5flost_5fbit_30',['VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fcan_5fmake_5fother_5flost_5fbit_31',['VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fdedicated_5fmemory_5fbit_32',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_33',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_34',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fmapped_5fbit_35',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_36',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_37',['VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a839826775c62319466441f86496f036d',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5ffirst_5ffit_5fbit_38',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fmask_39',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_40',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a621b704103eb3360230c860acf36e706',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_41',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8af1210cf591784afa026d94998f735d',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_42',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a0729e932b7ea170e3a128cad96c5cf6d',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fworst_5ffit_5fbit_43',['VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad242a04f802e25fef0b880afe8bb0a62',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fupper_5faddress_5fbit_44',['VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a42ba3a2d2c7117953210b7c3ef8da0df',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fuser_5fdata_5fcopy_5fstring_5fbit_45',['VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fwithin_5fbudget_5fbit_46',['VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ab8b1764f3e9022368e440c057783b92d',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5famd_5fdevice_5fcoherent_5fmemory_5fbit_47',['VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca2acce4886d8078552efa38878413970f',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fbuffer_5fdevice_5faddress_5fbit_48',['VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca5f1b28b0414319d1687e1f2b30ab0089',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fext_5fmemory_5fbudget_5fbit_49',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4d4687863f7bd4b418c6006dc04400b0',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fext_5fmemory_5fpriority_5fbit_50',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7caffdd7a5169be3dbd7cbf6b3619e4f78a',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fexternally_5fsynchronized_5fbit_51',['VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fflag_5fbits_5fmax_5fenum_52',['VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cae4d5ad929caba5f23eb502b13bd5286c',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fkhr_5fbind_5fmemory2_5fbit_53',['VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca8fb75bf07cd184ab903596295e863dee',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fkhr_5fdedicated_5fallocation_5fbit_54',['VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878',1,'vk_mem_alloc.h']]],
+ ['vma_5fbind_5fmemory2_55',['VMA_BIND_MEMORY2',['../vk__mem__alloc_8h.html#a88bef97f86d70a34a4c0746e09a2680d',1,'vk_mem_alloc.h']]],
+ ['vma_5fbuffer_5fdevice_5faddress_56',['VMA_BUFFER_DEVICE_ADDRESS',['../vk__mem__alloc_8h.html#a7f9d5e71b70dd1a137c303a8a8262c10',1,'vk_mem_alloc.h']]],
+ ['vma_5fdedicated_5fallocation_57',['VMA_DEDICATED_ALLOCATION',['../vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4',1,'vk_mem_alloc.h']]],
+ ['vma_5fdefragmentation_5fflag_5fbits_5fmax_5fenum_58',['VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50cab87ec33154803bfeb5ac2b379f1d6a97',1,'vk_mem_alloc.h']]],
+ ['vma_5fdefragmentation_5fflag_5fincremental_59',['VMA_DEFRAGMENTATION_FLAG_INCREMENTAL',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50ca31af49446af2459284a568ce2f3fdd33',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fbudget_60',['VMA_MEMORY_BUDGET',['../vk__mem__alloc_8h.html#a05decf1cf4ebf767beba7acca6c1ec3a',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fcpu_5fcopy_61',['VMA_MEMORY_USAGE_CPU_COPY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca416a444d4d0fc20067c3f76f32ff2500',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fcpu_5fonly_62',['VMA_MEMORY_USAGE_CPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fcpu_5fto_5fgpu_63',['VMA_MEMORY_USAGE_CPU_TO_GPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fgpu_5flazily_5fallocated_64',['VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca835333d9072db63a653818030e17614d',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fgpu_5fonly_65',['VMA_MEMORY_USAGE_GPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fgpu_5fto_5fcpu_66',['VMA_MEMORY_USAGE_GPU_TO_CPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca7b586d2fdaf82a463b58f581ed72be27',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fmax_5fenum_67',['VMA_MEMORY_USAGE_MAX_ENUM',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5funknown_68',['VMA_MEMORY_USAGE_UNKNOWN',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5falgorithm_5fmask_69',['VMA_POOL_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7af4d270f8f42517a0f70037ceb6ac1d9c',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5fbuddy_5falgorithm_5fbit_70',['VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a97a0dc38e5161b780594d998d313d35e',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_71',['VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5fignore_5fbuffer_5fimage_5fgranularity_5fbit_72',['VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5flinear_5falgorithm_5fbit_73',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]],
+ ['vma_5frecord_5fflag_5fbits_5fmax_5fenum_74',['VMA_RECORD_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e',1,'vk_mem_alloc.h']]],
+ ['vma_5frecord_5fflush_5fafter_5fcall_5fbit_75',['VMA_RECORD_FLUSH_AFTER_CALL_BIT',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7',1,'vk_mem_alloc.h']]],
+ ['vma_5frecording_5fenabled_76',['VMA_RECORDING_ENABLED',['../vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c',1,'vk_mem_alloc.h']]],
+ ['vma_5fstats_5fstring_5fenabled_77',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_78',['VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac1163c03ea837fa663462dc286d6a1a9',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmask_79',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac5b5e45c335368d18df59c9f27df17e3',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_80',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9aa0c32667ba2deaa9cdeac6149ec47a',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_81',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ae2a9591a62b5e3b1bdcbc81c6188a1bf',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_82',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a562d10a46012719d33167d3dc5dbbf9b',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fallocation_5fcreate_5fupper_5faddress_5fbit_83',['VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9524a329a55b5ec390d57d90b67ad78e',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fblock_5fcreate_5falgorithm_5fmask_84',['VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaaf9487467136e1a9e371894dc3a7c4844',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fblock_5fcreate_5fbuddy_5falgorithm_5fbit_85',['VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa923116612509e26bf84982b9baf25c63',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fblock_5fcreate_5fflag_5fbits_5fmax_5fenum_86',['VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa5fc0d333c3d5687a8bbf57df9b377a87',1,'vk_mem_alloc.h']]],
+ ['vma_5fvirtual_5fblock_5fcreate_5flinear_5falgorithm_5fbit_87',['VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaae6423e2fa2f3c9211b21c819e3f10f96',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememory_88',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememoryforbuffer_89',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememoryforimage_90',['vmaAllocateMemoryForImage',['../vk__mem__alloc_8h.html#a0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememorypages_91',['vmaAllocateMemoryPages',['../vk__mem__alloc_8h.html#ad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]],
+ ['vmaallocation_92',['VmaAllocation',['../struct_vma_allocation.html',1,'']]],
+ ['vmaallocationcreateflagbits_93',['VmaAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a4fceecc301f4064dc808d3cd6c038941',1,'VmaAllocationCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597',1,'VmaAllocationCreateFlagBits(): vk_mem_alloc.h']]],
+ ['vmaallocationcreateflags_94',['VmaAllocationCreateFlags',['../vk__mem__alloc_8h.html#a5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]],
+ ['vmaallocationcreateinfo_95',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'VmaAllocationCreateInfo'],['../vk__mem__alloc_8h.html#a3bf110892ea2fb4649fedb68488d026a',1,'VmaAllocationCreateInfo(): vk_mem_alloc.h']]],
+ ['vmaallocationinfo_96',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'VmaAllocationInfo'],['../vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50',1,'VmaAllocationInfo(): vk_mem_alloc.h']]],
+ ['vmaallocator_97',['VmaAllocator',['../struct_vma_allocator.html',1,'']]],
+ ['vmaallocatorcreateflagbits_98',['VmaAllocatorCreateFlagBits',['../vk__mem__alloc_8h.html#afd73b95e737ee7e76f827cb5472f559f',1,'VmaAllocatorCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7c',1,'VmaAllocatorCreateFlagBits(): vk_mem_alloc.h']]],
+ ['vmaallocatorcreateflags_99',['VmaAllocatorCreateFlags',['../vk__mem__alloc_8h.html#acfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]],
+ ['vmaallocatorcreateinfo_100',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'VmaAllocatorCreateInfo'],['../vk__mem__alloc_8h.html#aad9652301d33759b83e52d4f3605a14a',1,'VmaAllocatorCreateInfo(): vk_mem_alloc.h']]],
+ ['vmaallocatorinfo_101',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'VmaAllocatorInfo'],['../vk__mem__alloc_8h.html#a1988031b0223fdbd564250fa1edd942c',1,'VmaAllocatorInfo(): vk_mem_alloc.h']]],
+ ['vmabegindefragmentationpass_102',['vmaBeginDefragmentationPass',['../vk__mem__alloc_8h.html#ac0f01545b6262f7d4d128fc8f8e5c77b',1,'vk_mem_alloc.h']]],
+ ['vmabindbuffermemory_103',['vmaBindBufferMemory',['../vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]],
+ ['vmabindbuffermemory2_104',['vmaBindBufferMemory2',['../vk__mem__alloc_8h.html#a927c944f45e0f2941182abb6f608e64a',1,'vk_mem_alloc.h']]],
+ ['vmabindimagememory_105',['vmaBindImageMemory',['../vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]],
+ ['vmabindimagememory2_106',['vmaBindImageMemory2',['../vk__mem__alloc_8h.html#aa8251ee81b0045a443e35b8e8aa021bc',1,'vk_mem_alloc.h']]],
+ ['vmabudget_107',['VmaBudget',['../struct_vma_budget.html',1,'VmaBudget'],['../vk__mem__alloc_8h.html#aa078667e71b1ef24e87a6a30d128381d',1,'VmaBudget(): vk_mem_alloc.h']]],
+ ['vmabuildstatsstring_108',['vmaBuildStatsString',['../vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]],
+ ['vmabuildvirtualblockstatsstring_109',['vmaBuildVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]],
+ ['vmacalculatestats_110',['vmaCalculateStats',['../vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3',1,'vk_mem_alloc.h']]],
+ ['vmacalculatevirtualblockstats_111',['vmaCalculateVirtualBlockStats',['../vk__mem__alloc_8h.html#a95169b4730e94757897470086ec2768a',1,'vk_mem_alloc.h']]],
+ ['vmacheckcorruption_112',['vmaCheckCorruption',['../vk__mem__alloc_8h.html#a49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]],
+ ['vmacheckpoolcorruption_113',['vmaCheckPoolCorruption',['../vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]],
+ ['vmaclearvirtualblock_114',['vmaClearVirtualBlock',['../vk__mem__alloc_8h.html#a5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]],
+ ['vmacreateallocator_115',['vmaCreateAllocator',['../vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]],
+ ['vmacreatebuffer_116',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]],
+ ['vmacreatebufferwithalignment_117',['vmaCreateBufferWithAlignment',['../vk__mem__alloc_8h.html#aa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]],
+ ['vmacreateimage_118',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]],
+ ['vmacreatelostallocation_119',['vmaCreateLostAllocation',['../vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1',1,'vk_mem_alloc.h']]],
+ ['vmacreatepool_120',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]],
+ ['vmacreatevirtualblock_121',['vmaCreateVirtualBlock',['../vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]],
+ ['vmadefragment_122',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationbegin_123',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationcontext_124',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]],
+ ['vmadefragmentationend_125',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationflagbits_126',['VmaDefragmentationFlagBits',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50c',1,'VmaDefragmentationFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a13415cc0b443353a7b5abda300b833fc',1,'VmaDefragmentationFlagBits(): vk_mem_alloc.h']]],
+ ['vmadefragmentationflags_127',['VmaDefragmentationFlags',['../vk__mem__alloc_8h.html#a88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationinfo_128',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'VmaDefragmentationInfo'],['../vk__mem__alloc_8h.html#a2bf47f96bf92bed2a49461bd9af3acfa',1,'VmaDefragmentationInfo(): vk_mem_alloc.h']]],
+ ['vmadefragmentationinfo2_129',['VmaDefragmentationInfo2',['../struct_vma_defragmentation_info2.html',1,'VmaDefragmentationInfo2'],['../vk__mem__alloc_8h.html#ad6daeffaa670ce6d11a203a6224c9937',1,'VmaDefragmentationInfo2(): vk_mem_alloc.h']]],
+ ['vmadefragmentationpassinfo_130',['VmaDefragmentationPassInfo',['../vk__mem__alloc_8h.html#a72aebd522242d56abea67b4f47f6549e',1,'VmaDefragmentationPassInfo(): vk_mem_alloc.h'],['../struct_vma_defragmentation_pass_info.html',1,'VmaDefragmentationPassInfo']]],
+ ['vmadefragmentationpassmoveinfo_131',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'VmaDefragmentationPassMoveInfo'],['../vk__mem__alloc_8h.html#ad6799e8e2b1527abfc84d33bc44aeaf5',1,'VmaDefragmentationPassMoveInfo(): vk_mem_alloc.h']]],
+ ['vmadefragmentationstats_132',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'VmaDefragmentationStats'],['../vk__mem__alloc_8h.html#ad94034192259c2e34a4d1c5e27810403',1,'VmaDefragmentationStats(): vk_mem_alloc.h']]],
+ ['vmadestroyallocator_133',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]],
+ ['vmadestroybuffer_134',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]],
+ ['vmadestroyimage_135',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]],
+ ['vmadestroypool_136',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]],
+ ['vmadestroyvirtualblock_137',['vmaDestroyVirtualBlock',['../vk__mem__alloc_8h.html#a3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]],
+ ['vmadevicememorycallbacks_138',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'VmaDeviceMemoryCallbacks'],['../vk__mem__alloc_8h.html#a77692d3c8770ea8882d573206bd27b2b',1,'VmaDeviceMemoryCallbacks(): vk_mem_alloc.h']]],
+ ['vmaenddefragmentationpass_139',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindex_140',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindexforbufferinfo_141',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindexforimageinfo_142',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]],
+ ['vmaflushallocation_143',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]],
+ ['vmaflushallocations_144',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]],
+ ['vmafreememory_145',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]],
+ ['vmafreememorypages_146',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]],
+ ['vmafreestatsstring_147',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]],
+ ['vmafreevirtualblockstatsstring_148',['vmaFreeVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]],
+ ['vmagetallocationinfo_149',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]],
+ ['vmagetallocationmemoryproperties_150',['vmaGetAllocationMemoryProperties',['../vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]],
+ ['vmagetallocatorinfo_151',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]],
+ ['vmagetheapbudgets_152',['vmaGetHeapBudgets',['../vk__mem__alloc_8h.html#a9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]],
+ ['vmagetmemoryproperties_153',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]],
+ ['vmagetmemorytypeproperties_154',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]],
+ ['vmagetphysicaldeviceproperties_155',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]],
+ ['vmagetpoolname_156',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]],
+ ['vmagetpoolstats_157',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]],
+ ['vmagetvirtualallocationinfo_158',['vmaGetVirtualAllocationInfo',['../vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e',1,'vk_mem_alloc.h']]],
+ ['vmainvalidateallocation_159',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]],
+ ['vmainvalidateallocations_160',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]],
+ ['vmaisvirtualblockempty_161',['vmaIsVirtualBlockEmpty',['../vk__mem__alloc_8h.html#acd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]],
+ ['vmamakepoolallocationslost_162',['vmaMakePoolAllocationsLost',['../vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024',1,'vk_mem_alloc.h']]],
+ ['vmamapmemory_163',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]],
+ ['vmamemoryusage_164',['VmaMemoryUsage',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc',1,'VmaMemoryUsage(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a806e8499dde802e59eb72a1dc811c35f',1,'VmaMemoryUsage(): vk_mem_alloc.h']]],
+ ['vmapool_165',['VmaPool',['../struct_vma_pool.html',1,'']]],
+ ['vmapoolcreateflagbits_166',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a4d4f2efc2509157a9e4ecd4fd7942303',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h']]],
+ ['vmapoolcreateflags_167',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]],
+ ['vmapoolcreateinfo_168',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'VmaPoolCreateInfo'],['../vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67',1,'VmaPoolCreateInfo(): vk_mem_alloc.h']]],
+ ['vmapoolstats_169',['VmaPoolStats',['../struct_vma_pool_stats.html',1,'VmaPoolStats'],['../vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1',1,'VmaPoolStats(): vk_mem_alloc.h']]],
+ ['vmarecordflagbits_170',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2',1,'VmaRecordFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#acd24d5eb58abff7e1f43cb32a1ba1413',1,'VmaRecordFlagBits(): vk_mem_alloc.h']]],
+ ['vmarecordflags_171',['VmaRecordFlags',['../vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828',1,'vk_mem_alloc.h']]],
+ ['vmarecordsettings_172',['VmaRecordSettings',['../vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc',1,'VmaRecordSettings(): vk_mem_alloc.h'],['../struct_vma_record_settings.html',1,'VmaRecordSettings']]],
+ ['vmasetallocationuserdata_173',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]],
+ ['vmasetcurrentframeindex_174',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]],
+ ['vmasetpoolname_175',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]],
+ ['vmasetvirtualallocationuserdata_176',['vmaSetVirtualAllocationUserData',['../vk__mem__alloc_8h.html#a4b96f835d38686df937e097a0c7db5e9',1,'vk_mem_alloc.h']]],
+ ['vmastatinfo_177',['VmaStatInfo',['../struct_vma_stat_info.html',1,'VmaStatInfo'],['../vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878',1,'VmaStatInfo(): vk_mem_alloc.h']]],
+ ['vmastats_178',['VmaStats',['../struct_vma_stats.html',1,'VmaStats'],['../vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034',1,'VmaStats(): vk_mem_alloc.h']]],
+ ['vmatouchallocation_179',['vmaTouchAllocation',['../vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a',1,'vk_mem_alloc.h']]],
+ ['vmaunmapmemory_180',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]],
+ ['vmavirtualallocate_181',['vmaVirtualAllocate',['../vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2',1,'vk_mem_alloc.h']]],
+ ['vmavirtualallocationcreateflagbits_182',['VmaVirtualAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6',1,'VmaVirtualAllocationCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a936815e64946a6b6d812d08d10184c23',1,'VmaVirtualAllocationCreateFlagBits(): vk_mem_alloc.h']]],
+ ['vmavirtualallocationcreateflags_183',['VmaVirtualAllocationCreateFlags',['../vk__mem__alloc_8h.html#ae96ffc099bf898257fb19e9410ed08a7',1,'vk_mem_alloc.h']]],
+ ['vmavirtualallocationcreateinfo_184',['VmaVirtualAllocationCreateInfo',['../vk__mem__alloc_8h.html#ac3c90d80bedc6847a41b82d0e2158c9e',1,'VmaVirtualAllocationCreateInfo(): vk_mem_alloc.h'],['../struct_vma_virtual_allocation_create_info.html',1,'VmaVirtualAllocationCreateInfo']]],
+ ['vmavirtualallocationinfo_185',['VmaVirtualAllocationInfo',['../struct_vma_virtual_allocation_info.html',1,'VmaVirtualAllocationInfo'],['../vk__mem__alloc_8h.html#a75bc33ff7cf18c98e101f570dc2a5ebc',1,'VmaVirtualAllocationInfo(): vk_mem_alloc.h']]],
+ ['vmavirtualblock_186',['VmaVirtualBlock',['../struct_vma_virtual_block.html',1,'']]],
+ ['vmavirtualblockcreateflagbits_187',['VmaVirtualBlockCreateFlagBits',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bca',1,'VmaVirtualBlockCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a0860ba1c0a67178fae4aecb63a78573e',1,'VmaVirtualBlockCreateFlagBits(): vk_mem_alloc.h']]],
+ ['vmavirtualblockcreateflags_188',['VmaVirtualBlockCreateFlags',['../vk__mem__alloc_8h.html#a4e49c2f0ab7f6b4868833e5bac78d91e',1,'vk_mem_alloc.h']]],
+ ['vmavirtualblockcreateinfo_189',['VmaVirtualBlockCreateInfo',['../struct_vma_virtual_block_create_info.html',1,'VmaVirtualBlockCreateInfo'],['../vk__mem__alloc_8h.html#a4753d42d40217a3a652a3cdf253ad773',1,'VmaVirtualBlockCreateInfo(): vk_mem_alloc.h']]],
+ ['vmavirtualfree_190',['vmaVirtualFree',['../vk__mem__alloc_8h.html#a13f01c44b3c1a06e695f1f5d24b80639',1,'vk_mem_alloc.h']]],
+ ['vmavulkanfunctions_191',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074',1,'VmaVulkanFunctions(): vk_mem_alloc.h'],['../struct_vma_vulkan_functions.html',1,'VmaVulkanFunctions']]],
+ ['vulkan_20memory_20allocator_192',['Vulkan Memory Allocator',['../index.html',1,'']]],
+ ['vulkanapiversion_193',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]]
];
diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js
index 8623c4f..793c21c 100644
--- a/docs/html/search/functions_0.js
+++ b/docs/html/search/functions_0.js
@@ -1,68 +1,67 @@
var searchData=
[
- ['vk_5fdefine_5fhandle_0',['VK_DEFINE_HANDLE',['../vk__mem__alloc_8h.html#a916e5291bb205e995aa87aee1d6dbbfc',1,'vk_mem_alloc.h']]],
- ['vmaallocatememory_1',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]],
- ['vmaallocatememoryforbuffer_2',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]],
- ['vmaallocatememoryforimage_3',['vmaAllocateMemoryForImage',['../vk__mem__alloc_8h.html#a0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]],
- ['vmaallocatememorypages_4',['vmaAllocateMemoryPages',['../vk__mem__alloc_8h.html#ad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]],
- ['vmabegindefragmentationpass_5',['vmaBeginDefragmentationPass',['../vk__mem__alloc_8h.html#ac0f01545b6262f7d4d128fc8f8e5c77b',1,'vk_mem_alloc.h']]],
- ['vmabindbuffermemory_6',['vmaBindBufferMemory',['../vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]],
- ['vmabindbuffermemory2_7',['vmaBindBufferMemory2',['../vk__mem__alloc_8h.html#a927c944f45e0f2941182abb6f608e64a',1,'vk_mem_alloc.h']]],
- ['vmabindimagememory_8',['vmaBindImageMemory',['../vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]],
- ['vmabindimagememory2_9',['vmaBindImageMemory2',['../vk__mem__alloc_8h.html#aa8251ee81b0045a443e35b8e8aa021bc',1,'vk_mem_alloc.h']]],
- ['vmabuildstatsstring_10',['vmaBuildStatsString',['../vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]],
- ['vmabuildvirtualblockstatsstring_11',['vmaBuildVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]],
- ['vmacalculatestats_12',['vmaCalculateStats',['../vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3',1,'vk_mem_alloc.h']]],
- ['vmacalculatevirtualblockstats_13',['vmaCalculateVirtualBlockStats',['../vk__mem__alloc_8h.html#a95169b4730e94757897470086ec2768a',1,'vk_mem_alloc.h']]],
- ['vmacheckcorruption_14',['vmaCheckCorruption',['../vk__mem__alloc_8h.html#a49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]],
- ['vmacheckpoolcorruption_15',['vmaCheckPoolCorruption',['../vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]],
- ['vmaclearvirtualblock_16',['vmaClearVirtualBlock',['../vk__mem__alloc_8h.html#a5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]],
- ['vmacreateallocator_17',['vmaCreateAllocator',['../vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]],
- ['vmacreatebuffer_18',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]],
- ['vmacreatebufferwithalignment_19',['vmaCreateBufferWithAlignment',['../vk__mem__alloc_8h.html#aa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]],
- ['vmacreateimage_20',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]],
- ['vmacreatelostallocation_21',['vmaCreateLostAllocation',['../vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1',1,'vk_mem_alloc.h']]],
- ['vmacreatepool_22',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]],
- ['vmacreatevirtualblock_23',['vmaCreateVirtualBlock',['../vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]],
- ['vmadefragment_24',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationbegin_25',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationend_26',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]],
- ['vmadestroyallocator_27',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]],
- ['vmadestroybuffer_28',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]],
- ['vmadestroyimage_29',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]],
- ['vmadestroypool_30',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]],
- ['vmadestroyvirtualblock_31',['vmaDestroyVirtualBlock',['../vk__mem__alloc_8h.html#a3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]],
- ['vmaenddefragmentationpass_32',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindex_33',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindexforbufferinfo_34',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindexforimageinfo_35',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]],
- ['vmaflushallocation_36',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]],
- ['vmaflushallocations_37',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]],
- ['vmafreememory_38',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]],
- ['vmafreememorypages_39',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]],
- ['vmafreestatsstring_40',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]],
- ['vmafreevirtualblockstatsstring_41',['vmaFreeVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]],
- ['vmagetallocationinfo_42',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]],
- ['vmagetallocationmemoryproperties_43',['vmaGetAllocationMemoryProperties',['../vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]],
- ['vmagetallocatorinfo_44',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]],
- ['vmagetheapbudgets_45',['vmaGetHeapBudgets',['../vk__mem__alloc_8h.html#a9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]],
- ['vmagetmemoryproperties_46',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]],
- ['vmagetmemorytypeproperties_47',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]],
- ['vmagetphysicaldeviceproperties_48',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]],
- ['vmagetpoolname_49',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]],
- ['vmagetpoolstats_50',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]],
- ['vmagetvirtualallocationinfo_51',['vmaGetVirtualAllocationInfo',['../vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e',1,'vk_mem_alloc.h']]],
- ['vmainvalidateallocation_52',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]],
- ['vmainvalidateallocations_53',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]],
- ['vmaisvirtualblockempty_54',['vmaIsVirtualBlockEmpty',['../vk__mem__alloc_8h.html#acd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]],
- ['vmamakepoolallocationslost_55',['vmaMakePoolAllocationsLost',['../vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024',1,'vk_mem_alloc.h']]],
- ['vmamapmemory_56',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]],
- ['vmasetallocationuserdata_57',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]],
- ['vmasetcurrentframeindex_58',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]],
- ['vmasetpoolname_59',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]],
- ['vmasetvirtualallocationuserdata_60',['vmaSetVirtualAllocationUserData',['../vk__mem__alloc_8h.html#a4b96f835d38686df937e097a0c7db5e9',1,'vk_mem_alloc.h']]],
- ['vmatouchallocation_61',['vmaTouchAllocation',['../vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a',1,'vk_mem_alloc.h']]],
- ['vmaunmapmemory_62',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]],
- ['vmavirtualallocate_63',['vmaVirtualAllocate',['../vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2',1,'vk_mem_alloc.h']]],
- ['vmavirtualfree_64',['vmaVirtualFree',['../vk__mem__alloc_8h.html#a13f01c44b3c1a06e695f1f5d24b80639',1,'vk_mem_alloc.h']]]
+ ['vmaallocatememory_0',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememoryforbuffer_1',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememoryforimage_2',['vmaAllocateMemoryForImage',['../vk__mem__alloc_8h.html#a0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememorypages_3',['vmaAllocateMemoryPages',['../vk__mem__alloc_8h.html#ad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]],
+ ['vmabegindefragmentationpass_4',['vmaBeginDefragmentationPass',['../vk__mem__alloc_8h.html#ac0f01545b6262f7d4d128fc8f8e5c77b',1,'vk_mem_alloc.h']]],
+ ['vmabindbuffermemory_5',['vmaBindBufferMemory',['../vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]],
+ ['vmabindbuffermemory2_6',['vmaBindBufferMemory2',['../vk__mem__alloc_8h.html#a927c944f45e0f2941182abb6f608e64a',1,'vk_mem_alloc.h']]],
+ ['vmabindimagememory_7',['vmaBindImageMemory',['../vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]],
+ ['vmabindimagememory2_8',['vmaBindImageMemory2',['../vk__mem__alloc_8h.html#aa8251ee81b0045a443e35b8e8aa021bc',1,'vk_mem_alloc.h']]],
+ ['vmabuildstatsstring_9',['vmaBuildStatsString',['../vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]],
+ ['vmabuildvirtualblockstatsstring_10',['vmaBuildVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]],
+ ['vmacalculatestats_11',['vmaCalculateStats',['../vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3',1,'vk_mem_alloc.h']]],
+ ['vmacalculatevirtualblockstats_12',['vmaCalculateVirtualBlockStats',['../vk__mem__alloc_8h.html#a95169b4730e94757897470086ec2768a',1,'vk_mem_alloc.h']]],
+ ['vmacheckcorruption_13',['vmaCheckCorruption',['../vk__mem__alloc_8h.html#a49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]],
+ ['vmacheckpoolcorruption_14',['vmaCheckPoolCorruption',['../vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]],
+ ['vmaclearvirtualblock_15',['vmaClearVirtualBlock',['../vk__mem__alloc_8h.html#a5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]],
+ ['vmacreateallocator_16',['vmaCreateAllocator',['../vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]],
+ ['vmacreatebuffer_17',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]],
+ ['vmacreatebufferwithalignment_18',['vmaCreateBufferWithAlignment',['../vk__mem__alloc_8h.html#aa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]],
+ ['vmacreateimage_19',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]],
+ ['vmacreatelostallocation_20',['vmaCreateLostAllocation',['../vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1',1,'vk_mem_alloc.h']]],
+ ['vmacreatepool_21',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]],
+ ['vmacreatevirtualblock_22',['vmaCreateVirtualBlock',['../vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]],
+ ['vmadefragment_23',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationbegin_24',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationend_25',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]],
+ ['vmadestroyallocator_26',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]],
+ ['vmadestroybuffer_27',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]],
+ ['vmadestroyimage_28',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]],
+ ['vmadestroypool_29',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]],
+ ['vmadestroyvirtualblock_30',['vmaDestroyVirtualBlock',['../vk__mem__alloc_8h.html#a3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]],
+ ['vmaenddefragmentationpass_31',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindex_32',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindexforbufferinfo_33',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindexforimageinfo_34',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]],
+ ['vmaflushallocation_35',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]],
+ ['vmaflushallocations_36',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]],
+ ['vmafreememory_37',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]],
+ ['vmafreememorypages_38',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]],
+ ['vmafreestatsstring_39',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]],
+ ['vmafreevirtualblockstatsstring_40',['vmaFreeVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]],
+ ['vmagetallocationinfo_41',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]],
+ ['vmagetallocationmemoryproperties_42',['vmaGetAllocationMemoryProperties',['../vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]],
+ ['vmagetallocatorinfo_43',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]],
+ ['vmagetheapbudgets_44',['vmaGetHeapBudgets',['../vk__mem__alloc_8h.html#a9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]],
+ ['vmagetmemoryproperties_45',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]],
+ ['vmagetmemorytypeproperties_46',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]],
+ ['vmagetphysicaldeviceproperties_47',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]],
+ ['vmagetpoolname_48',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]],
+ ['vmagetpoolstats_49',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]],
+ ['vmagetvirtualallocationinfo_50',['vmaGetVirtualAllocationInfo',['../vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e',1,'vk_mem_alloc.h']]],
+ ['vmainvalidateallocation_51',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]],
+ ['vmainvalidateallocations_52',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]],
+ ['vmaisvirtualblockempty_53',['vmaIsVirtualBlockEmpty',['../vk__mem__alloc_8h.html#acd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]],
+ ['vmamakepoolallocationslost_54',['vmaMakePoolAllocationsLost',['../vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024',1,'vk_mem_alloc.h']]],
+ ['vmamapmemory_55',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]],
+ ['vmasetallocationuserdata_56',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]],
+ ['vmasetcurrentframeindex_57',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]],
+ ['vmasetpoolname_58',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]],
+ ['vmasetvirtualallocationuserdata_59',['vmaSetVirtualAllocationUserData',['../vk__mem__alloc_8h.html#a4b96f835d38686df937e097a0c7db5e9',1,'vk_mem_alloc.h']]],
+ ['vmatouchallocation_60',['vmaTouchAllocation',['../vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a',1,'vk_mem_alloc.h']]],
+ ['vmaunmapmemory_61',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]],
+ ['vmavirtualallocate_62',['vmaVirtualAllocate',['../vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2',1,'vk_mem_alloc.h']]],
+ ['vmavirtualfree_63',['vmaVirtualFree',['../vk__mem__alloc_8h.html#a13f01c44b3c1a06e695f1f5d24b80639',1,'vk_mem_alloc.h']]]
];
diff --git a/docs/html/virtual_allocator.html b/docs/html/virtual_allocator.html
index 8925431..5dc46ce 100644
--- a/docs/html/virtual_allocator.html
+++ b/docs/html/virtual_allocator.html
@@ -83,8 +83,8 @@ Creating virtual block
-Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
Definition: vk_mem_alloc.h:2219
-VkDeviceSize size
Total size of the virtual block.
Definition: vk_mem_alloc.h:2225
+Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
Definition: vk_mem_alloc.h:1427
+VkDeviceSize size
Total size of the virtual block.
Definition: vk_mem_alloc.h:1433
Handle to a virtual block object that allows to use core allocation algorithm without allocating any ...
VkResult vmaCreateVirtualBlock(const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock)
Creates new VmaVirtualBlock object.
@@ -109,8 +109,8 @@ Making virtual allocations
{
}
-Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
Definition: vk_mem_alloc.h:2267
-VkDeviceSize size
Size of the allocation.
Definition: vk_mem_alloc.h:2272
+Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
Definition: vk_mem_alloc.h:1448
+VkDeviceSize size
Size of the allocation.
Definition: vk_mem_alloc.h:1453
VkResult vmaVirtualAllocate(VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VkDeviceSize *pOffset)
Allocates new virtual allocation inside given VmaVirtualBlock.
Deallocation
@@ -137,8 +137,8 @@ Allocation parameters
delete (CustomAllocData*)allocInfo.
pUserData;
-Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
Definition: vk_mem_alloc.h:2290
-void * pUserData
Custom pointer associated with the allocation.
Definition: vk_mem_alloc.h:2300
+Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
Definition: vk_mem_alloc.h:1471
+void * pUserData
Custom pointer associated with the allocation.
Definition: vk_mem_alloc.h:1481
void vmaGetVirtualAllocationInfo(VmaVirtualBlock virtualBlock, VkDeviceSize offset, VmaVirtualAllocationInfo *pVirtualAllocInfo)
Returns information about a specific virtual allocation within a virtual block, like its size and pUs...
Alignment and units
@@ -149,7 +149,7 @@ Alignment and units
VkDeviceSize allocOffset;
-VkDeviceSize alignment
Required alignment of the allocation. Optional.
Definition: vk_mem_alloc.h:2277
+VkDeviceSize alignment
Required alignment of the allocation. Optional.
Definition: vk_mem_alloc.h:1458
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:
- VmaVirtualBlockCreateInfo::size
@@ -163,9 +163,9 @@ Statistics
printf("My virtual block has %llu bytes used by %u virtual allocations\n",
-Calculated statistics of memory usage in entire allocator.
Definition: vk_mem_alloc.h:698
-uint32_t allocationCount
Number of VmaAllocation allocation objects allocated.
Definition: vk_mem_alloc.h:702
-VkDeviceSize usedBytes
Total number of bytes occupied by all allocations.
Definition: vk_mem_alloc.h:706
+Calculated statistics of memory usage in entire allocator.
Definition: vk_mem_alloc.h:1036
+uint32_t allocationCount
Number of VmaAllocation allocation objects allocated.
Definition: vk_mem_alloc.h:1040
+VkDeviceSize usedBytes
Total number of bytes occupied by all allocations.
Definition: vk_mem_alloc.h:1044
void vmaCalculateVirtualBlockStats(VmaVirtualBlock virtualBlock, VmaStatInfo *pStatInfo)
Calculates and returns statistics about virtual allocations and memory usage in given VmaVirtualBlock...
You can also request a full list of allocations and free regions as a string in JSON format by calling vmaBuildVirtualBlockStatsString(). Returned string must be later freed using vmaFreeVirtualBlockStatsString(). The format of this string differs from the one returned by the main Vulkan allocator, but it is similar.
diff --git a/docs/html/vk__mem__alloc_8h.html b/docs/html/vk__mem__alloc_8h.html
index 721309e..ee73e9c 100644
--- a/docs/html/vk__mem__alloc_8h.html
+++ b/docs/html/vk__mem__alloc_8h.html
@@ -157,6 +157,46 @@ Macros
|
+typedef enum VmaAllocatorCreateFlagBits | VmaAllocatorCreateFlagBits |
+ | Flags for created VmaAllocator. More...
|
+ |
+typedef VkFlags | VmaAllocatorCreateFlags |
+ |
+typedef enum VmaRecordFlagBits | VmaRecordFlagBits |
+ | Flags to be used in VmaRecordSettings::flags. More...
|
+ |
+typedef VkFlags | VmaRecordFlags |
+ |
+typedef enum VmaMemoryUsage | VmaMemoryUsage |
+ |
+typedef enum VmaAllocationCreateFlagBits | VmaAllocationCreateFlagBits |
+ | Flags to be passed as VmaAllocationCreateInfo::flags. More...
|
+ |
+typedef VkFlags | VmaAllocationCreateFlags |
+ |
+typedef enum VmaPoolCreateFlagBits | VmaPoolCreateFlagBits |
+ | Flags to be passed as VmaPoolCreateInfo::flags. More...
|
+ |
+typedef VkFlags | VmaPoolCreateFlags |
+ | Flags to be passed as VmaPoolCreateInfo::flags. See VmaPoolCreateFlagBits. More...
|
+ |
+typedef enum VmaDefragmentationFlagBits | VmaDefragmentationFlagBits |
+ | Flags to be used in vmaDefragmentationBegin(). None at the moment. Reserved for future use. More...
|
+ |
+typedef VkFlags | VmaDefragmentationFlags |
+ |
+typedef enum VmaVirtualBlockCreateFlagBits | VmaVirtualBlockCreateFlagBits |
+ | Flags to be passed as VmaVirtualBlockCreateInfo::flags. More...
|
+ |
+typedef VkFlags | VmaVirtualBlockCreateFlags |
+ | Flags to be passed as VmaVirtualBlockCreateInfo::flags. See VmaVirtualBlockCreateFlagBits. More...
|
+ |
+typedef enum VmaVirtualAllocationCreateFlagBits | VmaVirtualAllocationCreateFlagBits |
+ | Flags to be passed as VmaVirtualAllocationCreateInfo::flags. More...
|
+ |
+typedef VkFlags | VmaVirtualAllocationCreateFlags |
+ | Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See VmaVirtualAllocationCreateFlagBits. More...
|
+ |
typedef void(VKAPI_PTR * | PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData) |
| Callback function called after successful vkAllocateMemory. More...
|
|
@@ -166,19 +206,9 @@ Typedefs
typedef struct VmaDeviceMemoryCallbacks | VmaDeviceMemoryCallbacks |
| Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory . More...
|
|
-typedef enum VmaAllocatorCreateFlagBits | VmaAllocatorCreateFlagBits |
- | Flags for created VmaAllocator. More...
|
- |
-typedef VkFlags | VmaAllocatorCreateFlags |
- |
typedef struct VmaVulkanFunctions | VmaVulkanFunctions |
| Pointers to some Vulkan functions - a subset used by the library. More...
|
|
-typedef enum VmaRecordFlagBits | VmaRecordFlagBits |
- | Flags to be used in VmaRecordSettings::flags. More...
|
- |
-typedef VkFlags | VmaRecordFlags |
- |
typedef struct VmaRecordSettings | VmaRecordSettings |
| Parameters for recording calls to VMA functions. To be used in VmaAllocatorCreateInfo::pRecordSettings. More...
|
|
@@ -197,21 +227,8 @@ Typedefs
typedef struct VmaBudget | VmaBudget |
| Statistics of current memory usage and available budget, in bytes, for specific memory heap. More...
|
|
-typedef enum VmaMemoryUsage | VmaMemoryUsage |
- |
-typedef enum VmaAllocationCreateFlagBits | VmaAllocationCreateFlagBits |
- | Flags to be passed as VmaAllocationCreateInfo::flags. More...
|
- |
-typedef VkFlags | VmaAllocationCreateFlags |
- |
typedef struct VmaAllocationCreateInfo | VmaAllocationCreateInfo |
|
-typedef enum VmaPoolCreateFlagBits | VmaPoolCreateFlagBits |
- | Flags to be passed as VmaPoolCreateInfo::flags. More...
|
- |
-typedef VkFlags | VmaPoolCreateFlags |
- | Flags to be passed as VmaPoolCreateInfo::flags. See VmaPoolCreateFlagBits. More...
|
- |
typedef struct VmaPoolCreateInfo | VmaPoolCreateInfo |
| Describes parameter of created VmaPool. More...
|
|
@@ -221,11 +238,6 @@ Typedefs
typedef struct VmaAllocationInfo | VmaAllocationInfo |
| Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo(). More...
|
|
-typedef enum VmaDefragmentationFlagBits | VmaDefragmentationFlagBits |
- | Flags to be used in vmaDefragmentationBegin(). None at the moment. Reserved for future use. More...
|
- |
-typedef VkFlags | VmaDefragmentationFlags |
- |
typedef struct VmaDefragmentationInfo2 | VmaDefragmentationInfo2 |
| Parameters for defragmentation. More...
|
|
@@ -240,21 +252,9 @@ Typedefs
typedef struct VmaDefragmentationStats | VmaDefragmentationStats |
| Statistics returned by function vmaDefragment(). More...
|
|
-typedef enum VmaVirtualBlockCreateFlagBits | VmaVirtualBlockCreateFlagBits |
- | Flags to be passed as VmaVirtualBlockCreateInfo::flags. More...
|
- |
-typedef VkFlags | VmaVirtualBlockCreateFlags |
- | Flags to be passed as VmaVirtualBlockCreateInfo::flags. See VmaVirtualBlockCreateFlagBits. More...
|
- |
typedef struct VmaVirtualBlockCreateInfo | VmaVirtualBlockCreateInfo |
| Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock(). More...
|
|
-typedef enum VmaVirtualAllocationCreateFlagBits | VmaVirtualAllocationCreateFlagBits |
- | Flags to be passed as VmaVirtualAllocationCreateInfo::flags. More...
|
- |
-typedef VkFlags | VmaVirtualAllocationCreateFlags |
- | Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See VmaVirtualAllocationCreateFlagBits. More...
|
- |
typedef struct VmaVirtualAllocationCreateInfo | VmaVirtualAllocationCreateInfo |
| Parameters of created virtual allocation to be passed to vmaVirtualAllocate(). More...
|
|
@@ -386,11 +386,6 @@ Functions
void | vmaGetHeapBudgets (VmaAllocator allocator, VmaBudget *pBudgets) |
| Retrieves information about current memory budget for all memory heaps. More...
|
|
-void | vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap) |
- | Builds and returns statistics as a null-terminated string in JSON format. More...
|
- |
-void | vmaFreeStatsString (VmaAllocator allocator, char *pStatsString) |
- |
VkResult | vmaFindMemoryTypeIndex (VmaAllocator allocator, uint32_t memoryTypeBits, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex) |
| Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo. More...
|
|
@@ -513,8 +508,6 @@ Functions
void | vmaDestroyImage (VmaAllocator allocator, VkImage image, VmaAllocation allocation) |
| Destroys Vulkan image and frees allocated memory. More...
|
|
- | VK_DEFINE_HANDLE (VmaVirtualBlock) |
- |
VkResult | vmaCreateVirtualBlock (const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock) |
| Creates new VmaVirtualBlock object. More...
|
|
@@ -548,6 +541,11 @@ Functions
void | vmaFreeVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char *pStatsString) |
| Frees a string returned by vmaBuildVirtualBlockStatsString(). More...
|
|
+void | vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap) |
+ | Builds and returns statistics as a null-terminated string in JSON format. More...
|
+ |
+void | vmaFreeStatsString (VmaAllocator allocator, char *pStatsString) |
+ |
@@ -1517,7 +1515,7 @@ Functions
VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT | Allocation strategy that tries to minimize memory fragmentation.
|
VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK | A bit mask to extract only STRATEGY bits from entire set of flags.
-These stategy flags are binary compatible with equivalent flags in VmaAllocationCreateFlagBits.
+These strategy flags are binary compatible with equivalent flags in VmaAllocationCreateFlagBits.
|
VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM | |
@@ -1553,24 +1551,6 @@ Functions
-
-◆ VK_DEFINE_HANDLE()
-
-
◆ vmaAllocateMemory()
@@ -1791,7 +1771,7 @@ Functions
| allocator | Allocator object. |
| pVkMemoryRequirements | Memory requirements for each allocation. |
- | pCreateInfo | Creation parameters for each alloction. |
+ | pCreateInfo | Creation parameters for each allocation. |
| allocationCount | Number of allocations to make. |
[out] | pAllocations | Pointer to array that will be filled with handles to created allocations. |
[out] | pAllocationInfo | Optional. Pointer to array that will be filled with parameters of created allocations. |
diff --git a/docs/html/vk_khr_dedicated_allocation.html b/docs/html/vk_khr_dedicated_allocation.html
index 9c1710d..3cc80ba 100644
--- a/docs/html/vk_khr_dedicated_allocation.html
+++ b/docs/html/vk_khr_dedicated_allocation.html
@@ -82,7 +82,7 @@ $(function() {
VkResult vmaCreateAllocator(const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator)
Creates Allocator object.
-@ VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT
Enables usage of VK_KHR_dedicated_allocation extension.
Definition: vk_mem_alloc.h:362
+@ VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT
Enables usage of VK_KHR_dedicated_allocation extension.
Definition: vk_mem_alloc.h:336
That is all. The extension will be automatically used whenever you create a buffer using vmaCreateBuffer() or image using vmaCreateImage().
When using the extension together with Vulkan Validation Layer, you will receive warnings like this:
vkBindBufferMemory(): Binding memory to buffer 0x33 but vkGetBufferMemoryRequirements() has not been called on that buffer.
It is OK, you should just ignore it. It happens because you use function vkGetBufferMemoryRequirements2KHR()
instead of standard vkGetBufferMemoryRequirements()
, while the validation layer seems to be unaware of it.
diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h
index 654cac6..6b743d4 100644
--- a/include/vk_mem_alloc.h
+++ b/include/vk_mem_alloc.h
@@ -286,50 +286,24 @@ available through VmaAllocatorCreateInfo::pRecordSettings.
#endif
#endif
-/** \struct VmaAllocator
-\brief Represents main object of this library initialized.
+#ifndef VMA_STATS_STRING_ENABLED
+ #define VMA_STATS_STRING_ENABLED 1
+#endif
-Fill structure #VmaAllocatorCreateInfo and call function vmaCreateAllocator() to create it.
-Call function vmaDestroyAllocator() to destroy it.
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+//
+// INTERFACE
+//
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
-It is recommended to create just one object of this type per `VkDevice` object,
-right after Vulkan is initialized and keep it alive until before Vulkan device is destroyed.
-*/
-VK_DEFINE_HANDLE(VmaAllocator)
-
-/// Callback function called after successful vkAllocateMemory.
-typedef void (VKAPI_PTR *PFN_vmaAllocateDeviceMemoryFunction)(
- VmaAllocator VMA_NOT_NULL allocator,
- uint32_t memoryType,
- VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory,
- VkDeviceSize size,
- void* VMA_NULLABLE pUserData);
-/// Callback function called before vkFreeMemory.
-typedef void (VKAPI_PTR *PFN_vmaFreeDeviceMemoryFunction)(
- VmaAllocator VMA_NOT_NULL allocator,
- uint32_t memoryType,
- VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory,
- VkDeviceSize size,
- void* VMA_NULLABLE pUserData);
-
-/** \brief Set of callbacks that the library will call for `vkAllocateMemory` and `vkFreeMemory`.
-
-Provided for informative purpose, e.g. to gather statistics about number of
-allocations or total amount of memory allocated in Vulkan.
-
-Used in VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.
-*/
-typedef struct VmaDeviceMemoryCallbacks {
- /// Optional, can be null.
- PFN_vmaAllocateDeviceMemoryFunction VMA_NULLABLE pfnAllocate;
- /// Optional, can be null.
- PFN_vmaFreeDeviceMemoryFunction VMA_NULLABLE pfnFree;
- /// Optional, can be null.
- void* VMA_NULLABLE pUserData;
-} VmaDeviceMemoryCallbacks;
+// Sections for managing code placement in file, only for development purposes e.g. for convenient folding inside an IDE.
+#ifndef _VMA_ENUM_DECLARATIONS
/// Flags for created #VmaAllocator.
-typedef enum VmaAllocatorCreateFlagBits {
+typedef enum VmaAllocatorCreateFlagBits
+{
/** \brief Allocator and all objects created from it will not be synchronized internally, so you must guarantee they are used from only one thread at a time or synchronized externally by you.
Using this flag may increase performance because internal mutexes are not used.
@@ -445,11 +419,445 @@ typedef enum VmaAllocatorCreateFlagBits {
} VmaAllocatorCreateFlagBits;
typedef VkFlags VmaAllocatorCreateFlags;
+/// Flags to be used in VmaRecordSettings::flags.
+typedef enum VmaRecordFlagBits
+{
+ /** \brief Enables flush after recording every function call.
+
+ Enable it if you expect your application to crash, which may leave recording file truncated.
+ It may degrade performance though.
+ */
+ VMA_RECORD_FLUSH_AFTER_CALL_BIT = 0x00000001,
+
+ VMA_RECORD_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaRecordFlagBits;
+typedef VkFlags VmaRecordFlags;
+
+typedef enum VmaMemoryUsage
+{
+ /** No intended memory usage specified.
+ Use other members of VmaAllocationCreateInfo to specify your requirements.
+ */
+ VMA_MEMORY_USAGE_UNKNOWN = 0,
+ /** Memory will be used on device only, so fast access from the device is preferred.
+ It usually means device-local GPU (video) memory.
+ No need to be mappable on host.
+ It is roughly equivalent of `D3D12_HEAP_TYPE_DEFAULT`.
+
+ Usage:
+
+ - Resources written and read by device, e.g. images used as attachments.
+ - Resources transferred from host once (immutable) or infrequently and read by
+ device multiple times, e.g. textures to be sampled, vertex buffers, uniform
+ (constant) buffers, and majority of other types of resources used on GPU.
+
+ Allocation may still end up in `HOST_VISIBLE` memory on some implementations.
+ In such case, you are free to map it.
+ You can use #VMA_ALLOCATION_CREATE_MAPPED_BIT with this usage type.
+ */
+ VMA_MEMORY_USAGE_GPU_ONLY = 1,
+ /** Memory will be mappable on host.
+ It usually means CPU (system) memory.
+ Guarantees to be `HOST_VISIBLE` and `HOST_COHERENT`.
+ CPU access is typically uncached. Writes may be write-combined.
+ Resources created in this pool may still be accessible to the device, but access to them can be slow.
+ It is roughly equivalent of `D3D12_HEAP_TYPE_UPLOAD`.
+
+ Usage: Staging copy of resources used as transfer source.
+ */
+ VMA_MEMORY_USAGE_CPU_ONLY = 2,
+ /**
+ Memory that is both mappable on host (guarantees to be `HOST_VISIBLE`) and preferably fast to access by GPU.
+ CPU access is typically uncached. Writes may be write-combined.
+
+ Usage: Resources written frequently by host (dynamic), read by device. E.g. textures (with LINEAR layout), vertex buffers, uniform buffers updated every frame or every draw call.
+ */
+ VMA_MEMORY_USAGE_CPU_TO_GPU = 3,
+ /** Memory mappable on host (guarantees to be `HOST_VISIBLE`) and cached.
+ It is roughly equivalent of `D3D12_HEAP_TYPE_READBACK`.
+
+ Usage:
+
+ - Resources written by device, read by host - results of some computations, e.g. screen capture, average scene luminance for HDR tone mapping.
+ - Any resources read or accessed randomly on host, e.g. CPU-side copy of vertex buffer used as source of transfer, but also used for collision detection.
+ */
+ VMA_MEMORY_USAGE_GPU_TO_CPU = 4,
+ /** CPU memory - memory that is preferably not `DEVICE_LOCAL`, but also not guaranteed to be `HOST_VISIBLE`.
+
+ Usage: Staging copy of resources moved from GPU memory to CPU memory as part
+ of custom paging/residency mechanism, to be moved back to GPU memory when needed.
+ */
+ VMA_MEMORY_USAGE_CPU_COPY = 5,
+ /** 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`.
+
+ Allocations with this usage are always created as dedicated - it implies #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
+ */
+ VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED = 6,
+
+ VMA_MEMORY_USAGE_MAX_ENUM = 0x7FFFFFFF
+} VmaMemoryUsage;
+
+/// Flags to be passed as VmaAllocationCreateInfo::flags.
+typedef enum VmaAllocationCreateFlagBits
+{
+ /** \brief Set this flag if the allocation should have its own memory block.
+
+ Use it for special, big resources, like fullscreen images used as attachments.
+
+ You should not use this flag if VmaAllocationCreateInfo::pool is not null.
+ */
+ VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 0x00000001,
+
+ /** \brief Set this flag to only try to allocate from existing `VkDeviceMemory` blocks and never create new such block.
+
+ If new allocation cannot be placed in any of the existing blocks, allocation
+ fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY` error.
+
+ You should not use #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT and
+ #VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT at the same time. It makes no sense.
+
+ If VmaAllocationCreateInfo::pool is not null, this flag is implied and ignored. */
+ VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 0x00000002,
+ /** \brief Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
+
+ Pointer to mapped memory will be returned through VmaAllocationInfo::pMappedData.
+
+ 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).
+
+ You should not use this flag together with #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT.
+ */
+ VMA_ALLOCATION_CREATE_MAPPED_BIT = 0x00000004,
+ /** Allocation created with this flag can become lost as a result of another
+ allocation with #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag, so you
+ must check it before use.
+
+ To check if allocation is not lost, call vmaGetAllocationInfo() and check if
+ VmaAllocationInfo::deviceMemory is not `VK_NULL_HANDLE`.
+
+ For details about supporting lost allocations, see Lost Allocations
+ chapter of User Guide on Main Page.
+
+ You should not use this flag together with #VMA_ALLOCATION_CREATE_MAPPED_BIT.
+ */
+ VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT = 0x00000008,
+ /** While creating allocation using this flag, other allocations that were
+ created with flag #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT can become lost.
+
+ For details about supporting lost allocations, see Lost Allocations
+ chapter of User Guide on Main Page.
+ */
+ VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT = 0x00000010,
+ /** 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 `pUserData`. The string is automatically
+ freed together with the allocation. It is also used in vmaBuildStatsString().
+ */
+ VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT = 0x00000020,
+ /** Allocation will be created from upper stack in a double stack pool.
+
+ This flag is only allowed for custom pools created with #VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT flag.
+ */
+ VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = 0x00000040,
+ /** Create both buffer/image and allocation, but don't bind them together.
+ It is useful when you want to bind yourself to do some more advanced binding, e.g. using some extensions.
+ The flag is meaningful only with functions that bind by default: vmaCreateBuffer(), vmaCreateImage().
+ Otherwise it is ignored.
+ */
+ VMA_ALLOCATION_CREATE_DONT_BIND_BIT = 0x00000080,
+ /** Create allocation only if additional device memory required for it, if any, won't exceed
+ memory budget. Otherwise return `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
+ */
+ VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT = 0x00000100,
+ /** \brief Set this flag if the allocated memory will have aliasing resources.
+ *
+ Usage of this flag prevents supplying `VkMemoryDedicatedAllocateInfoKHR` when VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is specified.
+ Otherwise created dedicated memory will not be suitable for aliasing resources, resulting in Vulkan Validation Layer errors.
+ */
+ VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT = 0x00000200,
+
+ /** Allocation strategy that chooses smallest possible free range for the
+ allocation.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT = 0x00010000,
+ /** Allocation strategy that chooses biggest possible free range for the
+ allocation.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT = 0x00020000,
+ /** Allocation strategy that chooses first suitable free range for the
+ allocation.
+
+ "First" doesn't necessarily means the one with smallest offset in memory,
+ but rather the one that is easiest and fastest to find.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT = 0x00040000,
+
+ /** Allocation strategy that tries to minimize memory usage.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT,
+ /** Allocation strategy that tries to minimize allocation time.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT,
+ /** Allocation strategy that tries to minimize memory fragmentation.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT = VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT,
+
+ /** A bit mask to extract only `STRATEGY` bits from entire set of flags.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_MASK =
+ VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT |
+ VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT |
+ VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT,
+
+ VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaAllocationCreateFlagBits;
+typedef VkFlags VmaAllocationCreateFlags;
+
+/// Flags to be passed as VmaPoolCreateInfo::flags.
+typedef enum VmaPoolCreateFlagBits
+{
+ /** \brief Use this flag if you always allocate only buffers and linear images or only optimal images out of this pool and so Buffer-Image Granularity can be ignored.
+
+ This is an optional optimization flag.
+
+ If you always allocate using vmaCreateBuffer(), vmaCreateImage(),
+ vmaAllocateMemoryForBuffer(), then you don't need to use it because allocator
+ knows exact type of your allocations so it can handle Buffer-Image Granularity
+ in the optimal way.
+
+ If you also allocate using vmaAllocateMemoryForImage() or vmaAllocateMemory(),
+ exact type of such allocations is not known, so allocator must be conservative
+ in handling Buffer-Image Granularity, which can lead to suboptimal allocation
+ (wasted memory). In that case, if you can make sure you always allocate only
+ buffers and linear images or only optimal images out of this pool, use this flag
+ to make allocator disregard Buffer-Image Granularity and so make allocations
+ faster and more optimal.
+ */
+ VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 0x00000002,
+
+ /** \brief 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 \ref linear_algorithm.
+
+ When using this flag, you must specify VmaPoolCreateInfo::maxBlockCount == 1 (or 0 for default).
+ */
+ VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT = 0x00000004,
+
+ /** \brief Enables alternative, buddy allocation algorithm in this pool.
+
+ It operates on a tree of blocks, each having size that is a power of two and
+ a half of its parent's size. Comparing to default algorithm, this one provides
+ faster allocation and deallocation and decreased external fragmentation,
+ at the expense of more memory wasted (internal fragmentation).
+ For details, see documentation chapter \ref buddy_algorithm.
+ */
+ VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT = 0x00000008,
+
+ /** Bit mask to extract only `ALGORITHM` bits from entire set of flags.
+ */
+ VMA_POOL_CREATE_ALGORITHM_MASK =
+ VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT |
+ VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT,
+
+ VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaPoolCreateFlagBits;
+/// Flags to be passed as VmaPoolCreateInfo::flags. See #VmaPoolCreateFlagBits.
+typedef VkFlags VmaPoolCreateFlags;
+
+/// Flags to be used in vmaDefragmentationBegin(). None at the moment. Reserved for future use.
+typedef enum VmaDefragmentationFlagBits
+{
+ VMA_DEFRAGMENTATION_FLAG_INCREMENTAL = 0x1,
+ VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaDefragmentationFlagBits;
+typedef VkFlags VmaDefragmentationFlags;
+
+/// Flags to be passed as VmaVirtualBlockCreateInfo::flags.
+typedef enum VmaVirtualBlockCreateFlagBits
+{
+ /** \brief 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 \ref linear_algorithm.
+ */
+ VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = 0x00000001,
+
+ /** \brief Enables alternative, buddy allocation algorithm in this virtual block.
+
+ It operates on a tree of blocks, each having size that is a power of two and
+ a half of its parent's size. Comparing to default algorithm, this one provides
+ faster allocation and deallocation and decreased external fragmentation,
+ at the expense of more memory wasted (internal fragmentation).
+ For details, see documentation chapter \ref buddy_algorithm.
+ */
+ VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT = 0x00000002,
+
+ /** \brief Bit mask to extract only `ALGORITHM` bits from entire set of flags.
+ */
+ VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK =
+ VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT |
+ VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT,
+
+ VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaVirtualBlockCreateFlagBits;
+/// Flags to be passed as VmaVirtualBlockCreateInfo::flags. See #VmaVirtualBlockCreateFlagBits.
+typedef VkFlags VmaVirtualBlockCreateFlags;
+
+/// Flags to be passed as VmaVirtualAllocationCreateInfo::flags.
+typedef enum VmaVirtualAllocationCreateFlagBits
+{
+ /** \brief Allocation will be created from upper stack in a double stack pool.
+
+ This flag is only allowed for virtual blocks created with #VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT flag.
+ */
+ VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT,
+ /** \brief Allocation strategy that tries to minimize memory usage.
+ */
+ VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT,
+ /** \brief Allocation strategy that tries to minimize allocation time.
+ */
+ VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT,
+ /** \brief Allocation strategy that tries to minimize memory fragmentation.
+ */
+ VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT,
+ /** \brief A bit mask to extract only `STRATEGY` bits from entire set of flags.
+
+ These strategy flags are binary compatible with equivalent flags in #VmaAllocationCreateFlagBits.
+ */
+ VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK = VMA_ALLOCATION_CREATE_STRATEGY_MASK,
+
+ VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaVirtualAllocationCreateFlagBits;
+/// Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See #VmaVirtualAllocationCreateFlagBits.
+typedef VkFlags VmaVirtualAllocationCreateFlags;
+
+#endif // _VMA_ENUM_DECLARATIONS
+
+#ifndef _VMA_DATA_TYPES_DECLARATIONS
+
+/** \struct VmaAllocator
+\brief Represents main object of this library initialized.
+
+Fill structure #VmaAllocatorCreateInfo and call function vmaCreateAllocator() to create it.
+Call function vmaDestroyAllocator() to destroy it.
+
+It is recommended to create just one object of this type per `VkDevice` object,
+right after Vulkan is initialized and keep it alive until before Vulkan device is destroyed.
+*/
+VK_DEFINE_HANDLE(VmaAllocator)
+
+/** \struct VmaPool
+\brief 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](@ref choosing_memory_type_custom_memory_pools).
+*/
+VK_DEFINE_HANDLE(VmaPool)
+
+/** \struct VmaAllocation
+\brief 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](@ref 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.
+
+Some kinds allocations can be in lost state.
+For more information, see [Lost allocations](@ref lost_allocations).
+*/
+VK_DEFINE_HANDLE(VmaAllocation)
+
+/** \struct VmaDefragmentationContext
+\brief Represents Opaque object that represents started defragmentation process.
+
+Fill structure #VmaDefragmentationInfo2 and call function vmaDefragmentationBegin() to create it.
+Call function vmaDefragmentationEnd() to destroy it.
+*/
+VK_DEFINE_HANDLE(VmaDefragmentationContext)
+
+/** \struct VmaVirtualBlock
+\brief 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 \ref virtual_allocator.
+
+This object is not thread-safe - should not be used from multiple threads simultaneously, must be synchronized externally.
+*/
+VK_DEFINE_HANDLE(VmaVirtualBlock)
+
+/// Callback function called after successful vkAllocateMemory.
+typedef void (VKAPI_PTR* PFN_vmaAllocateDeviceMemoryFunction)(
+ VmaAllocator VMA_NOT_NULL allocator,
+ uint32_t memoryType,
+ VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory,
+ VkDeviceSize size,
+ void* VMA_NULLABLE pUserData);
+
+/// Callback function called before vkFreeMemory.
+typedef void (VKAPI_PTR* PFN_vmaFreeDeviceMemoryFunction)(
+ VmaAllocator VMA_NOT_NULL allocator,
+ uint32_t memoryType,
+ VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory,
+ VkDeviceSize size,
+ void* VMA_NULLABLE pUserData);
+
+/** \brief Set of callbacks that the library will call for `vkAllocateMemory` and `vkFreeMemory`.
+
+Provided for informative purpose, e.g. to gather statistics about number of
+allocations or total amount of memory allocated in Vulkan.
+
+Used in VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.
+*/
+typedef struct VmaDeviceMemoryCallbacks
+{
+ /// Optional, can be null.
+ PFN_vmaAllocateDeviceMemoryFunction VMA_NULLABLE pfnAllocate;
+ /// Optional, can be null.
+ PFN_vmaFreeDeviceMemoryFunction VMA_NULLABLE pfnFree;
+ /// Optional, can be null.
+ void* VMA_NULLABLE pUserData;
+} VmaDeviceMemoryCallbacks;
+
/** \brief Pointers to some Vulkan functions - a subset used by the library.
Used in VmaAllocatorCreateInfo::pVulkanFunctions.
*/
-typedef struct VmaVulkanFunctions {
+typedef struct VmaVulkanFunctions
+{
/// Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS.
PFN_vkGetInstanceProcAddr VMA_NULLABLE vkGetInstanceProcAddr;
/// Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS.
@@ -488,19 +896,6 @@ typedef struct VmaVulkanFunctions {
#endif
} VmaVulkanFunctions;
-/// Flags to be used in VmaRecordSettings::flags.
-typedef enum VmaRecordFlagBits {
- /** \brief Enables flush after recording every function call.
-
- Enable it if you expect your application to crash, which may leave recording file truncated.
- It may degrade performance though.
- */
- VMA_RECORD_FLUSH_AFTER_CALL_BIT = 0x00000001,
-
- VMA_RECORD_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
-} VmaRecordFlagBits;
-typedef VkFlags VmaRecordFlags;
-
/// Parameters for recording calls to VMA functions. To be used in VmaAllocatorCreateInfo::pRecordSettings.
typedef struct VmaRecordSettings
{
@@ -616,17 +1011,7 @@ typedef struct VmaAllocatorCreateInfo
#endif // #if VMA_EXTERNAL_MEMORY
} VmaAllocatorCreateInfo;
-/// Creates Allocator object.
-VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAllocator(
- const VmaAllocatorCreateInfo* VMA_NOT_NULL pCreateInfo,
- VmaAllocator VMA_NULLABLE * VMA_NOT_NULL pAllocator);
-
-/// Destroys allocator object.
-VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(
- VmaAllocator VMA_NULLABLE allocator);
-
-/** \brief Information about existing #VmaAllocator object.
-*/
+/// Information about existing #VmaAllocator object.
typedef struct VmaAllocatorInfo
{
/** \brief Handle to Vulkan instance object.
@@ -646,54 +1031,7 @@ typedef struct VmaAllocatorInfo
VkDevice VMA_NOT_NULL device;
} VmaAllocatorInfo;
-/** \brief Returns information about existing #VmaAllocator object - handle to Vulkan device etc.
-
-It might be useful if you want to keep just the #VmaAllocator handle and fetch other required handles to
-`VkPhysicalDevice`, `VkDevice` etc. every time using this function.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocatorInfo(VmaAllocator VMA_NOT_NULL allocator, VmaAllocatorInfo* VMA_NOT_NULL pAllocatorInfo);
-
-/**
-PhysicalDeviceProperties are fetched from physicalDevice by the allocator.
-You can access it here, without fetching it again on your own.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaGetPhysicalDeviceProperties(
- VmaAllocator VMA_NOT_NULL allocator,
- const VkPhysicalDeviceProperties* VMA_NULLABLE * VMA_NOT_NULL ppPhysicalDeviceProperties);
-
-/**
-PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator.
-You can access it here, without fetching it again on your own.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryProperties(
- VmaAllocator VMA_NOT_NULL allocator,
- const VkPhysicalDeviceMemoryProperties* VMA_NULLABLE * VMA_NOT_NULL ppPhysicalDeviceMemoryProperties);
-
-/**
-\brief Given Memory Type Index, returns Property Flags of this memory type.
-
-This is just a convenience function. Same information can be obtained using
-vmaGetMemoryProperties().
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryTypeProperties(
- VmaAllocator VMA_NOT_NULL allocator,
- uint32_t memoryTypeIndex,
- VkMemoryPropertyFlags* VMA_NOT_NULL pFlags);
-
-/** \brief Sets index of the current frame.
-
-This function must be used if you make allocations with
-#VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT and
-#VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flags to inform the allocator
-when a new frame begins. Allocations queried using vmaGetAllocationInfo() cannot
-become lost in the current frame.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaSetCurrentFrameIndex(
- VmaAllocator VMA_NOT_NULL allocator,
- uint32_t frameIndex);
-
-/** \brief Calculated statistics of memory usage in entire allocator.
-*/
+/// Calculated statistics of memory usage in entire allocator.
typedef struct VmaStatInfo
{
/// Number of `VkDeviceMemory` Vulkan memory blocks allocated.
@@ -718,21 +1056,7 @@ typedef struct VmaStats
VmaStatInfo total;
} VmaStats;
-/** \brief Retrieves statistics from current state of the Allocator.
-
-This function is called "calculate" not "get" because it has to traverse all
-internal data structures, so it may be quite slow. For faster but more brief statistics
-suitable to be called every frame or every allocation, use vmaGetHeapBudgets().
-
-Note that when using allocator from multiple threads, returned information may immediately
-become outdated.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStats(
- VmaAllocator VMA_NOT_NULL allocator,
- VmaStats* VMA_NOT_NULL pStats);
-
-/** \brief Statistics of current memory usage and available budget, in bytes, for specific memory heap.
-*/
+/// Statistics of current memory usage and available budget, in bytes, for specific memory heap.
typedef struct VmaBudget
{
/** \brief Sum size of all `VkDeviceMemory` blocks allocated from particular heap, in bytes.
@@ -772,239 +1096,6 @@ typedef struct VmaBudget
VkDeviceSize budget;
} VmaBudget;
-/** \brief Retrieves information about current memory budget for all memory heaps.
-
-\param allocator
-\param[out] pBudgets Must point to array with number of elements at least equal to number of memory heaps in physical device used.
-
-This function is called "get" not "calculate" because it is very fast, suitable to be called
-every frame or every allocation. For more detailed statistics use vmaCalculateStats().
-
-Note that when using allocator from multiple threads, returned information may immediately
-become outdated.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaGetHeapBudgets(
- VmaAllocator VMA_NOT_NULL allocator,
- VmaBudget* VMA_NOT_NULL pBudgets);
-
-#ifndef VMA_STATS_STRING_ENABLED
-#define VMA_STATS_STRING_ENABLED 1
-#endif
-
-#if VMA_STATS_STRING_ENABLED
-
-/// Builds and returns statistics as a null-terminated string in JSON format.
-/**
-@param allocator
-@param[out] ppStatsString Must be freed using vmaFreeStatsString() function.
-@param detailedMap
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
- VmaAllocator VMA_NOT_NULL allocator,
- char* VMA_NULLABLE * VMA_NOT_NULL ppStatsString,
- VkBool32 detailedMap);
-
-VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
- VmaAllocator VMA_NOT_NULL allocator,
- char* VMA_NULLABLE pStatsString);
-
-#endif // #if VMA_STATS_STRING_ENABLED
-
-/** \struct VmaPool
-\brief 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](@ref choosing_memory_type_custom_memory_pools).
-*/
-VK_DEFINE_HANDLE(VmaPool)
-
-typedef enum VmaMemoryUsage
-{
- /** No intended memory usage specified.
- Use other members of VmaAllocationCreateInfo to specify your requirements.
- */
- VMA_MEMORY_USAGE_UNKNOWN = 0,
- /** Memory will be used on device only, so fast access from the device is preferred.
- It usually means device-local GPU (video) memory.
- No need to be mappable on host.
- It is roughly equivalent of `D3D12_HEAP_TYPE_DEFAULT`.
-
- Usage:
-
- - Resources written and read by device, e.g. images used as attachments.
- - Resources transferred from host once (immutable) or infrequently and read by
- device multiple times, e.g. textures to be sampled, vertex buffers, uniform
- (constant) buffers, and majority of other types of resources used on GPU.
-
- Allocation may still end up in `HOST_VISIBLE` memory on some implementations.
- In such case, you are free to map it.
- You can use #VMA_ALLOCATION_CREATE_MAPPED_BIT with this usage type.
- */
- VMA_MEMORY_USAGE_GPU_ONLY = 1,
- /** Memory will be mappable on host.
- It usually means CPU (system) memory.
- Guarantees to be `HOST_VISIBLE` and `HOST_COHERENT`.
- CPU access is typically uncached. Writes may be write-combined.
- Resources created in this pool may still be accessible to the device, but access to them can be slow.
- It is roughly equivalent of `D3D12_HEAP_TYPE_UPLOAD`.
-
- Usage: Staging copy of resources used as transfer source.
- */
- VMA_MEMORY_USAGE_CPU_ONLY = 2,
- /**
- Memory that is both mappable on host (guarantees to be `HOST_VISIBLE`) and preferably fast to access by GPU.
- CPU access is typically uncached. Writes may be write-combined.
-
- Usage: Resources written frequently by host (dynamic), read by device. E.g. textures (with LINEAR layout), vertex buffers, uniform buffers updated every frame or every draw call.
- */
- VMA_MEMORY_USAGE_CPU_TO_GPU = 3,
- /** Memory mappable on host (guarantees to be `HOST_VISIBLE`) and cached.
- It is roughly equivalent of `D3D12_HEAP_TYPE_READBACK`.
-
- Usage:
-
- - Resources written by device, read by host - results of some computations, e.g. screen capture, average scene luminance for HDR tone mapping.
- - Any resources read or accessed randomly on host, e.g. CPU-side copy of vertex buffer used as source of transfer, but also used for collision detection.
- */
- VMA_MEMORY_USAGE_GPU_TO_CPU = 4,
- /** CPU memory - memory that is preferably not `DEVICE_LOCAL`, but also not guaranteed to be `HOST_VISIBLE`.
-
- Usage: Staging copy of resources moved from GPU memory to CPU memory as part
- of custom paging/residency mechanism, to be moved back to GPU memory when needed.
- */
- VMA_MEMORY_USAGE_CPU_COPY = 5,
- /** 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`.
-
- Allocations with this usage are always created as dedicated - it implies #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
- */
- VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED = 6,
-
- VMA_MEMORY_USAGE_MAX_ENUM = 0x7FFFFFFF
-} VmaMemoryUsage;
-
-/// Flags to be passed as VmaAllocationCreateInfo::flags.
-typedef enum VmaAllocationCreateFlagBits {
- /** \brief Set this flag if the allocation should have its own memory block.
-
- Use it for special, big resources, like fullscreen images used as attachments.
-
- You should not use this flag if VmaAllocationCreateInfo::pool is not null.
- */
- VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 0x00000001,
-
- /** \brief Set this flag to only try to allocate from existing `VkDeviceMemory` blocks and never create new such block.
-
- If new allocation cannot be placed in any of the existing blocks, allocation
- fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY` error.
-
- You should not use #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT and
- #VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT at the same time. It makes no sense.
-
- If VmaAllocationCreateInfo::pool is not null, this flag is implied and ignored. */
- VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 0x00000002,
- /** \brief Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
-
- Pointer to mapped memory will be returned through VmaAllocationInfo::pMappedData.
-
- 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).
-
- You should not use this flag together with #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT.
- */
- VMA_ALLOCATION_CREATE_MAPPED_BIT = 0x00000004,
- /** Allocation created with this flag can become lost as a result of another
- allocation with #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag, so you
- must check it before use.
-
- To check if allocation is not lost, call vmaGetAllocationInfo() and check if
- VmaAllocationInfo::deviceMemory is not `VK_NULL_HANDLE`.
-
- For details about supporting lost allocations, see Lost Allocations
- chapter of User Guide on Main Page.
-
- You should not use this flag together with #VMA_ALLOCATION_CREATE_MAPPED_BIT.
- */
- VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT = 0x00000008,
- /** While creating allocation using this flag, other allocations that were
- created with flag #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT can become lost.
-
- For details about supporting lost allocations, see Lost Allocations
- chapter of User Guide on Main Page.
- */
- VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT = 0x00000010,
- /** 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 `pUserData`. The string is automatically
- freed together with the allocation. It is also used in vmaBuildStatsString().
- */
- VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT = 0x00000020,
- /** Allocation will be created from upper stack in a double stack pool.
-
- This flag is only allowed for custom pools created with #VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT flag.
- */
- VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = 0x00000040,
- /** Create both buffer/image and allocation, but don't bind them together.
- It is useful when you want to bind yourself to do some more advanced binding, e.g. using some extensions.
- The flag is meaningful only with functions that bind by default: vmaCreateBuffer(), vmaCreateImage().
- Otherwise it is ignored.
- */
- VMA_ALLOCATION_CREATE_DONT_BIND_BIT = 0x00000080,
- /** Create allocation only if additional device memory required for it, if any, won't exceed
- memory budget. Otherwise return `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
- */
- VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT = 0x00000100,
- /** \brief Set this flag if the allocated memory will have aliasing resources.
- *
- Usage of this flag prevents supplying `VkMemoryDedicatedAllocateInfoKHR` when VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is specified.
- Otherwise created dedicated memory will not be suitable for aliasing resources, resulting in Vulkan Validation Layer errors.
- */
- VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT = 0x00000200,
-
- /** Allocation strategy that chooses smallest possible free range for the
- allocation.
- */
- VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT = 0x00010000,
- /** Allocation strategy that chooses biggest possible free range for the
- allocation.
- */
- VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT = 0x00020000,
- /** Allocation strategy that chooses first suitable free range for the
- allocation.
-
- "First" doesn't necessarily means the one with smallest offset in memory,
- but rather the one that is easiest and fastest to find.
- */
- VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT = 0x00040000,
-
- /** Allocation strategy that tries to minimize memory usage.
- */
- VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT,
- /** Allocation strategy that tries to minimize allocation time.
- */
- VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT,
- /** Allocation strategy that tries to minimize memory fragmentation.
- */
- VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT = VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT,
-
- /** A bit mask to extract only `STRATEGY` bits from entire set of flags.
- */
- VMA_ALLOCATION_CREATE_STRATEGY_MASK =
- VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT |
- VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT |
- VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT,
-
- VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
-} VmaAllocationCreateFlagBits;
-typedef VkFlags VmaAllocationCreateFlags;
-
typedef struct VmaAllocationCreateInfo
{
/// Use #VmaAllocationCreateFlagBits enum.
@@ -1055,124 +1146,9 @@ typedef struct VmaAllocationCreateInfo
float priority;
} VmaAllocationCreateInfo;
-/**
-\brief Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.
-
-This algorithm tries to find a memory type that:
-
-- Is allowed by memoryTypeBits.
-- Contains all the flags from pAllocationCreateInfo->requiredFlags.
-- Matches intended usage.
-- Has as many flags from pAllocationCreateInfo->preferredFlags as possible.
-
-\return Returns VK_ERROR_FEATURE_NOT_PRESENT if not found. Receiving such result
-from this function or any other allocating function probably means that your
-device doesn't support any memory type with requested features for the specific
-type of resource you want to use it for. Please check parameters of your
-resource, like image layout (OPTIMAL versus LINEAR) or mip level count.
-*/
-VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndex(
- VmaAllocator VMA_NOT_NULL allocator,
- uint32_t memoryTypeBits,
- const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
- uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
-
-/**
-\brief Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
-
-It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex.
-It internally creates a temporary, dummy buffer that never has memory bound.
-It is just a convenience function, equivalent to calling:
-
-- `vkCreateBuffer`
-- `vkGetBufferMemoryRequirements`
-- `vmaFindMemoryTypeIndex`
-- `vkDestroyBuffer`
-*/
-VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo(
- VmaAllocator VMA_NOT_NULL allocator,
- const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
- const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
- uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
-
-/**
-\brief Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
-
-It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex.
-It internally creates a temporary, dummy image that never has memory bound.
-It is just a convenience function, equivalent to calling:
-
-- `vkCreateImage`
-- `vkGetImageMemoryRequirements`
-- `vmaFindMemoryTypeIndex`
-- `vkDestroyImage`
-*/
-VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo(
- VmaAllocator VMA_NOT_NULL allocator,
- const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
- const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
- uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
-
-/// Flags to be passed as VmaPoolCreateInfo::flags.
-typedef enum VmaPoolCreateFlagBits {
- /** \brief Use this flag if you always allocate only buffers and linear images or only optimal images out of this pool and so Buffer-Image Granularity can be ignored.
-
- This is an optional optimization flag.
-
- If you always allocate using vmaCreateBuffer(), vmaCreateImage(),
- vmaAllocateMemoryForBuffer(), then you don't need to use it because allocator
- knows exact type of your allocations so it can handle Buffer-Image Granularity
- in the optimal way.
-
- If you also allocate using vmaAllocateMemoryForImage() or vmaAllocateMemory(),
- exact type of such allocations is not known, so allocator must be conservative
- in handling Buffer-Image Granularity, which can lead to suboptimal allocation
- (wasted memory). In that case, if you can make sure you always allocate only
- buffers and linear images or only optimal images out of this pool, use this flag
- to make allocator disregard Buffer-Image Granularity and so make allocations
- faster and more optimal.
- */
- VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 0x00000002,
-
- /** \brief 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 \ref linear_algorithm.
-
- When using this flag, you must specify VmaPoolCreateInfo::maxBlockCount == 1 (or 0 for default).
- */
- VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT = 0x00000004,
-
- /** \brief Enables alternative, buddy allocation algorithm in this pool.
-
- It operates on a tree of blocks, each having size that is a power of two and
- a half of its parent's size. Comparing to default algorithm, this one provides
- faster allocation and deallocation and decreased external fragmentation,
- at the expense of more memory wasted (internal fragmentation).
- For details, see documentation chapter \ref buddy_algorithm.
- */
- VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT = 0x00000008,
-
- /** Bit mask to extract only `ALGORITHM` bits from entire set of flags.
- */
- VMA_POOL_CREATE_ALGORITHM_MASK =
- VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT |
- VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT,
-
- VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
-} VmaPoolCreateFlagBits;
-/// Flags to be passed as VmaPoolCreateInfo::flags. See #VmaPoolCreateFlagBits.
-typedef VkFlags VmaPoolCreateFlags;
-
-/** \brief Describes parameter of created #VmaPool.
-*/
-typedef struct VmaPoolCreateInfo {
+/// Describes parameter of created #VmaPool.
+typedef struct VmaPoolCreateInfo
+{
/** \brief Vulkan memory type index to allocate this pool from.
*/
uint32_t memoryTypeIndex;
@@ -1240,9 +1216,9 @@ typedef struct VmaPoolCreateInfo {
void* VMA_NULLABLE pMemoryAllocateNext;
} VmaPoolCreateInfo;
-/** \brief Describes parameter of existing #VmaPool.
-*/
-typedef struct VmaPoolStats {
+/// Describes parameter of existing #VmaPool.
+typedef struct VmaPoolStats
+{
/** \brief Total amount of `VkDeviceMemory` allocated from Vulkan for this pool, in bytes.
*/
VkDeviceSize size;
@@ -1267,111 +1243,9 @@ typedef struct VmaPoolStats {
size_t blockCount;
} VmaPoolStats;
-/** \brief Allocates Vulkan device memory and creates #VmaPool object.
-
-@param allocator Allocator object.
-@param pCreateInfo Parameters of pool to create.
-@param[out] pPool Handle to created pool.
-*/
-VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreatePool(
- VmaAllocator VMA_NOT_NULL allocator,
- const VmaPoolCreateInfo* VMA_NOT_NULL pCreateInfo,
- VmaPool VMA_NULLABLE * VMA_NOT_NULL pPool);
-
-/** \brief Destroys #VmaPool object and frees Vulkan device memory.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool(
- VmaAllocator VMA_NOT_NULL allocator,
- VmaPool VMA_NULLABLE pool);
-
-/** \brief Retrieves statistics of existing #VmaPool object.
-
-@param allocator Allocator object.
-@param pool Pool object.
-@param[out] pPoolStats Statistics of specified pool.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStats(
- VmaAllocator VMA_NOT_NULL allocator,
- VmaPool VMA_NOT_NULL pool,
- VmaPoolStats* VMA_NOT_NULL pPoolStats);
-
-/** \brief Marks all allocations in given pool as lost if they are not used in current frame or VmaPoolCreateInfo::frameInUseCount back from now.
-
-@param allocator Allocator object.
-@param pool Pool.
-@param[out] pLostAllocationCount Number of allocations marked as lost. Optional - pass null if you don't need this information.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaMakePoolAllocationsLost(
- VmaAllocator VMA_NOT_NULL allocator,
- VmaPool VMA_NOT_NULL pool,
- size_t* VMA_NULLABLE pLostAllocationCount);
-
-/** \brief 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](@ref debugging_memory_usage_corruption_detection).
-
-Possible return values:
-
-- `VK_ERROR_FEATURE_NOT_PRESENT` - corruption detection is not enabled for specified pool.
-- `VK_SUCCESS` - corruption detection has been performed and succeeded.
-- `VK_ERROR_UNKNOWN` - corruption detection has been performed and found memory corruptions around one of the allocations.
- `VMA_ASSERT` is also fired in that case.
-- Other value: Error returned by Vulkan, e.g. memory mapping failure.
-*/
-VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckPoolCorruption(VmaAllocator VMA_NOT_NULL allocator, VmaPool VMA_NOT_NULL pool);
-
-/** \brief Retrieves name of a custom pool.
-
-After the call `ppName` is either null or points to an internally-owned null-terminated string
-containing name of the pool that was previously set. The pointer becomes invalid when the pool is
-destroyed or its name is changed using vmaSetPoolName().
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
- VmaAllocator VMA_NOT_NULL allocator,
- VmaPool VMA_NOT_NULL pool,
- const char* VMA_NULLABLE * VMA_NOT_NULL ppName);
-
-/** \brief Sets name of a custom pool.
-
-`pName` can be either null or pointer to a null-terminated string with new name for the pool.
-Function makes internal copy of the string, so it can be changed or freed immediately after this call.
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName(
- VmaAllocator VMA_NOT_NULL allocator,
- VmaPool VMA_NOT_NULL pool,
- const char* VMA_NULLABLE pName);
-
-/** \struct VmaAllocation
-\brief 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](@ref 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.
-
-Some kinds allocations can be in lost state.
-For more information, see [Lost allocations](@ref lost_allocations).
-*/
-VK_DEFINE_HANDLE(VmaAllocation)
-
-/** \brief Parameters of #VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
-*/
-typedef struct VmaAllocationInfo {
+/// Parameters of #VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
+typedef struct VmaAllocationInfo
+{
/** \brief Memory type index that this allocation was allocated from.
It never changes.
@@ -1423,13 +1297,422 @@ typedef struct VmaAllocationInfo {
void* VMA_NULLABLE pUserData;
} VmaAllocationInfo;
+/** \brief Parameters for defragmentation.
+
+To be used with function vmaDefragmentationBegin().
+*/
+typedef struct VmaDefragmentationInfo2
+{
+ /** \brief Reserved for future use. Should be 0.
+ */
+ VmaDefragmentationFlags flags;
+ /** \brief Number of allocations in `pAllocations` array.
+ */
+ uint32_t allocationCount;
+ /** \brief Pointer to array of allocations that can be defragmented.
+
+ The array should have `allocationCount` elements.
+ The array should not contain nulls.
+ Elements in the array should be unique - same allocation cannot occur twice.
+ It is safe to pass allocations that are in the lost state - they are ignored.
+ All allocations not present in this array are considered non-moveable during this defragmentation.
+ */
+ const VmaAllocation VMA_NOT_NULL* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations;
+ /** \brief Optional, output. Pointer to array that will be filled with information whether the allocation at certain index has been changed during defragmentation.
+
+ The array should have `allocationCount` elements.
+ You can pass null if you are not interested in this information.
+ */
+ VkBool32* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationsChanged;
+ /** \brief Numer of pools in `pPools` array.
+ */
+ uint32_t poolCount;
+ /** \brief Either null or pointer to array of pools to be defragmented.
+
+ All the allocations in the specified pools can be moved during defragmentation
+ and there is no way to check if they were really moved as in `pAllocationsChanged`,
+ so you must query all the allocations in all these pools for new `VkDeviceMemory`
+ and offset using vmaGetAllocationInfo() if you might need to recreate buffers
+ and images bound to them.
+
+ The array should have `poolCount` elements.
+ The array should not contain nulls.
+ Elements in the array should be unique - same pool cannot occur twice.
+
+ Using this array is equivalent to specifying all allocations from the pools in `pAllocations`.
+ It might be more efficient.
+ */
+ const VmaPool VMA_NOT_NULL* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(poolCount) pPools;
+ /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on CPU side, like `memcpy()`, `memmove()`.
+
+ `VK_WHOLE_SIZE` means no limit.
+ */
+ VkDeviceSize maxCpuBytesToMove;
+ /** \brief Maximum number of allocations that can be moved to a different place using transfers on CPU side, like `memcpy()`, `memmove()`.
+
+ `UINT32_MAX` means no limit.
+ */
+ uint32_t maxCpuAllocationsToMove;
+ /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on GPU side, posted to `commandBuffer`.
+
+ `VK_WHOLE_SIZE` means no limit.
+ */
+ VkDeviceSize maxGpuBytesToMove;
+ /** \brief Maximum number of allocations that can be moved to a different place using transfers on GPU side, posted to `commandBuffer`.
+
+ `UINT32_MAX` means no limit.
+ */
+ uint32_t maxGpuAllocationsToMove;
+ /** \brief Optional. Command buffer where GPU copy commands will be posted.
+
+ If not null, it must be a valid command buffer handle that supports Transfer queue type.
+ It must be in the recording state and outside of a render pass instance.
+ You need to submit it and make sure it finished execution before calling vmaDefragmentationEnd().
+
+ Passing null means that only CPU defragmentation will be performed.
+ */
+ VkCommandBuffer VMA_NULLABLE commandBuffer;
+} VmaDefragmentationInfo2;
+
+typedef struct VmaDefragmentationPassMoveInfo
+{
+ VmaAllocation VMA_NOT_NULL allocation;
+ VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory;
+ VkDeviceSize offset;
+} VmaDefragmentationPassMoveInfo;
+
+/** \brief Parameters for incremental defragmentation steps.
+
+To be used with function vmaBeginDefragmentationPass().
+*/
+typedef struct VmaDefragmentationPassInfo
+{
+ uint32_t moveCount;
+ VmaDefragmentationPassMoveInfo* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(moveCount) pMoves;
+} VmaDefragmentationPassInfo;
+
+/** \brief Deprecated. Optional configuration parameters to be passed to function vmaDefragment().
+
+\deprecated This is a part of the old interface. It is recommended to use structure #VmaDefragmentationInfo2 and function vmaDefragmentationBegin() instead.
+*/
+typedef struct VmaDefragmentationInfo
+{
+ /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places.
+
+ Default is `VK_WHOLE_SIZE`, which means no limit.
+ */
+ VkDeviceSize maxBytesToMove;
+ /** \brief Maximum number of allocations that can be moved to different place.
+
+ Default is `UINT32_MAX`, which means no limit.
+ */
+ uint32_t maxAllocationsToMove;
+} VmaDefragmentationInfo;
+
+/// Statistics returned by function vmaDefragment().
+typedef struct VmaDefragmentationStats
+{
+ /// Total number of bytes that have been copied while moving allocations to different places.
+ VkDeviceSize bytesMoved;
+ /// Total number of bytes that have been released to the system by freeing empty `VkDeviceMemory` objects.
+ VkDeviceSize bytesFreed;
+ /// Number of allocations that have been moved to different places.
+ uint32_t allocationsMoved;
+ /// Number of empty `VkDeviceMemory` objects that have been released to the system.
+ uint32_t deviceMemoryBlocksFreed;
+} VmaDefragmentationStats;
+
+/// Parameters of created #VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
+typedef struct VmaVirtualBlockCreateInfo
+{
+ /** \brief Total size of the virtual block.
+
+ Sizes can be expressed in bytes or any units you want as long as you are consistent in using them.
+ For example, if you allocate from some array of structures, 1 can mean single instance of entire structure.
+ */
+ VkDeviceSize size;
+
+ /** \brief Use combination of #VmaVirtualBlockCreateFlagBits.
+ */
+ VmaVirtualBlockCreateFlagBits flags;
+
+ /** \brief Custom CPU memory allocation callbacks. Optional.
+
+ Optional, can be null. When specified, they will be used for all CPU-side memory allocations.
+ */
+ const VkAllocationCallbacks* VMA_NULLABLE pAllocationCallbacks;
+} VmaVirtualBlockCreateInfo;
+
+/// Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
+typedef struct VmaVirtualAllocationCreateInfo
+{
+ /** \brief Size of the allocation.
+
+ Cannot be zero.
+ */
+ VkDeviceSize size;
+ /** \brief Required alignment of the allocation. Optional.
+
+ Must be power of two. Special value 0 has the same meaning as 1 - means no special alignment is required, so allocation can start at any offset.
+ */
+ VkDeviceSize alignment;
+ /** \brief Use combination of #VmaVirtualAllocationCreateFlagBits.
+ */
+ VmaVirtualAllocationCreateFlags flags;
+ /** \brief Custom pointer to be associated with the allocation. Optional.
+
+ It can be any value and can be used for user-defined purposes. It can be fetched or changed later.
+ */
+ void* VMA_NULLABLE pUserData;
+} VmaVirtualAllocationCreateInfo;
+
+/// Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
+typedef struct VmaVirtualAllocationInfo
+{
+ /** \brief Size of the allocation.
+
+ Same value as passed in VmaVirtualAllocationCreateInfo::size.
+ */
+ VkDeviceSize size;
+ /** \brief Custom pointer associated with the allocation.
+
+ Same value as passed in VmaVirtualAllocationCreateInfo::pUserData or to vmaSetVirtualAllocationUserData().
+ */
+ void* VMA_NULLABLE pUserData;
+} VmaVirtualAllocationInfo;
+
+#endif // _VMA_DATA_TYPES_DECLARATIONS
+
+#ifndef _VMA_FUNCTION_HEADERS
+
+/// Creates Allocator object.
+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAllocator(
+ const VmaAllocatorCreateInfo* VMA_NOT_NULL pCreateInfo,
+ VmaAllocator VMA_NULLABLE* VMA_NOT_NULL pAllocator);
+
+/// Destroys allocator object.
+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(
+ VmaAllocator VMA_NULLABLE allocator);
+
+/** \brief Returns information about existing #VmaAllocator object - handle to Vulkan device etc.
+
+It might be useful if you want to keep just the #VmaAllocator handle and fetch other required handles to
+`VkPhysicalDevice`, `VkDevice` etc. every time using this function.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocatorInfo(
+ VmaAllocator VMA_NOT_NULL allocator,
+ VmaAllocatorInfo* VMA_NOT_NULL pAllocatorInfo);
+
+/**
+PhysicalDeviceProperties are fetched from physicalDevice by the allocator.
+You can access it here, without fetching it again on your own.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaGetPhysicalDeviceProperties(
+ VmaAllocator VMA_NOT_NULL allocator,
+ const VkPhysicalDeviceProperties* VMA_NULLABLE* VMA_NOT_NULL ppPhysicalDeviceProperties);
+
+/**
+PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator.
+You can access it here, without fetching it again on your own.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryProperties(
+ VmaAllocator VMA_NOT_NULL allocator,
+ const VkPhysicalDeviceMemoryProperties* VMA_NULLABLE* VMA_NOT_NULL ppPhysicalDeviceMemoryProperties);
+
+/**
+\brief Given Memory Type Index, returns Property Flags of this memory type.
+
+This is just a convenience function. Same information can be obtained using
+vmaGetMemoryProperties().
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryTypeProperties(
+ VmaAllocator VMA_NOT_NULL allocator,
+ uint32_t memoryTypeIndex,
+ VkMemoryPropertyFlags* VMA_NOT_NULL pFlags);
+
+/** \brief Sets index of the current frame.
+
+This function must be used if you make allocations with
+#VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT and
+#VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flags to inform the allocator
+when a new frame begins. Allocations queried using vmaGetAllocationInfo() cannot
+become lost in the current frame.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaSetCurrentFrameIndex(
+ VmaAllocator VMA_NOT_NULL allocator,
+ uint32_t frameIndex);
+
+/** \brief Retrieves statistics from current state of the Allocator.
+
+This function is called "calculate" not "get" because it has to traverse all
+internal data structures, so it may be quite slow. For faster but more brief statistics
+suitable to be called every frame or every allocation, use vmaGetHeapBudgets().
+
+Note that when using allocator from multiple threads, returned information may immediately
+become outdated.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStats(
+ VmaAllocator VMA_NOT_NULL allocator,
+ VmaStats* VMA_NOT_NULL pStats);
+
+/** \brief Retrieves information about current memory budget for all memory heaps.
+
+\param allocator
+\param[out] pBudgets Must point to array with number of elements at least equal to number of memory heaps in physical device used.
+
+This function is called "get" not "calculate" because it is very fast, suitable to be called
+every frame or every allocation. For more detailed statistics use vmaCalculateStats().
+
+Note that when using allocator from multiple threads, returned information may immediately
+become outdated.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaGetHeapBudgets(
+ VmaAllocator VMA_NOT_NULL allocator,
+ VmaBudget* VMA_NOT_NULL pBudgets);
+
+/**
+\brief Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.
+
+This algorithm tries to find a memory type that:
+
+- Is allowed by memoryTypeBits.
+- Contains all the flags from pAllocationCreateInfo->requiredFlags.
+- Matches intended usage.
+- Has as many flags from pAllocationCreateInfo->preferredFlags as possible.
+
+\return Returns VK_ERROR_FEATURE_NOT_PRESENT if not found. Receiving such result
+from this function or any other allocating function probably means that your
+device doesn't support any memory type with requested features for the specific
+type of resource you want to use it for. Please check parameters of your
+resource, like image layout (OPTIMAL versus LINEAR) or mip level count.
+*/
+VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndex(
+ VmaAllocator VMA_NOT_NULL allocator,
+ uint32_t memoryTypeBits,
+ const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
+ uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
+
+/**
+\brief Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
+
+It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex.
+It internally creates a temporary, dummy buffer that never has memory bound.
+It is just a convenience function, equivalent to calling:
+
+- `vkCreateBuffer`
+- `vkGetBufferMemoryRequirements`
+- `vmaFindMemoryTypeIndex`
+- `vkDestroyBuffer`
+*/
+VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo(
+ VmaAllocator VMA_NOT_NULL allocator,
+ const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
+ const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
+ uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
+
+/**
+\brief Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
+
+It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex.
+It internally creates a temporary, dummy image that never has memory bound.
+It is just a convenience function, equivalent to calling:
+
+- `vkCreateImage`
+- `vkGetImageMemoryRequirements`
+- `vmaFindMemoryTypeIndex`
+- `vkDestroyImage`
+*/
+VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo(
+ VmaAllocator VMA_NOT_NULL allocator,
+ const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
+ const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
+ uint32_t* VMA_NOT_NULL pMemoryTypeIndex);
+
+/** \brief Allocates Vulkan device memory and creates #VmaPool object.
+
+\param allocator Allocator object.
+\param pCreateInfo Parameters of pool to create.
+\param[out] pPool Handle to created pool.
+*/
+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreatePool(
+ VmaAllocator VMA_NOT_NULL allocator,
+ const VmaPoolCreateInfo* VMA_NOT_NULL pCreateInfo,
+ VmaPool VMA_NULLABLE* VMA_NOT_NULL pPool);
+
+/** \brief Destroys #VmaPool object and frees Vulkan device memory.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool(
+ VmaAllocator VMA_NOT_NULL allocator,
+ VmaPool VMA_NULLABLE pool);
+
+/** \brief Retrieves statistics of existing #VmaPool object.
+
+\param allocator Allocator object.
+\param pool Pool object.
+\param[out] pPoolStats Statistics of specified pool.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStats(
+ VmaAllocator VMA_NOT_NULL allocator,
+ VmaPool VMA_NOT_NULL pool,
+ VmaPoolStats* VMA_NOT_NULL pPoolStats);
+
+/** \brief Marks all allocations in given pool as lost if they are not used in current frame or VmaPoolCreateInfo::frameInUseCount back from now.
+
+\param allocator Allocator object.
+\param pool Pool.
+\param[out] pLostAllocationCount Number of allocations marked as lost. Optional - pass null if you don't need this information.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaMakePoolAllocationsLost(
+ VmaAllocator VMA_NOT_NULL allocator,
+ VmaPool VMA_NOT_NULL pool,
+ size_t* VMA_NULLABLE pLostAllocationCount);
+
+/** \brief 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](@ref debugging_memory_usage_corruption_detection).
+
+Possible return values:
+
+- `VK_ERROR_FEATURE_NOT_PRESENT` - corruption detection is not enabled for specified pool.
+- `VK_SUCCESS` - corruption detection has been performed and succeeded.
+- `VK_ERROR_UNKNOWN` - corruption detection has been performed and found memory corruptions around one of the allocations.
+ `VMA_ASSERT` is also fired in that case.
+- Other value: Error returned by Vulkan, e.g. memory mapping failure.
+*/
+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckPoolCorruption(
+ VmaAllocator VMA_NOT_NULL allocator,
+ VmaPool VMA_NOT_NULL pool);
+
+/** \brief Retrieves name of a custom pool.
+
+After the call `ppName` is either null or points to an internally-owned null-terminated string
+containing name of the pool that was previously set. The pointer becomes invalid when the pool is
+destroyed or its name is changed using vmaSetPoolName().
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
+ VmaAllocator VMA_NOT_NULL allocator,
+ VmaPool VMA_NOT_NULL pool,
+ const char* VMA_NULLABLE* VMA_NOT_NULL ppName);
+
+/** \brief Sets name of a custom pool.
+
+`pName` can be either null or pointer to a null-terminated string with new name for the pool.
+Function makes internal copy of the string, so it can be changed or freed immediately after this call.
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName(
+ VmaAllocator VMA_NOT_NULL allocator,
+ VmaPool VMA_NOT_NULL pool,
+ const char* VMA_NULLABLE pName);
+
/** \brief General purpose memory allocation.
-@param allocator
-@param pVkMemoryRequirements
-@param pCreateInfo
-@param[out] pAllocation Handle to allocated memory.
-@param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
+\param allocator
+\param pVkMemoryRequirements
+\param pCreateInfo
+\param[out] pAllocation Handle to allocated memory.
+\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages().
@@ -1440,17 +1723,17 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory(
VmaAllocator VMA_NOT_NULL allocator,
const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements,
const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
- VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
+ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
/** \brief General purpose memory allocation for multiple allocation objects at once.
-@param allocator Allocator object.
-@param pVkMemoryRequirements Memory requirements for each allocation.
-@param pCreateInfo Creation parameters for each alloction.
-@param allocationCount Number of allocations to make.
-@param[out] pAllocations Pointer to array that will be filled with handles to created allocations.
-@param[out] pAllocationInfo Optional. Pointer to array that will be filled with parameters of created allocations.
+\param allocator Allocator object.
+\param pVkMemoryRequirements Memory requirements for each allocation.
+\param pCreateInfo Creation parameters for each allocation.
+\param allocationCount Number of allocations to make.
+\param[out] pAllocations Pointer to array that will be filled with handles to created allocations.
+\param[out] pAllocationInfo Optional. Pointer to array that will be filled with parameters of created allocations.
You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages().
@@ -1467,15 +1750,15 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(
const VkMemoryRequirements* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pVkMemoryRequirements,
const VmaAllocationCreateInfo* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pCreateInfo,
size_t allocationCount,
- VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
+ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
VmaAllocationInfo* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationInfo);
/**
-@param allocator
-@param buffer
-@param pCreateInfo
-@param[out] pAllocation Handle to allocated memory.
-@param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
+\param allocator
+\param buffer
+\param pCreateInfo
+\param[out] pAllocation Handle to allocated memory.
+\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
You should free the memory using vmaFreeMemory().
*/
@@ -1483,7 +1766,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer(
VmaAllocator VMA_NOT_NULL allocator,
VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer,
const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
- VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
+ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
/// Function similar to vmaAllocateMemoryForBuffer().
@@ -1491,7 +1774,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage(
VmaAllocator VMA_NOT_NULL allocator,
VkImage VMA_NOT_NULL_NON_DISPATCHABLE image,
const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
- VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
+ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
/** \brief Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage().
@@ -1515,7 +1798,7 @@ Passing `VK_NULL_HANDLE` as elements of `pAllocations` array is valid. Such entr
VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(
VmaAllocator VMA_NOT_NULL allocator,
size_t allocationCount,
- const VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations);
+ const VmaAllocation VMA_NULLABLE* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations);
/** \brief Returns current information about specified allocation and atomically marks it as used in current frame.
@@ -1586,7 +1869,7 @@ a real, non-empty allocation.
*/
VMA_CALL_PRE void VMA_CALL_POST vmaCreateLostAllocation(
VmaAllocator VMA_NOT_NULL allocator,
- VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation);
+ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation);
/**
\brief Given an allocation, returns Property Flags of its memory type.
@@ -1640,7 +1923,7 @@ you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as requir
VMA_CALL_PRE VkResult VMA_CALL_POST vmaMapMemory(
VmaAllocator VMA_NOT_NULL allocator,
VmaAllocation VMA_NOT_NULL allocation,
- void* VMA_NULLABLE * VMA_NOT_NULL ppData);
+ void* VMA_NULLABLE* VMA_NOT_NULL ppData);
/** \brief Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().
@@ -1725,7 +2008,7 @@ called, otherwise `VK_SUCCESS`.
VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocations(
VmaAllocator VMA_NOT_NULL allocator,
uint32_t allocationCount,
- const VmaAllocation VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
+ const VmaAllocation VMA_NOT_NULL* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) offsets,
const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) sizes);
@@ -1746,14 +2029,14 @@ called, otherwise `VK_SUCCESS`.
VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocations(
VmaAllocator VMA_NOT_NULL allocator,
uint32_t allocationCount,
- const VmaAllocation VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
+ const VmaAllocation VMA_NOT_NULL* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) offsets,
const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) sizes);
/** \brief Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions.
-@param allocator
-@param memoryTypeBits Bit mask, where each bit set means that a memory type with that index should be checked.
+\param allocator
+\param memoryTypeBits Bit mask, where each bit set means that a memory type with that index should be checked.
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
@@ -1767,150 +2050,17 @@ Possible return values:
`VMA_ASSERT` is also fired in that case.
- Other value: Error returned by Vulkan, e.g. memory mapping failure.
*/
-VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption(VmaAllocator VMA_NOT_NULL allocator, uint32_t memoryTypeBits);
-
-/** \struct VmaDefragmentationContext
-\brief Represents Opaque object that represents started defragmentation process.
-
-Fill structure #VmaDefragmentationInfo2 and call function vmaDefragmentationBegin() to create it.
-Call function vmaDefragmentationEnd() to destroy it.
-*/
-VK_DEFINE_HANDLE(VmaDefragmentationContext)
-
-/// Flags to be used in vmaDefragmentationBegin(). None at the moment. Reserved for future use.
-typedef enum VmaDefragmentationFlagBits {
- VMA_DEFRAGMENTATION_FLAG_INCREMENTAL = 0x1,
- VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
-} VmaDefragmentationFlagBits;
-typedef VkFlags VmaDefragmentationFlags;
-
-/** \brief Parameters for defragmentation.
-
-To be used with function vmaDefragmentationBegin().
-*/
-typedef struct VmaDefragmentationInfo2 {
- /** \brief Reserved for future use. Should be 0.
- */
- VmaDefragmentationFlags flags;
- /** \brief Number of allocations in `pAllocations` array.
- */
- uint32_t allocationCount;
- /** \brief Pointer to array of allocations that can be defragmented.
-
- The array should have `allocationCount` elements.
- The array should not contain nulls.
- Elements in the array should be unique - same allocation cannot occur twice.
- It is safe to pass allocations that are in the lost state - they are ignored.
- All allocations not present in this array are considered non-moveable during this defragmentation.
- */
- const VmaAllocation VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations;
- /** \brief Optional, output. Pointer to array that will be filled with information whether the allocation at certain index has been changed during defragmentation.
-
- The array should have `allocationCount` elements.
- You can pass null if you are not interested in this information.
- */
- VkBool32* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationsChanged;
- /** \brief Numer of pools in `pPools` array.
- */
- uint32_t poolCount;
- /** \brief Either null or pointer to array of pools to be defragmented.
-
- All the allocations in the specified pools can be moved during defragmentation
- and there is no way to check if they were really moved as in `pAllocationsChanged`,
- so you must query all the allocations in all these pools for new `VkDeviceMemory`
- and offset using vmaGetAllocationInfo() if you might need to recreate buffers
- and images bound to them.
-
- The array should have `poolCount` elements.
- The array should not contain nulls.
- Elements in the array should be unique - same pool cannot occur twice.
-
- Using this array is equivalent to specifying all allocations from the pools in `pAllocations`.
- It might be more efficient.
- */
- const VmaPool VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(poolCount) pPools;
- /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on CPU side, like `memcpy()`, `memmove()`.
-
- `VK_WHOLE_SIZE` means no limit.
- */
- VkDeviceSize maxCpuBytesToMove;
- /** \brief Maximum number of allocations that can be moved to a different place using transfers on CPU side, like `memcpy()`, `memmove()`.
-
- `UINT32_MAX` means no limit.
- */
- uint32_t maxCpuAllocationsToMove;
- /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on GPU side, posted to `commandBuffer`.
-
- `VK_WHOLE_SIZE` means no limit.
- */
- VkDeviceSize maxGpuBytesToMove;
- /** \brief Maximum number of allocations that can be moved to a different place using transfers on GPU side, posted to `commandBuffer`.
-
- `UINT32_MAX` means no limit.
- */
- uint32_t maxGpuAllocationsToMove;
- /** \brief Optional. Command buffer where GPU copy commands will be posted.
-
- If not null, it must be a valid command buffer handle that supports Transfer queue type.
- It must be in the recording state and outside of a render pass instance.
- You need to submit it and make sure it finished execution before calling vmaDefragmentationEnd().
-
- Passing null means that only CPU defragmentation will be performed.
- */
- VkCommandBuffer VMA_NULLABLE commandBuffer;
-} VmaDefragmentationInfo2;
-
-typedef struct VmaDefragmentationPassMoveInfo {
- VmaAllocation VMA_NOT_NULL allocation;
- VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory;
- VkDeviceSize offset;
-} VmaDefragmentationPassMoveInfo;
-
-/** \brief Parameters for incremental defragmentation steps.
-
-To be used with function vmaBeginDefragmentationPass().
-*/
-typedef struct VmaDefragmentationPassInfo {
- uint32_t moveCount;
- VmaDefragmentationPassMoveInfo* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(moveCount) pMoves;
-} VmaDefragmentationPassInfo;
-
-/** \brief Deprecated. Optional configuration parameters to be passed to function vmaDefragment().
-
-\deprecated This is a part of the old interface. It is recommended to use structure #VmaDefragmentationInfo2 and function vmaDefragmentationBegin() instead.
-*/
-typedef struct VmaDefragmentationInfo {
- /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places.
-
- Default is `VK_WHOLE_SIZE`, which means no limit.
- */
- VkDeviceSize maxBytesToMove;
- /** \brief Maximum number of allocations that can be moved to different place.
-
- Default is `UINT32_MAX`, which means no limit.
- */
- uint32_t maxAllocationsToMove;
-} VmaDefragmentationInfo;
-
-/** \brief Statistics returned by function vmaDefragment(). */
-typedef struct VmaDefragmentationStats {
- /// Total number of bytes that have been copied while moving allocations to different places.
- VkDeviceSize bytesMoved;
- /// Total number of bytes that have been released to the system by freeing empty `VkDeviceMemory` objects.
- VkDeviceSize bytesFreed;
- /// Number of allocations that have been moved to different places.
- uint32_t allocationsMoved;
- /// Number of empty `VkDeviceMemory` objects that have been released to the system.
- uint32_t deviceMemoryBlocksFreed;
-} VmaDefragmentationStats;
+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption(
+ VmaAllocator VMA_NOT_NULL allocator,
+ uint32_t memoryTypeBits);
/** \brief Begins defragmentation process.
-@param allocator Allocator object.
-@param pInfo Structure filled with parameters of defragmentation.
-@param[out] pStats Optional. Statistics of defragmentation. You can pass null if you are not interested in this information.
-@param[out] pContext Context object that must be passed to vmaDefragmentationEnd() to finish defragmentation.
-@return `VK_SUCCESS` and `*pContext == null` if defragmentation finished within this function call. `VK_NOT_READY` and `*pContext != null` if defragmentation has been started and you need to call vmaDefragmentationEnd() to finish it. Negative value in case of error.
+\param allocator Allocator object.
+\param pInfo Structure filled with parameters of defragmentation.
+\param[out] pStats Optional. Statistics of defragmentation. You can pass null if you are not interested in this information.
+\param[out] pContext Context object that must be passed to vmaDefragmentationEnd() to finish defragmentation.
+\return `VK_SUCCESS` and `*pContext == null` if defragmentation finished within this function call. `VK_NOT_READY` and `*pContext != null` if defragmentation has been started and you need to call vmaDefragmentationEnd() to finish it. Negative value in case of error.
Use this function instead of old, deprecated vmaDefragment().
@@ -1937,7 +2087,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationBegin(
VmaAllocator VMA_NOT_NULL allocator,
const VmaDefragmentationInfo2* VMA_NOT_NULL pInfo,
VmaDefragmentationStats* VMA_NULLABLE pStats,
- VmaDefragmentationContext VMA_NULLABLE * VMA_NOT_NULL pContext);
+ VmaDefragmentationContext VMA_NULLABLE* VMA_NOT_NULL pContext);
/** \brief Ends defragmentation process.
@@ -1951,22 +2101,21 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationEnd(
VMA_CALL_PRE VkResult VMA_CALL_POST vmaBeginDefragmentationPass(
VmaAllocator VMA_NOT_NULL allocator,
VmaDefragmentationContext VMA_NULLABLE context,
- VmaDefragmentationPassInfo* VMA_NOT_NULL pInfo
-);
+ VmaDefragmentationPassInfo* VMA_NOT_NULL pInfo);
+
VMA_CALL_PRE VkResult VMA_CALL_POST vmaEndDefragmentationPass(
VmaAllocator VMA_NOT_NULL allocator,
- VmaDefragmentationContext VMA_NULLABLE context
-);
+ VmaDefragmentationContext VMA_NULLABLE context);
/** \brief Deprecated. Compacts memory by moving allocations.
-@param allocator
-@param pAllocations Array of allocations that can be moved during this compation.
-@param allocationCount Number of elements in pAllocations and pAllocationsChanged arrays.
-@param[out] pAllocationsChanged Array of boolean values that will indicate whether matching allocation in pAllocations array has been moved. This parameter is optional. Pass null if you don't need this information.
-@param pDefragmentationInfo Configuration parameters. Optional - pass null to use default values.
-@param[out] pDefragmentationStats Statistics returned by the function. Optional - pass null if you don't need this information.
-@return `VK_SUCCESS` if completed, negative error code in case of error.
+\param allocator
+\param pAllocations Array of allocations that can be moved during this compation.
+\param allocationCount Number of elements in pAllocations and pAllocationsChanged arrays.
+\param[out] pAllocationsChanged Array of boolean values that will indicate whether matching allocation in pAllocations array has been moved. This parameter is optional. Pass null if you don't need this information.
+\param pDefragmentationInfo Configuration parameters. Optional - pass null to use default values.
+\param[out] pDefragmentationStats Statistics returned by the function. Optional - pass null if you don't need this information.
+\return `VK_SUCCESS` if completed, negative error code in case of error.
\deprecated This is a part of the old interface. It is recommended to use structure #VmaDefragmentationInfo2 and function vmaDefragmentationBegin() instead.
@@ -2001,7 +2150,7 @@ For more information, see [Defragmentation](@ref defragmentation) chapter.
*/
VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragment(
VmaAllocator VMA_NOT_NULL allocator,
- const VmaAllocation VMA_NOT_NULL * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
+ const VmaAllocation VMA_NOT_NULL* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
size_t allocationCount,
VkBool32* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationsChanged,
const VmaDefragmentationInfo* VMA_NULLABLE pDefragmentationInfo,
@@ -2026,11 +2175,11 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory(
/** \brief Binds buffer to allocation with additional parameters.
-@param allocator
-@param allocation
-@param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the `allocation`. Normally it should be 0.
-@param buffer
-@param pNext A chain of structures to be attached to `VkBindBufferMemoryInfoKHR` structure used internally. Normally it should be null.
+\param allocator
+\param allocation
+\param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the `allocation`. Normally it should be 0.
+\param buffer
+\param pNext A chain of structures to be attached to `VkBindBufferMemoryInfoKHR` structure used internally. Normally it should be null.
This function is similar to vmaBindBufferMemory(), but it provides additional parameters.
@@ -2063,11 +2212,11 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory(
/** \brief Binds image to allocation with additional parameters.
-@param allocator
-@param allocation
-@param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the `allocation`. Normally it should be 0.
-@param image
-@param pNext A chain of structures to be attached to `VkBindImageMemoryInfoKHR` structure used internally. Normally it should be null.
+\param allocator
+\param allocation
+\param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the `allocation`. Normally it should be 0.
+\param image
+\param pNext A chain of structures to be attached to `VkBindImageMemoryInfoKHR` structure used internally. Normally it should be null.
This function is similar to vmaBindImageMemory(), but it provides additional parameters.
@@ -2082,12 +2231,12 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory2(
const void* VMA_NULLABLE pNext);
/**
-@param allocator
-@param pBufferCreateInfo
-@param pAllocationCreateInfo
-@param[out] pBuffer Buffer that was created.
-@param[out] pAllocation Allocation that was created.
-@param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
+\param allocator
+\param pBufferCreateInfo
+\param pAllocationCreateInfo
+\param[out] pBuffer Buffer that was created.
+\param[out] pAllocation Allocation that was created.
+\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
This function automatically:
@@ -2118,8 +2267,8 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer(
VmaAllocator VMA_NOT_NULL allocator,
const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
- VkBuffer VMA_NULLABLE_NON_DISPATCHABLE * VMA_NOT_NULL pBuffer,
- VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
+ VkBuffer VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pBuffer,
+ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
/** \brief Creates a buffer with additional minimum alignment.
@@ -2133,8 +2282,8 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment(
const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
VkDeviceSize minAlignment,
- VkBuffer VMA_NULLABLE_NON_DISPATCHABLE * VMA_NOT_NULL pBuffer,
- VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
+ VkBuffer VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pBuffer,
+ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
/** \brief Destroys Vulkan buffer and frees allocated memory.
@@ -2158,8 +2307,8 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage(
VmaAllocator VMA_NOT_NULL allocator,
const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo,
- VkImage VMA_NULLABLE_NON_DISPATCHABLE * VMA_NOT_NULL pImage,
- VmaAllocation VMA_NULLABLE * VMA_NOT_NULL pAllocation,
+ VkImage VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pImage,
+ VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation,
VmaAllocationInfo* VMA_NULLABLE pAllocationInfo);
/** \brief Destroys Vulkan image and frees allocated memory.
@@ -2178,138 +2327,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(
VkImage VMA_NULLABLE_NON_DISPATCHABLE image,
VmaAllocation VMA_NULLABLE allocation);
-/// Flags to be passed as VmaVirtualBlockCreateInfo::flags.
-typedef enum VmaVirtualBlockCreateFlagBits {
- /** \brief 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 \ref linear_algorithm.
- */
- VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = 0x00000001,
-
- /** \brief Enables alternative, buddy allocation algorithm in this virtual block.
-
- It operates on a tree of blocks, each having size that is a power of two and
- a half of its parent's size. Comparing to default algorithm, this one provides
- faster allocation and deallocation and decreased external fragmentation,
- at the expense of more memory wasted (internal fragmentation).
- For details, see documentation chapter \ref buddy_algorithm.
- */
- VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT = 0x00000002,
-
- /** \brief Bit mask to extract only `ALGORITHM` bits from entire set of flags.
- */
- VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK =
- VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT |
- VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT,
-
- VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
-} VmaVirtualBlockCreateFlagBits;
-/// Flags to be passed as VmaVirtualBlockCreateInfo::flags. See #VmaVirtualBlockCreateFlagBits.
-typedef VkFlags VmaVirtualBlockCreateFlags;
-
-/// Parameters of created #VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
-typedef struct VmaVirtualBlockCreateInfo
-{
- /** \brief Total size of the virtual block.
-
- Sizes can be expressed in bytes or any units you want as long as you are consistent in using them.
- For example, if you allocate from some array of structures, 1 can mean single instance of entire structure.
- */
- VkDeviceSize size;
-
- /** \brief Use combination of #VmaVirtualBlockCreateFlagBits.
- */
- VmaVirtualBlockCreateFlagBits flags;
-
- /** \brief Custom CPU memory allocation callbacks. Optional.
-
- Optional, can be null. When specified, they will be used for all CPU-side memory allocations.
- */
- const VkAllocationCallbacks* VMA_NULLABLE pAllocationCallbacks;
-} VmaVirtualBlockCreateInfo;
-
-/// Flags to be passed as VmaVirtualAllocationCreateInfo::flags.
-typedef enum VmaVirtualAllocationCreateFlagBits {
- /** \brief Allocation will be created from upper stack in a double stack pool.
-
- This flag is only allowed for virtual blocks created with #VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT flag.
- */
- VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT,
- /** \brief Allocation strategy that tries to minimize memory usage.
- */
- VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT,
- /** \brief Allocation strategy that tries to minimize allocation time.
- */
- VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT,
- /** \brief Allocation strategy that tries to minimize memory fragmentation.
- */
- VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT,
- /** \brief A bit mask to extract only `STRATEGY` bits from entire set of flags.
-
- These stategy flags are binary compatible with equivalent flags in #VmaAllocationCreateFlagBits.
- */
- VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK = VMA_ALLOCATION_CREATE_STRATEGY_MASK,
-
- VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
-} VmaVirtualAllocationCreateFlagBits;
-/// Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See #VmaVirtualAllocationCreateFlagBits.
-typedef VkFlags VmaVirtualAllocationCreateFlags;
-
-/// Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
-typedef struct VmaVirtualAllocationCreateInfo
-{
- /** \brief Size of the allocation.
-
- Cannot be zero.
- */
- VkDeviceSize size;
- /** \brief Required alignment of the allocation. Optional.
-
- Must be power of two. Special value 0 has the same meaning as 1 - means no special alignment is required, so allocation can start at any offset.
- */
- VkDeviceSize alignment;
- /** \brief Use combination of #VmaVirtualAllocationCreateFlagBits.
- */
- VmaVirtualAllocationCreateFlags flags;
- /** \brief Custom pointer to be associated with the allocation. Optional.
-
- It can be any value and can be used for user-defined purposes. It can be fetched or changed later.
- */
- void* VMA_NULLABLE pUserData;
-} VmaVirtualAllocationCreateInfo;
-
-/// Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
-typedef struct VmaVirtualAllocationInfo
-{
- /** \brief Size of the allocation.
-
- Same value as passed in VmaVirtualAllocationCreateInfo::size.
- */
- VkDeviceSize size;
- /** \brief Custom pointer associated with the allocation.
-
- Same value as passed in VmaVirtualAllocationCreateInfo::pUserData or to vmaSetVirtualAllocationUserData().
- */
- void* VMA_NULLABLE pUserData;
-} VmaVirtualAllocationInfo;
-
-/** \struct VmaVirtualBlock
-\brief 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 \ref virtual_allocator.
-
-This object is not thread-safe - should not be used from multiple threads simultaneously, must be synchronized externally.
-*/
-VK_DEFINE_HANDLE(VmaVirtualBlock);
-
/** \brief Creates new #VmaVirtualBlock object.
\param pCreateInfo Parameters for creation.
@@ -2317,7 +2334,7 @@ VK_DEFINE_HANDLE(VmaVirtualBlock);
*/
VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateVirtualBlock(
const VmaVirtualBlockCreateInfo* VMA_NOT_NULL pCreateInfo,
- VmaVirtualBlock VMA_NULLABLE * VMA_NOT_NULL pVirtualBlock);
+ VmaVirtualBlock VMA_NULLABLE* VMA_NOT_NULL pVirtualBlock);
/** \brief Destroys #VmaVirtualBlock object.
@@ -2328,15 +2345,18 @@ if you are sure this is what you want. If you do neither, an assert is called.
If you keep pointers to some additional metadata associated with your virtual allocations in their `pUserData`,
don't forget to free them.
*/
-VMA_CALL_PRE void VMA_CALL_POST vmaDestroyVirtualBlock(VmaVirtualBlock VMA_NULLABLE virtualBlock);
+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyVirtualBlock(
+ VmaVirtualBlock VMA_NULLABLE virtualBlock);
/** \brief Returns true of the #VmaVirtualBlock is empty - contains 0 virtual allocations and has all its space available for new allocations.
*/
-VMA_CALL_PRE VkBool32 VMA_CALL_POST vmaIsVirtualBlockEmpty(VmaVirtualBlock VMA_NOT_NULL virtualBlock);
+VMA_CALL_PRE VkBool32 VMA_CALL_POST vmaIsVirtualBlockEmpty(
+ VmaVirtualBlock VMA_NOT_NULL virtualBlock);
/** \brief Returns information about a specific virtual allocation within a virtual block, like its size and `pUserData` pointer.
*/
-VMA_CALL_PRE void VMA_CALL_POST vmaGetVirtualAllocationInfo(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
+VMA_CALL_PRE void VMA_CALL_POST vmaGetVirtualAllocationInfo(
+ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
VkDeviceSize offset, VmaVirtualAllocationInfo* VMA_NOT_NULL pVirtualAllocInfo);
/** \brief Allocates new virtual allocation inside given #VmaVirtualBlock.
@@ -2347,12 +2367,16 @@ Virtual allocations within a specific virtual block are uniquely identified by t
If the allocation fails due to not enough free space available, `VK_ERROR_OUT_OF_DEVICE_MEMORY` is returned
(despite the function doesn't ever allocate actual GPU memory).
*/
-VMA_CALL_PRE VkResult VMA_CALL_POST vmaVirtualAllocate(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
- const VmaVirtualAllocationCreateInfo* VMA_NOT_NULL pCreateInfo, VkDeviceSize* VMA_NOT_NULL pOffset);
+VMA_CALL_PRE VkResult VMA_CALL_POST vmaVirtualAllocate(
+ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
+ const VmaVirtualAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
+ VkDeviceSize* VMA_NOT_NULL pOffset);
/** \brief Frees virtual allocation inside given #VmaVirtualBlock.
*/
-VMA_CALL_PRE void VMA_CALL_POST vmaVirtualFree(VmaVirtualBlock VMA_NOT_NULL virtualBlock, VkDeviceSize offset);
+VMA_CALL_PRE void VMA_CALL_POST vmaVirtualFree(
+ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
+ VkDeviceSize offset);
/** \brief Frees all virtual allocations inside given #VmaVirtualBlock.
@@ -2362,16 +2386,20 @@ before destroying a virtual block. Otherwise, an assert is called.
If you keep pointer to some additional metadata associated with your virtual allocation in its `pUserData`,
don't forget to free it as well.
*/
-VMA_CALL_PRE void VMA_CALL_POST vmaClearVirtualBlock(VmaVirtualBlock VMA_NOT_NULL virtualBlock);
+VMA_CALL_PRE void VMA_CALL_POST vmaClearVirtualBlock(
+ VmaVirtualBlock VMA_NOT_NULL virtualBlock);
/** \brief Changes custom pointer associated with given virtual allocation.
*/
-VMA_CALL_PRE void VMA_CALL_POST vmaSetVirtualAllocationUserData(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
- VkDeviceSize offset, void* VMA_NULLABLE pUserData);
+VMA_CALL_PRE void VMA_CALL_POST vmaSetVirtualAllocationUserData(
+ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
+ VkDeviceSize offset,
+ void* VMA_NULLABLE pUserData);
/** \brief Calculates and returns statistics about virtual allocations and memory usage in given #VmaVirtualBlock.
*/
-VMA_CALL_PRE void VMA_CALL_POST vmaCalculateVirtualBlockStats(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
+VMA_CALL_PRE void VMA_CALL_POST vmaCalculateVirtualBlockStats(
+ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
VmaStatInfo* VMA_NOT_NULL pStatInfo);
/** \brief Builds and returns a null-terminated string in JSON format with information about given #VmaVirtualBlock.
@@ -2381,14 +2409,34 @@ VMA_CALL_PRE void VMA_CALL_POST vmaCalculateVirtualBlockStats(VmaVirtualBlock VM
Returned string must be freed using vmaFreeVirtualBlockStatsString().
*/
-VMA_CALL_PRE void VMA_CALL_POST vmaBuildVirtualBlockStatsString(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
- char* VMA_NULLABLE * VMA_NOT_NULL ppStatsString, VkBool32 detailedMap);
+VMA_CALL_PRE void VMA_CALL_POST vmaBuildVirtualBlockStatsString(
+ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
+ char* VMA_NULLABLE* VMA_NOT_NULL ppStatsString,
+ VkBool32 detailedMap);
-/** \brief Frees a string returned by vmaBuildVirtualBlockStatsString().
-*/
-VMA_CALL_PRE void VMA_CALL_POST vmaFreeVirtualBlockStatsString(VmaVirtualBlock VMA_NOT_NULL virtualBlock,
+/// Frees a string returned by vmaBuildVirtualBlockStatsString().
+VMA_CALL_PRE void VMA_CALL_POST vmaFreeVirtualBlockStatsString(
+ VmaVirtualBlock VMA_NOT_NULL virtualBlock,
char* VMA_NULLABLE pStatsString);
+#if VMA_STATS_STRING_ENABLED
+/** \brief Builds and returns statistics as a null-terminated string in JSON format.
+\param allocator
+\param[out] ppStatsString Must be freed using vmaFreeStatsString() function.
+\param detailedMap
+*/
+VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
+ VmaAllocator VMA_NOT_NULL allocator,
+ char* VMA_NULLABLE* VMA_NOT_NULL ppStatsString,
+ VkBool32 detailedMap);
+
+VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
+ VmaAllocator VMA_NOT_NULL allocator,
+ char* VMA_NULLABLE pStatsString);
+#endif // VMA_STATS_STRING_ENABLED
+
+#endif // _VMA_FUNCTION_HEADERS
+
#ifdef __cplusplus
}
#endif
@@ -2432,6 +2480,7 @@ CONFIGURATION SECTION
Define some of these macros before each #include of this header or change them
here if you need other then default behavior depending on your environment.
*/
+#ifndef _VMA_CONFIGURATION
/*
Define this macro to 1 to make the library fetch pointers to Vulkan functions
@@ -2833,36 +2882,171 @@ If providing your own implementation, you need to implement a subset of std::ato
className& operator=(const className&) = delete;
#endif
-static const uint32_t VMA_FRAME_INDEX_LOST = UINT32_MAX;
-
-// Decimal 2139416166, float NaN, little-endian binary 66 E6 84 7F.
-static const uint32_t VMA_CORRUPTION_DETECTION_MAGIC_VALUE = 0x7F84E666;
-
-static const uint8_t VMA_ALLOCATION_FILL_PATTERN_CREATED = 0xDC;
-static const uint8_t VMA_ALLOCATION_FILL_PATTERN_DESTROYED = 0xEF;
+#define VMA_VALIDATE(cond) do { if(!(cond)) { \
+ VMA_ASSERT(0 && "Validation failed: " #cond); \
+ return false; \
+ } } while(false)
/*******************************************************************************
END OF CONFIGURATION
*/
+#endif // _VMA_CONFIGURATION
-// # Copy of some Vulkan definitions so we don't need to check their existence just to handle few constants.
+static const uint32_t VMA_FRAME_INDEX_LOST = UINT32_MAX;
+
+static const uint8_t VMA_ALLOCATION_FILL_PATTERN_CREATED = 0xDC;
+static const uint8_t VMA_ALLOCATION_FILL_PATTERN_DESTROYED = 0xEF;
+// Decimal 2139416166, float NaN, little-endian binary 66 E6 84 7F.
+static const uint32_t VMA_CORRUPTION_DETECTION_MAGIC_VALUE = 0x7F84E666;
+// Cost of one additional allocation lost, as equivalent in bytes.
+static const VkDeviceSize VMA_LOST_ALLOCATION_COST = 1048576;
+
+// Copy of some Vulkan definitions so we don't need to check their existence just to handle few constants.
static const uint32_t VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY = 0x00000040;
static const uint32_t VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY = 0x00000080;
static const uint32_t VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY = 0x00020000;
-
static const uint32_t VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET = 0x10000000u;
+static const uint32_t VMA_ALLOCATION_TRY_COUNT = 32;
-static VkAllocationCallbacks VmaEmptyAllocationCallbacks = {
- VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL };
+#if VMA_STATS_STRING_ENABLED
+// Correspond to values of enum VmaSuballocationType.
+static const char* VMA_SUBALLOCATION_TYPE_NAMES[] =
+{
+ "FREE",
+ "UNKNOWN",
+ "BUFFER",
+ "IMAGE_UNKNOWN",
+ "IMAGE_LINEAR",
+ "IMAGE_OPTIMAL",
+};
+#endif
+static VkAllocationCallbacks VmaEmptyAllocationCallbacks =
+ { VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL };
+
+
+#ifndef _VMA_ENUM_DECLARATIONS
+
+enum VmaSuballocationType
+{
+ VMA_SUBALLOCATION_TYPE_FREE = 0,
+ VMA_SUBALLOCATION_TYPE_UNKNOWN = 1,
+ VMA_SUBALLOCATION_TYPE_BUFFER = 2,
+ VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN = 3,
+ VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR = 4,
+ VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL = 5,
+ VMA_SUBALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF
+};
+
+enum VMA_CACHE_OPERATION
+{
+ VMA_CACHE_FLUSH,
+ VMA_CACHE_INVALIDATE
+};
+
+enum class VmaAllocationRequestType
+{
+ Normal,
+ // Used by "Linear" algorithm.
+ UpperAddress,
+ EndOf1st,
+ EndOf2nd,
+};
+
+#endif // _VMA_ENUM_DECLARATIONS
+
+#ifndef _VMA_FORWARD_DECLARATIONS
+struct VmaMutexLock;
+struct VmaMutexLockRead;
+struct VmaMutexLockWrite;
+
+template
+struct VmaStlAllocator;
+
+#if VMA_USE_STL_VECTOR
+#define VmaVector std::vector
+#else
+template
+class VmaVector;
+#endif // VMA_USE_STL_VECTOR
+
+template
+class VmaSmallVector;
+
+template
+class VmaPoolAllocator;
+
+#if VMA_USE_STL_LIST
+#define VmaList std::list
+#else
+template
+struct VmaListItem;
+
+template
+class VmaRawList;
+
+template
+class VmaList;
+#endif // VMA_USE_STL_LIST
+
+template
+class VmaIntrusiveLinkedList;
+
+#if VMA_STATS_STRING_ENABLED
+class VmaStringBuilder;
+class VmaJsonWriter;
+#endif
+
+class VmaDeviceMemoryBlock;
+
+struct VmaDedicatedAllocationListItemTraits;
+class VmaDedicatedAllocationList;
+
+struct VmaSuballocation;
+struct VmaSuballocationOffsetLess;
+struct VmaSuballocationOffsetGreater;
+struct VmaSuballocationItemSizeLess;
+
+typedef VmaList> VmaSuballocationList;
+
+struct VmaAllocationRequest;
+
+class VmaBlockMetadata;
+class VmaBlockMetadata_Generic;
+class VmaBlockMetadata_Linear;
+class VmaBlockMetadata_Buddy;
+
+class VmaBlockVector;
+
+struct VmaDefragmentationMove;
+class VmaDefragmentationAlgorithm;
+class VmaDefragmentationAlgorithm_Generic;
+class VmaDefragmentationAlgorithm_Fast;
+
+struct VmaPoolListItemTraits;
+
+struct VmaBlockDefragmentationContext;
+class VmaBlockVectorDefragmentationContext;
+
+struct VmaCurrentBudgetData;
+
+class VmaAllocationObjectAllocator;
+
+#if VMA_RECORDING_ENABLED
+class VmaRecorder;
+#endif
+#endif // _VMA_FORWARD_DECLARATIONS
+
+
+#ifndef _VMA_FUNCTIONS
// Returns number of bits set to 1 in (v).
static inline uint32_t VmaCountBitsSet(uint32_t v)
{
uint32_t c = v - ((v >> 1) & 0x55555555);
- c = ((c >> 2) & 0x33333333) + (c & 0x33333333);
- c = ((c >> 4) + c) & 0x0F0F0F0F;
- c = ((c >> 8) + c) & 0x00FF00FF;
+ c = ((c >> 2) & 0x33333333) + (c & 0x33333333);
+ c = ((c >> 4) + c) & 0x0F0F0F0F;
+ c = ((c >> 8) + c) & 0x00FF00FF;
c = ((c >> 16) + c) & 0x0000FFFF;
return c;
}
@@ -2875,7 +3059,7 @@ For 0 returns true.
template
inline bool VmaIsPow2(T x)
{
- return (x & (x-1)) == 0;
+ return (x & (x - 1)) == 0;
}
// Aligns given value up to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 16.
@@ -2886,6 +3070,7 @@ static inline T VmaAlignUp(T val, T alignment)
VMA_HEAVY_ASSERT(VmaIsPow2(alignment));
return (val + alignment - 1) & ~(alignment - 1);
}
+
// Aligns given value down to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 8.
// Use types like uint32_t, uint64_t as T.
template
@@ -2914,6 +3099,7 @@ static inline uint32_t VmaNextPow2(uint32_t v)
v++;
return v;
}
+
static inline uint64_t VmaNextPow2(uint64_t v)
{
v--;
@@ -2938,6 +3124,7 @@ static inline uint32_t VmaPrevPow2(uint32_t v)
v = v ^ (v >> 1);
return v;
}
+
static inline uint64_t VmaPrevPow2(uint64_t v)
{
v |= v >> 1;
@@ -2956,10 +3143,9 @@ static inline bool VmaStrIsEmpty(const char* pStr)
}
#if VMA_STATS_STRING_ENABLED
-
static const char* VmaAlgorithmToStr(uint32_t algorithm)
{
- switch(algorithm)
+ switch (algorithm)
{
case VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT:
return "Linear";
@@ -2972,28 +3158,26 @@ static const char* VmaAlgorithmToStr(uint32_t algorithm)
return "";
}
}
-
-#endif // #if VMA_STATS_STRING_ENABLED
+#endif // VMA_STATS_STRING_ENABLED
#ifndef VMA_SORT
-
template
Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)
{
Iterator centerValue = end; --centerValue;
Iterator insertIndex = beg;
- for(Iterator memTypeIndex = beg; memTypeIndex < centerValue; ++memTypeIndex)
+ for (Iterator memTypeIndex = beg; memTypeIndex < centerValue; ++memTypeIndex)
{
- if(cmp(*memTypeIndex, *centerValue))
+ if (cmp(*memTypeIndex, *centerValue))
{
- if(insertIndex != memTypeIndex)
+ if (insertIndex != memTypeIndex)
{
VMA_SWAP(*memTypeIndex, *insertIndex);
}
++insertIndex;
}
}
- if(insertIndex != centerValue)
+ if (insertIndex != centerValue)
{
VMA_SWAP(*insertIndex, *centerValue);
}
@@ -3003,7 +3187,7 @@ Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)
template
void VmaQuickSort(Iterator beg, Iterator end, Compare cmp)
{
- if(beg < end)
+ if (beg < end)
{
Iterator it = VmaQuickSortPartition(beg, end, cmp);
VmaQuickSort(beg, it, cmp);
@@ -3012,8 +3196,7 @@ void VmaQuickSort(Iterator beg, Iterator end, Compare cmp)
}
#define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp)
-
-#endif // #ifndef VMA_SORT
+#endif // VMA_SORT
/*
Returns true if two memory blocks occupy overlapping pages.
@@ -3036,17 +3219,6 @@ static inline bool VmaBlocksOnSamePage(
return resourceAEndPage == resourceBStartPage;
}
-enum VmaSuballocationType
-{
- VMA_SUBALLOCATION_TYPE_FREE = 0,
- VMA_SUBALLOCATION_TYPE_UNKNOWN = 1,
- VMA_SUBALLOCATION_TYPE_BUFFER = 2,
- VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN = 3,
- VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR = 4,
- VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL = 5,
- VMA_SUBALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF
-};
-
/*
Returns true if given suballocation types could conflict and must respect
VkPhysicalDeviceLimits::bufferImageGranularity. They conflict if one is buffer
@@ -3057,12 +3229,12 @@ static inline bool VmaIsBufferImageGranularityConflict(
VmaSuballocationType suballocType1,
VmaSuballocationType suballocType2)
{
- if(suballocType1 > suballocType2)
+ if (suballocType1 > suballocType2)
{
VMA_SWAP(suballocType1, suballocType2);
}
- switch(suballocType1)
+ switch (suballocType1)
{
case VMA_SUBALLOCATION_TYPE_FREE:
return false;
@@ -3093,7 +3265,7 @@ static void VmaWriteMagicValue(void* pData, VkDeviceSize offset)
#if VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_DETECT_CORRUPTION
uint32_t* pDst = (uint32_t*)((char*)pData + offset);
const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
- for(size_t i = 0; i < numberCount; ++i, ++pDst)
+ for (size_t i = 0; i < numberCount; ++i, ++pDst)
{
*pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
}
@@ -3107,9 +3279,9 @@ static bool VmaValidateMagicValue(const void* pData, VkDeviceSize offset)
#if VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_DETECT_CORRUPTION
const uint32_t* pSrc = (const uint32_t*)((const char*)pData + offset);
const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
- for(size_t i = 0; i < numberCount; ++i, ++pSrc)
+ for (size_t i = 0; i < numberCount; ++i, ++pSrc)
{
- if(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
+ if (*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
{
return false;
}
@@ -3130,52 +3302,6 @@ static void VmaFillGpuDefragmentationBufferCreateInfo(VkBufferCreateInfo& outBuf
outBufCreateInfo.size = (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE; // Example size.
}
-// Helper RAII class to lock a mutex in constructor and unlock it in destructor (at the end of scope).
-struct VmaMutexLock
-{
- VMA_CLASS_NO_COPY(VmaMutexLock)
-public:
- VmaMutexLock(VMA_MUTEX& mutex, bool useMutex = true) :
- m_pMutex(useMutex ? &mutex : VMA_NULL)
- { if(m_pMutex) { m_pMutex->Lock(); } }
- ~VmaMutexLock()
- { if(m_pMutex) { m_pMutex->Unlock(); } }
-private:
- VMA_MUTEX* m_pMutex;
-};
-
-// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for reading.
-struct VmaMutexLockRead
-{
- VMA_CLASS_NO_COPY(VmaMutexLockRead)
-public:
- VmaMutexLockRead(VMA_RW_MUTEX& mutex, bool useMutex) :
- m_pMutex(useMutex ? &mutex : VMA_NULL)
- { if(m_pMutex) { m_pMutex->LockRead(); } }
- ~VmaMutexLockRead() { if(m_pMutex) { m_pMutex->UnlockRead(); } }
-private:
- VMA_RW_MUTEX* m_pMutex;
-};
-
-// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for writing.
-struct VmaMutexLockWrite
-{
- VMA_CLASS_NO_COPY(VmaMutexLockWrite)
-public:
- VmaMutexLockWrite(VMA_RW_MUTEX& mutex, bool useMutex) :
- m_pMutex(useMutex ? &mutex : VMA_NULL)
- { if(m_pMutex) { m_pMutex->LockWrite(); } }
- ~VmaMutexLockWrite() { if(m_pMutex) { m_pMutex->UnlockWrite(); } }
-private:
- VMA_RW_MUTEX* m_pMutex;
-};
-
-#if VMA_DEBUG_GLOBAL_MUTEX
- static VMA_MUTEX gDebugGlobalMutex;
- #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex, true);
-#else
- #define VMA_DEBUG_GLOBAL_MUTEX_LOCK
-#endif
/*
Performs binary search and returns iterator to first element that is greater or
@@ -3187,13 +3313,13 @@ Returned value is the found element, if present in the collection or place where
new element with value (key) should be inserted.
*/
template
-static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT &key, const CmpLess& cmp)
+static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT& key, const CmpLess& cmp)
{
size_t down = 0, up = (end - beg);
- while(down < up)
+ while (down < up)
{
const size_t mid = down + (up - down) / 2; // Overflow-safe midpoint calculation
- if(cmp(*(beg+mid), key))
+ if (cmp(*(beg + mid), key))
{
down = mid + 1;
}
@@ -3210,7 +3336,7 @@ IterT VmaBinaryFindSorted(const IterT& beg, const IterT& end, const KeyT& value,
{
IterT it = VmaBinaryFindFirstNotLess(
beg, end, value, cmp);
- if(it == end ||
+ if (it == end ||
(!cmp(*it, value) && !cmp(value, *it)))
{
return it;
@@ -3226,16 +3352,16 @@ T must be pointer type, e.g. VmaAllocation, VmaPool.
template
static bool VmaValidatePointerArray(uint32_t count, const T* arr)
{
- for(uint32_t i = 0; i < count; ++i)
+ for (uint32_t i = 0; i < count; ++i)
{
const T iPtr = arr[i];
- if(iPtr == VMA_NULL)
+ if (iPtr == VMA_NULL)
{
return false;
}
- for(uint32_t j = i + 1; j < count; ++j)
+ for (uint32_t j = i + 1; j < count; ++j)
{
- if(iPtr == arr[j])
+ if (iPtr == arr[j])
{
return false;
}
@@ -3257,7 +3383,7 @@ static inline void VmaPnextChainPushFront(MainT* mainStruct, NewT* newStruct)
static void* VmaMalloc(const VkAllocationCallbacks* pAllocationCallbacks, size_t size, size_t alignment)
{
void* result = VMA_NULL;
- if((pAllocationCallbacks != VMA_NULL) &&
+ if ((pAllocationCallbacks != VMA_NULL) &&
(pAllocationCallbacks->pfnAllocation != VMA_NULL))
{
result = (*pAllocationCallbacks->pfnAllocation)(
@@ -3276,7 +3402,7 @@ static void* VmaMalloc(const VkAllocationCallbacks* pAllocationCallbacks, size_t
static void VmaFree(const VkAllocationCallbacks* pAllocationCallbacks, void* ptr)
{
- if((pAllocationCallbacks != VMA_NULL) &&
+ if ((pAllocationCallbacks != VMA_NULL) &&
(pAllocationCallbacks->pfnFree != VMA_NULL))
{
(*pAllocationCallbacks->pfnFree)(pAllocationCallbacks->pUserData, ptr);
@@ -3313,9 +3439,9 @@ static void vma_delete(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr
template
static void vma_delete_array(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr, size_t count)
{
- if(ptr != VMA_NULL)
+ if (ptr != VMA_NULL)
{
- for(size_t i = count; i--; )
+ for (size_t i = count; i--; )
{
ptr[i].~T();
}
@@ -3325,7 +3451,7 @@ static void vma_delete_array(const VkAllocationCallbacks* pAllocationCallbacks,
static char* VmaCreateStringCopy(const VkAllocationCallbacks* allocs, const char* srcStr)
{
- if(srcStr != VMA_NULL)
+ if (srcStr != VMA_NULL)
{
const size_t len = strlen(srcStr);
char* const result = vma_new_array(allocs, char, len + 1);
@@ -3337,7 +3463,7 @@ static char* VmaCreateStringCopy(const VkAllocationCallbacks* allocs, const char
static char* VmaCreateStringCopy(const VkAllocationCallbacks* allocs, const char* srcStr, size_t strLen)
{
- if(srcStr != VMA_NULL)
+ if (srcStr != VMA_NULL)
{
char* const result = vma_new_array(allocs, char, strLen + 1);
memcpy(result, srcStr, strLen);
@@ -3349,302 +3475,13 @@ static char* VmaCreateStringCopy(const VkAllocationCallbacks* allocs, const char
static void VmaFreeString(const VkAllocationCallbacks* allocs, char* str)
{
- if(str != VMA_NULL)
+ if (str != VMA_NULL)
{
const size_t len = strlen(str);
vma_delete_array(allocs, str, len + 1);
}
}
-// STL-compatible allocator.
-template
-class VmaStlAllocator
-{
-public:
- const VkAllocationCallbacks* const m_pCallbacks;
- typedef T value_type;
-
- VmaStlAllocator(const VkAllocationCallbacks* pCallbacks) : m_pCallbacks(pCallbacks) { }
- template VmaStlAllocator(const VmaStlAllocator& src) : m_pCallbacks(src.m_pCallbacks) { }
-
- T* allocate(size_t n) { return VmaAllocateArray(m_pCallbacks, n); }
- void deallocate(T* p, size_t n) { VmaFree(m_pCallbacks, p); }
-
- template
- bool operator==(const VmaStlAllocator& rhs) const
- {
- return m_pCallbacks == rhs.m_pCallbacks;
- }
- template
- bool operator!=(const VmaStlAllocator& rhs) const
- {
- return m_pCallbacks != rhs.m_pCallbacks;
- }
-
- VmaStlAllocator& operator=(const VmaStlAllocator& x) = delete;
- VmaStlAllocator(const VmaStlAllocator&) = default;
-};
-
-#if VMA_USE_STL_VECTOR
-
-#define VmaVector std::vector
-
-template
-static void VmaVectorInsert(std::vector& vec, size_t index, const T& item)
-{
- vec.insert(vec.begin() + index, item);
-}
-
-template
-static void VmaVectorRemove(std::vector& vec, size_t index)
-{
- vec.erase(vec.begin() + index);
-}
-
-#else // #if VMA_USE_STL_VECTOR
-
-/* Class with interface compatible with subset of std::vector.
-T must be POD because constructors and destructors are not called and memcpy is
-used for these objects. */
-template
-class VmaVector
-{
-public:
- typedef T value_type;
-
- VmaVector(const AllocatorT& allocator) :
- m_Allocator(allocator),
- m_pArray(VMA_NULL),
- m_Count(0),
- m_Capacity(0)
- {
- }
-
- VmaVector(size_t count, const AllocatorT& allocator) :
- m_Allocator(allocator),
- m_pArray(count ? (T*)VmaAllocateArray(allocator.m_pCallbacks, count) : VMA_NULL),
- m_Count(count),
- m_Capacity(count)
- {
- }
-
- // This version of the constructor is here for compatibility with pre-C++14 std::vector.
- // value is unused.
- VmaVector(size_t count, const T& value, const AllocatorT& allocator)
- : VmaVector(count, allocator) {}
-
- VmaVector(const VmaVector& src) :
- m_Allocator(src.m_Allocator),
- m_pArray(src.m_Count ? (T*)VmaAllocateArray(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),
- m_Count(src.m_Count),
- m_Capacity(src.m_Count)
- {
- if(m_Count != 0)
- {
- memcpy(m_pArray, src.m_pArray, m_Count * sizeof(T));
- }
- }
-
- ~VmaVector()
- {
- VmaFree(m_Allocator.m_pCallbacks, m_pArray);
- }
-
- VmaVector& operator=(const VmaVector& rhs)
- {
- if(&rhs != this)
- {
- resize(rhs.m_Count);
- if(m_Count != 0)
- {
- memcpy(m_pArray, rhs.m_pArray, m_Count * sizeof(T));
- }
- }
- return *this;
- }
-
- bool empty() const { return m_Count == 0; }
- size_t size() const { return m_Count; }
- T* data() { return m_pArray; }
- const T* data() const { return m_pArray; }
-
- T& operator[](size_t index)
- {
- VMA_HEAVY_ASSERT(index < m_Count);
- return m_pArray[index];
- }
- const T& operator[](size_t index) const
- {
- VMA_HEAVY_ASSERT(index < m_Count);
- return m_pArray[index];
- }
-
- T& front()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- return m_pArray[0];
- }
- const T& front() const
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- return m_pArray[0];
- }
- T& back()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- return m_pArray[m_Count - 1];
- }
- const T& back() const
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- return m_pArray[m_Count - 1];
- }
-
- void reserve(size_t newCapacity, bool freeMemory = false)
- {
- newCapacity = VMA_MAX(newCapacity, m_Count);
-
- if((newCapacity < m_Capacity) && !freeMemory)
- {
- newCapacity = m_Capacity;
- }
-
- if(newCapacity != m_Capacity)
- {
- T* const newArray = newCapacity ? VmaAllocateArray(m_Allocator, newCapacity) : VMA_NULL;
- if(m_Count != 0)
- {
- memcpy(newArray, m_pArray, m_Count * sizeof(T));
- }
- VmaFree(m_Allocator.m_pCallbacks, m_pArray);
- m_Capacity = newCapacity;
- m_pArray = newArray;
- }
- }
-
- void resize(size_t newCount)
- {
- size_t newCapacity = m_Capacity;
- if(newCount > m_Capacity)
- {
- newCapacity = VMA_MAX(newCount, VMA_MAX(m_Capacity * 3 / 2, (size_t)8));
- }
-
- if(newCapacity != m_Capacity)
- {
- T* const newArray = newCapacity ? VmaAllocateArray(m_Allocator.m_pCallbacks, newCapacity) : VMA_NULL;
- const size_t elementsToCopy = VMA_MIN(m_Count, newCount);
- if(elementsToCopy != 0)
- {
- memcpy(newArray, m_pArray, elementsToCopy * sizeof(T));
- }
- VmaFree(m_Allocator.m_pCallbacks, m_pArray);
- m_Capacity = newCapacity;
- m_pArray = newArray;
- }
-
- m_Count = newCount;
- }
-
- void clear()
- {
- resize(0);
- }
-
- void shrink_to_fit()
- {
- if(m_Capacity > m_Count)
- {
- T* newArray = VMA_NULL;
- if(m_Count > 0)
- {
- newArray = VmaAllocateArray(m_Allocator.m_pCallbacks, m_Count);
- memcpy(newArray, m_pArray, m_Count * sizeof(T));
- }
- VmaFree(m_Allocator.m_pCallbacks, m_pArray);
- m_Capacity = m_Count;
- m_pArray = newArray;
- }
- }
-
- void insert(size_t index, const T& src)
- {
- VMA_HEAVY_ASSERT(index <= m_Count);
- const size_t oldCount = size();
- resize(oldCount + 1);
- if(index < oldCount)
- {
- memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) * sizeof(T));
- }
- m_pArray[index] = src;
- }
-
- void remove(size_t index)
- {
- VMA_HEAVY_ASSERT(index < m_Count);
- const size_t oldCount = size();
- if(index < oldCount - 1)
- {
- memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) * sizeof(T));
- }
- resize(oldCount - 1);
- }
-
- void push_back(const T& src)
- {
- const size_t newIndex = size();
- resize(newIndex + 1);
- m_pArray[newIndex] = src;
- }
-
- void pop_back()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- resize(size() - 1);
- }
-
- void push_front(const T& src)
- {
- insert(0, src);
- }
-
- void pop_front()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- remove(0);
- }
-
- typedef T* iterator;
- typedef const T* const_iterator;
-
- iterator begin() { return m_pArray; }
- iterator end() { return m_pArray + m_Count; }
- const_iterator cbegin() const { return m_pArray; }
- const_iterator cend() const { return m_pArray + m_Count; }
- const_iterator begin() const { return cbegin(); }
- const_iterator end() const { return cend(); }
-
-private:
- AllocatorT m_Allocator;
- T* m_pArray;
- size_t m_Count;
- size_t m_Capacity;
-};
-
-template
-static void VmaVectorInsert(VmaVector& vec, size_t index, const T& item)
-{
- vec.insert(index, item);
-}
-
-template
-static void VmaVectorRemove(VmaVector& vec, size_t index)
-{
- vec.remove(index);
-}
-
-#endif // #if VMA_USE_STL_VECTOR
-
template
size_t VmaVectorInsertSorted(VectorT& vector, const typename VectorT::value_type& value)
{
@@ -3666,7 +3503,7 @@ bool VmaVectorRemoveSorted(VectorT& vector, const typename VectorT::value_type&
vector.end(),
value,
comparator);
- if((it != vector.end()) && !comparator(*it, value) && !comparator(value, *it))
+ if ((it != vector.end()) && !comparator(*it, value) && !comparator(value, *it))
{
size_t indexToRemove = it - vector.begin();
VmaVectorRemove(vector, indexToRemove);
@@ -3674,10 +3511,384 @@ bool VmaVectorRemoveSorted(VectorT& vector, const typename VectorT::value_type&
}
return false;
}
+#endif // _VMA_FUNCTIONS
-////////////////////////////////////////////////////////////////////////////////
-// class VmaSmallVector
+#ifndef _VMA_STAT_INFO_FUNCTIONS
+static void VmaInitStatInfo(VmaStatInfo& outInfo)
+{
+ memset(&outInfo, 0, sizeof(outInfo));
+ outInfo.allocationSizeMin = UINT64_MAX;
+ outInfo.unusedRangeSizeMin = UINT64_MAX;
+}
+// Adds statistics srcInfo into inoutInfo, like: inoutInfo += srcInfo.
+static void VmaAddStatInfo(VmaStatInfo& inoutInfo, const VmaStatInfo& srcInfo)
+{
+ inoutInfo.blockCount += srcInfo.blockCount;
+ inoutInfo.allocationCount += srcInfo.allocationCount;
+ inoutInfo.unusedRangeCount += srcInfo.unusedRangeCount;
+ inoutInfo.usedBytes += srcInfo.usedBytes;
+ inoutInfo.unusedBytes += srcInfo.unusedBytes;
+ inoutInfo.allocationSizeMin = VMA_MIN(inoutInfo.allocationSizeMin, srcInfo.allocationSizeMin);
+ inoutInfo.allocationSizeMax = VMA_MAX(inoutInfo.allocationSizeMax, srcInfo.allocationSizeMax);
+ inoutInfo.unusedRangeSizeMin = VMA_MIN(inoutInfo.unusedRangeSizeMin, srcInfo.unusedRangeSizeMin);
+ inoutInfo.unusedRangeSizeMax = VMA_MAX(inoutInfo.unusedRangeSizeMax, srcInfo.unusedRangeSizeMax);
+}
+
+static void VmaAddStatInfoAllocation(VmaStatInfo& inoutInfo, VkDeviceSize size)
+{
+ ++inoutInfo.allocationCount;
+ inoutInfo.usedBytes += size;
+ if (size < inoutInfo.allocationSizeMin)
+ {
+ inoutInfo.allocationSizeMin = size;
+ }
+ if (size > inoutInfo.allocationSizeMax)
+ {
+ inoutInfo.allocationSizeMax = size;
+ }
+}
+
+static void VmaAddStatInfoUnusedRange(VmaStatInfo& inoutInfo, VkDeviceSize size)
+{
+ ++inoutInfo.unusedRangeCount;
+ inoutInfo.unusedBytes += size;
+ if (size < inoutInfo.unusedRangeSizeMin)
+ {
+ inoutInfo.unusedRangeSizeMin = size;
+ }
+ if (size > inoutInfo.unusedRangeSizeMax)
+ {
+ inoutInfo.unusedRangeSizeMax = size;
+ }
+}
+
+static void VmaPostprocessCalcStatInfo(VmaStatInfo& inoutInfo)
+{
+ inoutInfo.allocationSizeAvg = (inoutInfo.allocationCount > 0) ?
+ VmaRoundDiv(inoutInfo.usedBytes, inoutInfo.allocationCount) : 0;
+ inoutInfo.unusedRangeSizeAvg = (inoutInfo.unusedRangeCount > 0) ?
+ VmaRoundDiv(inoutInfo.unusedBytes, inoutInfo.unusedRangeCount) : 0;
+}
+#endif // _VMA_STAT_INFO_FUNCTIONS
+
+
+#ifndef _VMA_MUTEX_LOCK
+// Helper RAII class to lock a mutex in constructor and unlock it in destructor (at the end of scope).
+struct VmaMutexLock
+{
+ VMA_CLASS_NO_COPY(VmaMutexLock)
+public:
+ VmaMutexLock(VMA_MUTEX& mutex, bool useMutex = true) :
+ m_pMutex(useMutex ? &mutex : VMA_NULL)
+ {
+ if (m_pMutex) { m_pMutex->Lock(); }
+ }
+ ~VmaMutexLock() { if (m_pMutex) { m_pMutex->Unlock(); } }
+
+private:
+ VMA_MUTEX* m_pMutex;
+};
+
+// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for reading.
+struct VmaMutexLockRead
+{
+ VMA_CLASS_NO_COPY(VmaMutexLockRead)
+public:
+ VmaMutexLockRead(VMA_RW_MUTEX& mutex, bool useMutex) :
+ m_pMutex(useMutex ? &mutex : VMA_NULL)
+ {
+ if (m_pMutex) { m_pMutex->LockRead(); }
+ }
+ ~VmaMutexLockRead() { if (m_pMutex) { m_pMutex->UnlockRead(); } }
+
+private:
+ VMA_RW_MUTEX* m_pMutex;
+};
+
+// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for writing.
+struct VmaMutexLockWrite
+{
+ VMA_CLASS_NO_COPY(VmaMutexLockWrite)
+public:
+ VmaMutexLockWrite(VMA_RW_MUTEX& mutex, bool useMutex)
+ : m_pMutex(useMutex ? &mutex : VMA_NULL)
+ {
+ if (m_pMutex) { m_pMutex->LockWrite(); }
+ }
+ ~VmaMutexLockWrite() { if (m_pMutex) { m_pMutex->UnlockWrite(); } }
+
+private:
+ VMA_RW_MUTEX* m_pMutex;
+};
+
+#if VMA_DEBUG_GLOBAL_MUTEX
+ static VMA_MUTEX gDebugGlobalMutex;
+ #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex, true);
+#else
+ #define VMA_DEBUG_GLOBAL_MUTEX_LOCK
+#endif
+#endif // _VMA_MUTEX_LOCK
+
+#ifndef _VMA_STL_ALLOCATOR
+// STL-compatible allocator.
+template
+struct VmaStlAllocator
+{
+ const VkAllocationCallbacks* const m_pCallbacks;
+ typedef T value_type;
+
+ VmaStlAllocator(const VkAllocationCallbacks* pCallbacks) : m_pCallbacks(pCallbacks) {}
+ template
+ VmaStlAllocator(const VmaStlAllocator& src) : m_pCallbacks(src.m_pCallbacks) {}
+ VmaStlAllocator(const VmaStlAllocator&) = default;
+ VmaStlAllocator& operator=(const VmaStlAllocator&) = delete;
+
+ T* allocate(size_t n) { return VmaAllocateArray(m_pCallbacks, n); }
+ void deallocate(T* p, size_t n) { VmaFree(m_pCallbacks, p); }
+
+ template
+ bool operator==(const VmaStlAllocator& rhs) const
+ {
+ return m_pCallbacks == rhs.m_pCallbacks;
+ }
+ template
+ bool operator!=(const VmaStlAllocator& rhs) const
+ {
+ return m_pCallbacks != rhs.m_pCallbacks;
+ }
+};
+#endif // _VMA_STL_ALLOCATOR
+
+#if VMA_USE_STL_VECTOR
+
+template
+static void VmaVectorInsert(std::vector& vec, size_t index, const T& item)
+{
+ vec.insert(vec.begin() + index, item);
+}
+
+template
+static void VmaVectorRemove(std::vector& vec, size_t index)
+{
+ vec.erase(vec.begin() + index);
+}
+
+#else
+/* Class with interface compatible with subset of std::vector.
+T must be POD because constructors and destructors are not called and memcpy is
+used for these objects. */
+template
+class VmaVector
+{
+public:
+ typedef T value_type;
+ typedef T* iterator;
+ typedef const T* const_iterator;
+
+ VmaVector(const AllocatorT& allocator);
+ VmaVector(size_t count, const AllocatorT& allocator);
+ // This version of the constructor is here for compatibility with pre-C++14 std::vector.
+ // value is unused.
+ VmaVector(size_t count, const T& value, const AllocatorT& allocator) : VmaVector(count, allocator) {}
+ VmaVector(const VmaVector& src);
+ VmaVector& operator=(const VmaVector& rhs);
+ ~VmaVector() { VmaFree(m_Allocator.m_pCallbacks, m_pArray); }
+
+ bool empty() const { return m_Count == 0; }
+ size_t size() const { return m_Count; }
+ T* data() { return m_pArray; }
+ T& front() { VMA_HEAVY_ASSERT(m_Count > 0); return m_pArray[0]; }
+ T& back() { VMA_HEAVY_ASSERT(m_Count > 0); return m_pArray[m_Count - 1]; }
+ const T* data() const { return m_pArray; }
+ const T& front() const { VMA_HEAVY_ASSERT(m_Count > 0); return m_pArray[0]; }
+ const T& back() const { VMA_HEAVY_ASSERT(m_Count > 0); return m_pArray[m_Count - 1]; }
+
+ iterator begin() { return m_pArray; }
+ iterator end() { return m_pArray + m_Count; }
+ const_iterator cbegin() const { return m_pArray; }
+ const_iterator cend() const { return m_pArray + m_Count; }
+ const_iterator begin() const { return cbegin(); }
+ const_iterator end() const { return cend(); }
+
+ void pop_front() { VMA_HEAVY_ASSERT(m_Count > 0); remove(0); }
+ void pop_back() { VMA_HEAVY_ASSERT(m_Count > 0); resize(size() - 1); }
+ void push_front(const T& src) { insert(0, src); }
+
+ void push_back(const T& src);
+ void reserve(size_t newCapacity, bool freeMemory = false);
+ void resize(size_t newCount);
+ void clear() { resize(0); }
+ void shrink_to_fit();
+ void insert(size_t index, const T& src);
+ void remove(size_t index);
+
+ T& operator[](size_t index) { VMA_HEAVY_ASSERT(index < m_Count); return m_pArray[index]; }
+ const T& operator[](size_t index) const { VMA_HEAVY_ASSERT(index < m_Count); return m_pArray[index]; }
+
+private:
+ AllocatorT m_Allocator;
+ T* m_pArray;
+ size_t m_Count;
+ size_t m_Capacity;
+};
+
+#ifndef _VMA_VECTOR_FUNCTIONS
+template
+VmaVector::VmaVector(const AllocatorT& allocator)
+ : m_Allocator(allocator),
+ m_pArray(VMA_NULL),
+ m_Count(0),
+ m_Capacity(0) {}
+
+template
+VmaVector::VmaVector(size_t count, const AllocatorT& allocator)
+ : m_Allocator(allocator),
+ m_pArray(count ? (T*)VmaAllocateArray(allocator.m_pCallbacks, count) : VMA_NULL),
+ m_Count(count),
+ m_Capacity(count) {}
+
+template
+VmaVector::VmaVector(const VmaVector& src)
+ : m_Allocator(src.m_Allocator),
+ m_pArray(src.m_Count ? (T*)VmaAllocateArray(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),
+ m_Count(src.m_Count),
+ m_Capacity(src.m_Count)
+{
+ if (m_Count != 0)
+ {
+ memcpy(m_pArray, src.m_pArray, m_Count * sizeof(T));
+ }
+}
+
+template
+VmaVector& VmaVector::operator=(const VmaVector& rhs)
+{
+ if (&rhs != this)
+ {
+ resize(rhs.m_Count);
+ if (m_Count != 0)
+ {
+ memcpy(m_pArray, rhs.m_pArray, m_Count * sizeof(T));
+ }
+ }
+ return *this;
+}
+
+template
+void VmaVector::push_back(const T& src)
+{
+ const size_t newIndex = size();
+ resize(newIndex + 1);
+ m_pArray[newIndex] = src;
+}
+
+template
+void VmaVector::reserve(size_t newCapacity, bool freeMemory)
+{
+ newCapacity = VMA_MAX(newCapacity, m_Count);
+
+ if ((newCapacity < m_Capacity) && !freeMemory)
+ {
+ newCapacity = m_Capacity;
+ }
+
+ if (newCapacity != m_Capacity)
+ {
+ T* const newArray = newCapacity ? VmaAllocateArray(m_Allocator, newCapacity) : VMA_NULL;
+ if (m_Count != 0)
+ {
+ memcpy(newArray, m_pArray, m_Count * sizeof(T));
+ }
+ VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+ m_Capacity = newCapacity;
+ m_pArray = newArray;
+ }
+}
+
+template
+void VmaVector::resize(size_t newCount)
+{
+ size_t newCapacity = m_Capacity;
+ if (newCount > m_Capacity)
+ {
+ newCapacity = VMA_MAX(newCount, VMA_MAX(m_Capacity * 3 / 2, (size_t)8));
+ }
+
+ if (newCapacity != m_Capacity)
+ {
+ T* const newArray = newCapacity ? VmaAllocateArray(m_Allocator.m_pCallbacks, newCapacity) : VMA_NULL;
+ const size_t elementsToCopy = VMA_MIN(m_Count, newCount);
+ if (elementsToCopy != 0)
+ {
+ memcpy(newArray, m_pArray, elementsToCopy * sizeof(T));
+ }
+ VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+ m_Capacity = newCapacity;
+ m_pArray = newArray;
+ }
+
+ m_Count = newCount;
+}
+
+template
+void VmaVector::shrink_to_fit()
+{
+ if (m_Capacity > m_Count)
+ {
+ T* newArray = VMA_NULL;
+ if (m_Count > 0)
+ {
+ newArray = VmaAllocateArray(m_Allocator.m_pCallbacks, m_Count);
+ memcpy(newArray, m_pArray, m_Count * sizeof(T));
+ }
+ VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+ m_Capacity = m_Count;
+ m_pArray = newArray;
+ }
+}
+
+template
+void VmaVector::insert(size_t index, const T& src)
+{
+ VMA_HEAVY_ASSERT(index <= m_Count);
+ const size_t oldCount = size();
+ resize(oldCount + 1);
+ if (index < oldCount)
+ {
+ memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) * sizeof(T));
+ }
+ m_pArray[index] = src;
+}
+
+template
+void VmaVector::remove(size_t index)
+{
+ VMA_HEAVY_ASSERT(index < m_Count);
+ const size_t oldCount = size();
+ if (index < oldCount - 1)
+ {
+ memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) * sizeof(T));
+ }
+ resize(oldCount - 1);
+}
+#endif // _VMA_VECTOR_FUNCTIONS
+
+template
+static void VmaVectorInsert(VmaVector& vec, size_t index, const T& item)
+{
+ vec.insert(index, item);
+}
+
+template
+static void VmaVectorRemove(VmaVector& vec, size_t index)
+{
+ vec.remove(index);
+}
+
+#endif // VMA_USE_STL_VECTOR
+
+#ifndef _VMA_SMALL_VECTOR
/*
This is a vector (a variable-sized array), optimized for the case when the array is small.
@@ -3685,180 +3896,154 @@ It contains some number of elements in-place, which allows it to avoid heap allo
when the actual number of elements is below that threshold. This allows normal "small"
cases to be fast without losing generality for large inputs.
*/
-
template
class VmaSmallVector
{
public:
typedef T value_type;
+ typedef T* iterator;
- VmaSmallVector(const AllocatorT& allocator) :
- m_Count(0),
- m_DynamicArray(allocator)
- {
- }
- VmaSmallVector(size_t count, const AllocatorT& allocator) :
- m_Count(count),
- m_DynamicArray(count > N ? count : 0, allocator)
- {
- }
+ VmaSmallVector(const AllocatorT& allocator);
+ VmaSmallVector(size_t count, const AllocatorT& allocator);
template
- VmaSmallVector(const VmaSmallVector& src) = delete;
+ VmaSmallVector(const VmaSmallVector&) = delete;
template
- VmaSmallVector& operator=(const VmaSmallVector& rhs) = delete;
+ VmaSmallVector& operator=(const VmaSmallVector&) = delete;
+ ~VmaSmallVector() = default;
bool empty() const { return m_Count == 0; }
size_t size() const { return m_Count; }
T* data() { return m_Count > N ? m_DynamicArray.data() : m_StaticArray; }
+ T& front() { VMA_HEAVY_ASSERT(m_Count > 0); return data()[0]; }
+ T& back() { VMA_HEAVY_ASSERT(m_Count > 0); return data()[m_Count - 1]; }
const T* data() const { return m_Count > N ? m_DynamicArray.data() : m_StaticArray; }
-
- T& operator[](size_t index)
- {
- VMA_HEAVY_ASSERT(index < m_Count);
- return data()[index];
- }
- const T& operator[](size_t index) const
- {
- VMA_HEAVY_ASSERT(index < m_Count);
- return data()[index];
- }
-
- T& front()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- return data()[0];
- }
- const T& front() const
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- return data()[0];
- }
- T& back()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- return data()[m_Count - 1];
- }
- const T& back() const
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- return data()[m_Count - 1];
- }
-
- void resize(size_t newCount, bool freeMemory = false)
- {
- if(newCount > N && m_Count > N)
- {
- // Any direction, staying in m_DynamicArray
- m_DynamicArray.resize(newCount);
- if(freeMemory)
- {
- m_DynamicArray.shrink_to_fit();
- }
- }
- else if(newCount > N && m_Count <= N)
- {
- // Growing, moving from m_StaticArray to m_DynamicArray
- m_DynamicArray.resize(newCount);
- if(m_Count > 0)
- {
- memcpy(m_DynamicArray.data(), m_StaticArray, m_Count * sizeof(T));
- }
- }
- else if(newCount <= N && m_Count > N)
- {
- // Shrinking, moving from m_DynamicArray to m_StaticArray
- if(newCount > 0)
- {
- memcpy(m_StaticArray, m_DynamicArray.data(), newCount * sizeof(T));
- }
- m_DynamicArray.resize(0);
- if(freeMemory)
- {
- m_DynamicArray.shrink_to_fit();
- }
- }
- else
- {
- // Any direction, staying in m_StaticArray - nothing to do here
- }
- m_Count = newCount;
- }
-
- void clear(bool freeMemory = false)
- {
- m_DynamicArray.clear();
- if(freeMemory)
- {
- m_DynamicArray.shrink_to_fit();
- }
- m_Count = 0;
- }
-
- void insert(size_t index, const T& src)
- {
- VMA_HEAVY_ASSERT(index <= m_Count);
- const size_t oldCount = size();
- resize(oldCount + 1);
- T* const dataPtr = data();
- if(index < oldCount)
- {
- // I know, this could be more optimal for case where memmove can be memcpy directly from m_StaticArray to m_DynamicArray.
- memmove(dataPtr + (index + 1), dataPtr + index, (oldCount - index) * sizeof(T));
- }
- dataPtr[index] = src;
- }
-
- void remove(size_t index)
- {
- VMA_HEAVY_ASSERT(index < m_Count);
- const size_t oldCount = size();
- if(index < oldCount - 1)
- {
- // I know, this could be more optimal for case where memmove can be memcpy directly from m_DynamicArray to m_StaticArray.
- T* const dataPtr = data();
- memmove(dataPtr + index, dataPtr + (index + 1), (oldCount - index - 1) * sizeof(T));
- }
- resize(oldCount - 1);
- }
-
- void push_back(const T& src)
- {
- const size_t newIndex = size();
- resize(newIndex + 1);
- data()[newIndex] = src;
- }
-
- void pop_back()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- resize(size() - 1);
- }
-
- void push_front(const T& src)
- {
- insert(0, src);
- }
-
- void pop_front()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- remove(0);
- }
-
- typedef T* iterator;
+ const T& front() const { VMA_HEAVY_ASSERT(m_Count > 0); return data()[0]; }
+ const T& back() const { VMA_HEAVY_ASSERT(m_Count > 0); return data()[m_Count - 1]; }
iterator begin() { return data(); }
iterator end() { return data() + m_Count; }
+ void pop_front() { VMA_HEAVY_ASSERT(m_Count > 0); remove(0); }
+ void pop_back() { VMA_HEAVY_ASSERT(m_Count > 0); resize(size() - 1); }
+ void push_front(const T& src) { insert(0, src); }
+
+ void push_back(const T& src);
+ void resize(size_t newCount, bool freeMemory = false);
+ void clear(bool freeMemory = false);
+ void insert(size_t index, const T& src);
+ void remove(size_t index);
+
+ T& operator[](size_t index) { VMA_HEAVY_ASSERT(index < m_Count); return data()[index]; }
+ const T& operator[](size_t index) const { VMA_HEAVY_ASSERT(index < m_Count); return data()[index]; }
+
private:
size_t m_Count;
T m_StaticArray[N]; // Used when m_Size <= N
VmaVector m_DynamicArray; // Used when m_Size > N
};
-////////////////////////////////////////////////////////////////////////////////
-// class VmaPoolAllocator
+#ifndef _VMA_SMALL_VECTOR_FUNCTIONS
+template
+VmaSmallVector::VmaSmallVector(const AllocatorT& allocator)
+ : m_Count(0),
+ m_DynamicArray(allocator) {}
+template
+VmaSmallVector::VmaSmallVector(size_t count, const AllocatorT& allocator)
+ : m_Count(count),
+ m_DynamicArray(count > N ? count : 0, allocator) {}
+
+template
+void VmaSmallVector::push_back(const T& src)
+{
+ resize(m_Count + 1);
+ data()[m_Count] = src;
+}
+
+template
+void VmaSmallVector::resize(size_t newCount, bool freeMemory)
+{
+ if (newCount > N && m_Count > N)
+ {
+ // Any direction, staying in m_DynamicArray
+ m_DynamicArray.resize(newCount);
+ if (freeMemory)
+ {
+ m_DynamicArray.shrink_to_fit();
+ }
+ }
+ else if (newCount > N && m_Count <= N)
+ {
+ // Growing, moving from m_StaticArray to m_DynamicArray
+ m_DynamicArray.resize(newCount);
+ if (m_Count > 0)
+ {
+ memcpy(m_DynamicArray.data(), m_StaticArray, m_Count * sizeof(T));
+ }
+ }
+ else if (newCount <= N && m_Count > N)
+ {
+ // Shrinking, moving from m_DynamicArray to m_StaticArray
+ if (newCount > 0)
+ {
+ memcpy(m_StaticArray, m_DynamicArray.data(), newCount * sizeof(T));
+ }
+ m_DynamicArray.resize(0);
+ if (freeMemory)
+ {
+ m_DynamicArray.shrink_to_fit();
+ }
+ }
+ else
+ {
+ // Any direction, staying in m_StaticArray - nothing to do here
+ }
+ m_Count = newCount;
+}
+
+template
+void VmaSmallVector::clear(bool freeMemory)
+{
+ m_DynamicArray.clear();
+ if (freeMemory)
+ {
+ m_DynamicArray.shrink_to_fit();
+ }
+ m_Count = 0;
+}
+
+template
+void VmaSmallVector::insert(size_t index, const T& src)
+{
+ VMA_HEAVY_ASSERT(index <= m_Count);
+ const size_t oldCount = size();
+ resize(oldCount + 1);
+ T* const dataPtr = data();
+ if (index < oldCount)
+ {
+ // I know, this could be more optimal for case where memmove can be memcpy directly from m_StaticArray to m_DynamicArray.
+ memmove(dataPtr + (index + 1), dataPtr + index, (oldCount - index) * sizeof(T));
+ }
+ dataPtr[index] = src;
+}
+
+template
+void VmaSmallVector::remove(size_t index)
+{
+ VMA_HEAVY_ASSERT(index < m_Count);
+ const size_t oldCount = size();
+ if (index < oldCount - 1)
+ {
+ // I know, this could be more optimal for case where memmove can be memcpy directly from m_DynamicArray to m_StaticArray.
+ T* const dataPtr = data();
+ memmove(dataPtr + index, dataPtr + (index + 1), (oldCount - index - 1) * sizeof(T));
+ }
+ resize(oldCount - 1);
+}
+#endif // _VMA_SMALL_VECTOR_FUNCTIONS
+#endif // _VMA_SMALL_VECTOR
+
+#ifndef _VMA_POOL_ALLOCATOR
/*
Allocator for objects of type T using a list of arrays (pools) to speed up
allocation. Number of elements that can be allocated is not bounded because
@@ -3880,7 +4065,6 @@ private:
uint32_t NextFreeIndex;
alignas(T) char Value[sizeof(T)];
};
-
struct ItemBlock
{
Item* pItems;
@@ -3895,9 +4079,10 @@ private:
ItemBlock& CreateNewBlock();
};
+#ifndef _VMA_POOL_ALLOCATOR_FUNCTIONS
template
-VmaPoolAllocator::VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity) :
- m_pAllocationCallbacks(pAllocationCallbacks),
+VmaPoolAllocator::VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity)
+ : m_pAllocationCallbacks(pAllocationCallbacks),
m_FirstBlockCapacity(firstBlockCapacity),
m_ItemBlocks(VmaStlAllocator(pAllocationCallbacks))
{
@@ -3907,7 +4092,7 @@ VmaPoolAllocator::VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCa
template
VmaPoolAllocator::~VmaPoolAllocator()
{
- for(size_t i = m_ItemBlocks.size(); i--; )
+ for (size_t i = m_ItemBlocks.size(); i--;)
vma_delete_array(m_pAllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemBlocks[i].Capacity);
m_ItemBlocks.clear();
}
@@ -3915,11 +4100,11 @@ VmaPoolAllocator::~VmaPoolAllocator()
template
template T* VmaPoolAllocator::Alloc(Types&&... args)
{
- for(size_t i = m_ItemBlocks.size(); i--; )
+ for (size_t i = m_ItemBlocks.size(); i--; )
{
ItemBlock& block = m_ItemBlocks[i];
// This block has some free items: Use first one.
- if(block.FirstFreeIndex != UINT32_MAX)
+ if (block.FirstFreeIndex != UINT32_MAX)
{
Item* const pItem = &block.pItems[block.FirstFreeIndex];
block.FirstFreeIndex = pItem->NextFreeIndex;
@@ -3934,7 +4119,7 @@ template T* VmaPoolAllocator::Alloc(Types&&... args)
Item* const pItem = &newBlock.pItems[0];
newBlock.FirstFreeIndex = pItem->NextFreeIndex;
T* result = (T*)&pItem->Value;
- new(result)T(std::forward(args)...); // Explicit constructor call.
+ new(result) T(std::forward(args)...); // Explicit constructor call.
return result;
}
@@ -3942,7 +4127,7 @@ template
void VmaPoolAllocator::Free(T* ptr)
{
// Search all memory blocks to find ptr.
- for(size_t i = m_ItemBlocks.size(); i--; )
+ for (size_t i = m_ItemBlocks.size(); i--; )
{
ItemBlock& block = m_ItemBlocks[i];
@@ -3951,7 +4136,7 @@ void VmaPoolAllocator::Free(T* ptr)
memcpy(&pItemPtr, &ptr, sizeof(pItemPtr));
// Check if pItemPtr is in address range of this block.
- if((pItemPtr >= block.pItems) && (pItemPtr < block.pItems + block.Capacity))
+ if ((pItemPtr >= block.pItems) && (pItemPtr < block.pItems + block.Capacity))
{
ptr->~T(); // Explicit destructor call.
const uint32_t index = static_cast(pItemPtr - block.pItems);
@@ -3969,29 +4154,26 @@ typename VmaPoolAllocator::ItemBlock& VmaPoolAllocator::CreateNewBlock()
const uint32_t newBlockCapacity = m_ItemBlocks.empty() ?
m_FirstBlockCapacity : m_ItemBlocks.back().Capacity * 3 / 2;
- const ItemBlock newBlock = {
+ const ItemBlock newBlock =
+ {
vma_new_array(m_pAllocationCallbacks, Item, newBlockCapacity),
newBlockCapacity,
- 0 };
+ 0
+ };
m_ItemBlocks.push_back(newBlock);
// Setup singly-linked list of all free items in this block.
- for(uint32_t i = 0; i < newBlockCapacity - 1; ++i)
+ for (uint32_t i = 0; i < newBlockCapacity - 1; ++i)
newBlock.pItems[i].NextFreeIndex = i + 1;
newBlock.pItems[newBlockCapacity - 1].NextFreeIndex = UINT32_MAX;
return m_ItemBlocks.back();
}
+#endif // _VMA_POOL_ALLOCATOR_FUNCTIONS
+#endif // _VMA_POOL_ALLOCATOR
-////////////////////////////////////////////////////////////////////////////////
-// class VmaRawList, VmaList
-
-#if VMA_USE_STL_LIST
-
-#define VmaList std::list
-
-#else // #if VMA_USE_STL_LIST
-
+#ifndef VMA_USE_STL_LIST
+#ifndef _VMA_RAW_LIST
template
struct VmaListItem
{
@@ -4009,32 +4191,33 @@ public:
typedef VmaListItem ItemType;
VmaRawList(const VkAllocationCallbacks* pAllocationCallbacks);
- ~VmaRawList();
- void Clear();
+ // Intentionally not calling Clear, because that would be unnecessary
+ // computations to return all items to m_ItemAllocator as free.
+ ~VmaRawList() = default;
size_t GetCount() const { return m_Count; }
bool IsEmpty() const { return m_Count == 0; }
ItemType* Front() { return m_pFront; }
- const ItemType* Front() const { return m_pFront; }
ItemType* Back() { return m_pBack; }
+ const ItemType* Front() const { return m_pFront; }
const ItemType* Back() const { return m_pBack; }
- ItemType* PushBack();
ItemType* PushFront();
- ItemType* PushBack(const T& value);
+ ItemType* PushBack();
ItemType* PushFront(const T& value);
- void PopBack();
+ ItemType* PushBack(const T& value);
void PopFront();
+ void PopBack();
// Item can be null - it means PushBack.
ItemType* InsertBefore(ItemType* pItem);
// Item can be null - it means PushFront.
ItemType* InsertAfter(ItemType* pItem);
-
ItemType* InsertBefore(ItemType* pItem, const T& value);
ItemType* InsertAfter(ItemType* pItem, const T& value);
+ void Clear();
void Remove(ItemType* pItem);
private:
@@ -4045,37 +4228,35 @@ private:
size_t m_Count;
};
+#ifndef _VMA_RAW_LIST_FUNCTIONS
template
-VmaRawList::VmaRawList(const VkAllocationCallbacks* pAllocationCallbacks) :
- m_pAllocationCallbacks(pAllocationCallbacks),
+VmaRawList::VmaRawList(const VkAllocationCallbacks* pAllocationCallbacks)
+ : m_pAllocationCallbacks(pAllocationCallbacks),
m_ItemAllocator(pAllocationCallbacks, 128),
m_pFront(VMA_NULL),
m_pBack(VMA_NULL),
- m_Count(0)
-{
-}
+ m_Count(0) {}
template
-VmaRawList::~VmaRawList() = default;
-// Intentionally not calling Clear, because that would be unnecessary
-// computations to return all items to m_ItemAllocator as free.
-
-template
-void VmaRawList::Clear()
+VmaListItem* VmaRawList::PushFront()
{
- if(IsEmpty() == false)
+ ItemType* const pNewItem = m_ItemAllocator.Alloc();
+ pNewItem->pPrev = VMA_NULL;
+ if (IsEmpty())
{
- ItemType* pItem = m_pBack;
- while(pItem != VMA_NULL)
- {
- ItemType* const pPrevItem = pItem->pPrev;
- m_ItemAllocator.Free(pItem);
- pItem = pPrevItem;
- }
- m_pFront = VMA_NULL;
- m_pBack = VMA_NULL;
- m_Count = 0;
+ pNewItem->pNext = VMA_NULL;
+ m_pFront = pNewItem;
+ m_pBack = pNewItem;
+ m_Count = 1;
}
+ else
+ {
+ pNewItem->pNext = m_pFront;
+ m_pFront->pPrev = pNewItem;
+ m_pFront = pNewItem;
+ ++m_Count;
+ }
+ return pNewItem;
}
template
@@ -4101,24 +4282,10 @@ VmaListItem* VmaRawList::PushBack()
}
template
-VmaListItem* VmaRawList::PushFront()
+VmaListItem* VmaRawList::PushFront(const T& value)
{
- ItemType* const pNewItem = m_ItemAllocator.Alloc();
- pNewItem->pPrev = VMA_NULL;
- if(IsEmpty())
- {
- pNewItem->pNext = VMA_NULL;
- m_pFront = pNewItem;
- m_pBack = pNewItem;
- m_Count = 1;
- }
- else
- {
- pNewItem->pNext = m_pFront;
- m_pFront->pPrev = pNewItem;
- m_pFront = pNewItem;
- ++m_Count;
- }
+ ItemType* const pNewItem = PushFront();
+ pNewItem->Value = value;
return pNewItem;
}
@@ -4131,11 +4298,18 @@ VmaListItem* VmaRawList::PushBack(const T& value)
}
template
-VmaListItem* VmaRawList::PushFront(const T& value)
+void VmaRawList::PopFront()
{
- ItemType* const pNewItem = PushFront();
- pNewItem->Value = value;
- return pNewItem;
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ ItemType* const pFrontItem = m_pFront;
+ ItemType* const pNextItem = pFrontItem->pNext;
+ if (pNextItem != VMA_NULL)
+ {
+ pNextItem->pPrev = VMA_NULL;
+ }
+ m_pFront = pNextItem;
+ m_ItemAllocator.Free(pFrontItem);
+ --m_Count;
}
template
@@ -4154,18 +4328,21 @@ void VmaRawList::PopBack()
}
template
-void VmaRawList::PopFront()
+void VmaRawList::Clear()
{
- VMA_HEAVY_ASSERT(m_Count > 0);
- ItemType* const pFrontItem = m_pFront;
- ItemType* const pNextItem = pFrontItem->pNext;
- if(pNextItem != VMA_NULL)
+ if (IsEmpty() == false)
{
- pNextItem->pPrev = VMA_NULL;
+ ItemType* pItem = m_pBack;
+ while (pItem != VMA_NULL)
+ {
+ ItemType* const pPrevItem = pItem->pPrev;
+ m_ItemAllocator.Free(pItem);
+ pItem = pPrevItem;
+ }
+ m_pFront = VMA_NULL;
+ m_pBack = VMA_NULL;
+ m_Count = 0;
}
- m_pFront = pNextItem;
- m_ItemAllocator.Free(pFrontItem);
- --m_Count;
}
template
@@ -4265,358 +4442,123 @@ VmaListItem* VmaRawList::InsertAfter(ItemType* pItem, const T& value)
newItem->Value = value;
return newItem;
}
+#endif // _VMA_RAW_LIST_FUNCTIONS
+#endif // _VMA_RAW_LIST
+#ifndef _VMA_LIST
template
class VmaList
{
VMA_CLASS_NO_COPY(VmaList)
public:
class reverse_iterator;
+ class const_iterator;
+ class const_reverse_iterator;
+
class iterator
{
+ friend class VmaList;
public:
- iterator() :
- m_pList(VMA_NULL),
- m_pItem(VMA_NULL)
- {
- }
+ iterator() : m_pList(VMA_NULL), m_pItem(VMA_NULL) {}
+ iterator(const reverse_iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
- iterator(const reverse_iterator& src) :
- m_pList(src.m_pList),
- m_pItem(src.m_pItem)
- {
- }
+ T& operator*() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return m_pItem->Value; }
+ T* operator->() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return &m_pItem->Value; }
- T& operator*() const
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- return m_pItem->Value;
- }
- T* operator->() const
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- return &m_pItem->Value;
- }
+ bool operator==(const iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem == rhs.m_pItem; }
+ bool operator!=(const iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem != rhs.m_pItem; }
- iterator& operator++()
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- m_pItem = m_pItem->pNext;
- return *this;
- }
- iterator& operator--()
- {
- if(m_pItem != VMA_NULL)
- {
- m_pItem = m_pItem->pPrev;
- }
- else
- {
- VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
- m_pItem = m_pList->Back();
- }
- return *this;
- }
+ iterator operator++(int) { iterator result = *this; ++*this; return result; }
+ iterator operator--(int) { iterator result = *this; --*this; return result; }
- iterator operator++(int)
- {
- iterator result = *this;
- ++*this;
- return result;
- }
- iterator operator--(int)
- {
- iterator result = *this;
- --*this;
- return result;
- }
-
- bool operator==(const iterator& rhs) const
- {
- VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- return m_pItem == rhs.m_pItem;
- }
- bool operator!=(const iterator& rhs) const
- {
- VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- return m_pItem != rhs.m_pItem;
- }
+ iterator& operator++() { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); m_pItem = m_pItem->pNext; return *this; }
+ iterator& operator--();
private:
VmaRawList* m_pList;
VmaListItem* m_pItem;
- iterator(VmaRawList* pList, VmaListItem* pItem) :
- m_pList(pList),
- m_pItem(pItem)
- {
- }
-
- friend class VmaList;
+ iterator(VmaRawList* pList, VmaListItem* pItem) : m_pList(pList), m_pItem(pItem) {}
};
-
class reverse_iterator
{
+ friend class VmaList;
public:
- reverse_iterator() :
- m_pList(VMA_NULL),
- m_pItem(VMA_NULL)
- {
- }
+ reverse_iterator() : m_pList(VMA_NULL), m_pItem(VMA_NULL) {}
+ reverse_iterator(const iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
- reverse_iterator(const iterator& src) :
- m_pList(src.m_pList),
- m_pItem(src.m_pItem)
- {
- }
+ T& operator*() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return m_pItem->Value; }
+ T* operator->() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return &m_pItem->Value; }
- T& operator*() const
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- return m_pItem->Value;
- }
- T* operator->() const
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- return &m_pItem->Value;
- }
+ bool operator==(const reverse_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem == rhs.m_pItem; }
+ bool operator!=(const reverse_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem != rhs.m_pItem; }
- reverse_iterator& operator++()
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- m_pItem = m_pItem->pPrev;
- return *this;
- }
- reverse_iterator& operator--()
- {
- if (m_pItem != VMA_NULL)
- {
- m_pItem = m_pItem->pNext;
- }
- else
- {
- VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
- m_pItem = m_pList->Front();
- }
- return *this;
- }
+ reverse_iterator operator++(int) { reverse_iterator result = *this; ++* this; return result; }
+ reverse_iterator operator--(int) { reverse_iterator result = *this; --* this; return result; }
- reverse_iterator operator++(int)
- {
- iterator result = *this;
- ++*this;
- return result;
- }
- reverse_iterator operator--(int)
- {
- iterator result = *this;
- --*this;
- return result;
- }
-
- bool operator==(const reverse_iterator& rhs) const
- {
- VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- return m_pItem == rhs.m_pItem;
- }
- bool operator!=(const reverse_iterator& rhs) const
- {
- VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- return m_pItem != rhs.m_pItem;
- }
+ reverse_iterator& operator++() { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); m_pItem = m_pItem->pPrev; return *this; }
+ reverse_iterator& operator--();
private:
VmaRawList* m_pList;
VmaListItem* m_pItem;
- reverse_iterator(VmaRawList* pList, VmaListItem* pItem) :
- m_pList(pList),
- m_pItem(pItem)
- {
- }
-
- friend class VmaList;
+ reverse_iterator(VmaRawList* pList, VmaListItem* pItem) : m_pList(pList), m_pItem(pItem) {}
};
-
class const_iterator
{
+ friend class VmaList;
public:
- const_iterator() :
- m_pList(VMA_NULL),
- m_pItem(VMA_NULL)
- {
- }
+ const_iterator() : m_pList(VMA_NULL), m_pItem(VMA_NULL) {}
+ const_iterator(const iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
+ const_iterator(const reverse_iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
- const_iterator(const iterator& src) :
- m_pList(src.m_pList),
- m_pItem(src.m_pItem)
- {
- }
+ const T& operator*() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return m_pItem->Value; }
+ const T* operator->() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return &m_pItem->Value; }
- const_iterator(const reverse_iterator& src) :
- m_pList(src.m_pList),
- m_pItem(src.m_pItem)
- {
- }
+ bool operator==(const const_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem == rhs.m_pItem; }
+ bool operator!=(const const_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem != rhs.m_pItem; }
- const T& operator*() const
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- return m_pItem->Value;
- }
- const T* operator->() const
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- return &m_pItem->Value;
- }
+ const_iterator operator++(int) { const_iterator result = *this; ++* this; return result; }
+ const_iterator operator--(int) { const_iterator result = *this; --* this; return result; }
- const_iterator& operator++()
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- m_pItem = m_pItem->pNext;
- return *this;
- }
- const_iterator& operator--()
- {
- if(m_pItem != VMA_NULL)
- {
- m_pItem = m_pItem->pPrev;
- }
- else
- {
- VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
- m_pItem = m_pList->Back();
- }
- return *this;
- }
-
- const_iterator operator++(int)
- {
- const_iterator result = *this;
- ++*this;
- return result;
- }
- const_iterator operator--(int)
- {
- const_iterator result = *this;
- --*this;
- return result;
- }
-
- bool operator==(const const_iterator& rhs) const
- {
- VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- return m_pItem == rhs.m_pItem;
- }
- bool operator!=(const const_iterator& rhs) const
- {
- VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- return m_pItem != rhs.m_pItem;
- }
+ const_iterator& operator++() { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); m_pItem = m_pItem->pNext; return *this; }
+ const_iterator& operator--();
private:
- const_iterator(const VmaRawList* pList, const VmaListItem* pItem) :
- m_pList(pList),
- m_pItem(pItem)
- {
- }
-
const VmaRawList* m_pList;
const VmaListItem* m_pItem;
- friend class VmaList;
+ const_iterator(const VmaRawList* pList, const VmaListItem* pItem) : m_pList(pList), m_pItem(pItem) {}
};
-
class const_reverse_iterator
{
+ friend class VmaList;
public:
- const_reverse_iterator() :
- m_pList(VMA_NULL),
- m_pItem(VMA_NULL)
- {
- }
+ const_reverse_iterator() : m_pList(VMA_NULL), m_pItem(VMA_NULL) {}
+ const_reverse_iterator(const reverse_iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
+ const_reverse_iterator(const iterator& src) : m_pList(src.m_pList), m_pItem(src.m_pItem) {}
- const_reverse_iterator(const reverse_iterator& src) :
- m_pList(src.m_pList),
- m_pItem(src.m_pItem)
- {
- }
+ const T& operator*() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return m_pItem->Value; }
+ const T* operator->() const { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); return &m_pItem->Value; }
- const_reverse_iterator(const iterator& src) :
- m_pList(src.m_pList),
- m_pItem(src.m_pItem)
- {
- }
+ bool operator==(const const_reverse_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem == rhs.m_pItem; }
+ bool operator!=(const const_reverse_iterator& rhs) const { VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem != rhs.m_pItem; }
- const T& operator*() const
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- return m_pItem->Value;
- }
- const T* operator->() const
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- return &m_pItem->Value;
- }
+ const_reverse_iterator operator++(int) { const_reverse_iterator result = *this; ++* this; return result; }
+ const_reverse_iterator operator--(int) { const_reverse_iterator result = *this; --* this; return result; }
- const_reverse_iterator& operator++()
- {
- VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- m_pItem = m_pItem->pPrev;
- return *this;
- }
- const_reverse_iterator& operator--()
- {
- if (m_pItem != VMA_NULL)
- {
- m_pItem = m_pItem->pNext;
- }
- else
- {
- VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
- m_pItem = m_pList->Back();
- }
- return *this;
- }
-
- const_reverse_iterator operator++(int)
- {
- const_reverse_iterator result = *this;
- ++*this;
- return result;
- }
- const_reverse_iterator operator--(int)
- {
- const_reverse_iterator result = *this;
- --*this;
- return result;
- }
-
- bool operator==(const const_reverse_iterator& rhs) const
- {
- VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- return m_pItem == rhs.m_pItem;
- }
- bool operator!=(const const_reverse_iterator& rhs) const
- {
- VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- return m_pItem != rhs.m_pItem;
- }
+ const_reverse_iterator& operator++() { VMA_HEAVY_ASSERT(m_pItem != VMA_NULL); m_pItem = m_pItem->pPrev; return *this; }
+ const_reverse_iterator& operator--();
private:
- const_reverse_iterator(const VmaRawList* pList, const VmaListItem* pItem) :
- m_pList(pList),
- m_pItem(pItem)
- {
- }
-
const VmaRawList* m_pList;
const VmaListItem* m_pItem;
- friend class VmaList;
+ const_reverse_iterator(const VmaRawList* pList, const VmaListItem* pItem) : m_pList(pList), m_pItem(pItem) {}
};
- VmaList(const AllocatorT& allocator) : m_RawList(allocator.m_pCallbacks) { }
+ VmaList(const AllocatorT& allocator) : m_RawList(allocator.m_pCallbacks) {}
bool empty() const { return m_RawList.IsEmpty(); }
size_t size() const { return m_RawList.GetCount(); }
@@ -4639,20 +4581,81 @@ public:
const_reverse_iterator rbegin() const { return crbegin(); }
const_reverse_iterator rend() const { return crend(); }
- void clear() { m_RawList.Clear(); }
void push_back(const T& value) { m_RawList.PushBack(value); }
- void erase(iterator it) { m_RawList.Remove(it.m_pItem); }
iterator insert(iterator it, const T& value) { return iterator(&m_RawList, m_RawList.InsertBefore(it.m_pItem, value)); }
+ void clear() { m_RawList.Clear(); }
+ void erase(iterator it) { m_RawList.Remove(it.m_pItem); }
+
private:
VmaRawList m_RawList;
};
-#endif // #if VMA_USE_STL_LIST
+#ifndef _VMA_LIST_FUNCTIONS
+template
+typename VmaList::iterator& VmaList::iterator::operator--()
+{
+ if (m_pItem != VMA_NULL)
+ {
+ m_pItem = m_pItem->pPrev;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
+ m_pItem = m_pList->Back();
+ }
+ return *this;
+}
-////////////////////////////////////////////////////////////////////////////////
-// class VmaIntrusiveLinkedList
+template
+typename VmaList::reverse_iterator& VmaList::reverse_iterator::operator--()
+{
+ if (m_pItem != VMA_NULL)
+ {
+ m_pItem = m_pItem->pNext;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
+ m_pItem = m_pList->Front();
+ }
+ return *this;
+}
+template
+typename VmaList::const_iterator& VmaList::const_iterator::operator--()
+{
+ if (m_pItem != VMA_NULL)
+ {
+ m_pItem = m_pItem->pPrev;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
+ m_pItem = m_pList->Back();
+ }
+ return *this;
+}
+
+template
+typename VmaList::const_reverse_iterator& VmaList::const_reverse_iterator::operator--()
+{
+ if (m_pItem != VMA_NULL)
+ {
+ m_pItem = m_pItem->pNext;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
+ m_pItem = m_pList->Back();
+ }
+ return *this;
+}
+#endif // _VMA_LIST_FUNCTIONS
+#endif // _VMA_LIST
+#endif // VMA_USE_STL_LIST
+
+#ifndef _VMA_INTRUSIVE_LINKED_LIST
/*
Expected interface of ItemTypeTraits:
struct MyItemTypeTraits
@@ -4671,203 +4674,234 @@ public:
typedef typename ItemTypeTraits::ItemType ItemType;
static ItemType* GetPrev(const ItemType* item) { return ItemTypeTraits::GetPrev(item); }
static ItemType* GetNext(const ItemType* item) { return ItemTypeTraits::GetNext(item); }
+
// Movable, not copyable.
VmaIntrusiveLinkedList() = default;
- VmaIntrusiveLinkedList(const VmaIntrusiveLinkedList& src) = delete;
- VmaIntrusiveLinkedList(VmaIntrusiveLinkedList&& src) :
- m_Front(src.m_Front), m_Back(src.m_Back), m_Count(src.m_Count)
- {
- src.m_Front = src.m_Back = VMA_NULL;
- src.m_Count = 0;
- }
- ~VmaIntrusiveLinkedList()
- {
- VMA_HEAVY_ASSERT(IsEmpty());
- }
- VmaIntrusiveLinkedList& operator=(const VmaIntrusiveLinkedList& src) = delete;
- VmaIntrusiveLinkedList& operator=(VmaIntrusiveLinkedList&& src)
- {
- if(&src != this)
- {
- VMA_HEAVY_ASSERT(IsEmpty());
- m_Front = src.m_Front;
- m_Back = src.m_Back;
- m_Count = src.m_Count;
- src.m_Front = src.m_Back = VMA_NULL;
- src.m_Count = 0;
- }
- return *this;
- }
- void RemoveAll()
- {
- if(!IsEmpty())
- {
- ItemType* item = m_Back;
- while(item != VMA_NULL)
- {
- ItemType* const prevItem = ItemTypeTraits::AccessPrev(item);
- ItemTypeTraits::AccessPrev(item) = VMA_NULL;
- ItemTypeTraits::AccessNext(item) = VMA_NULL;
- item = prevItem;
- }
- m_Front = VMA_NULL;
- m_Back = VMA_NULL;
- m_Count = 0;
- }
- }
+ VmaIntrusiveLinkedList(VmaIntrusiveLinkedList && src);
+ VmaIntrusiveLinkedList(const VmaIntrusiveLinkedList&) = delete;
+ VmaIntrusiveLinkedList& operator=(VmaIntrusiveLinkedList&& src);
+ VmaIntrusiveLinkedList& operator=(const VmaIntrusiveLinkedList&) = delete;
+ ~VmaIntrusiveLinkedList() { VMA_HEAVY_ASSERT(IsEmpty()); }
+
size_t GetCount() const { return m_Count; }
bool IsEmpty() const { return m_Count == 0; }
ItemType* Front() { return m_Front; }
- const ItemType* Front() const { return m_Front; }
ItemType* Back() { return m_Back; }
+ const ItemType* Front() const { return m_Front; }
const ItemType* Back() const { return m_Back; }
- void PushBack(ItemType* item)
- {
- VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
- if(IsEmpty())
- {
- m_Front = item;
- m_Back = item;
- m_Count = 1;
- }
- else
- {
- ItemTypeTraits::AccessPrev(item) = m_Back;
- ItemTypeTraits::AccessNext(m_Back) = item;
- m_Back = item;
- ++m_Count;
- }
- }
- void PushFront(ItemType* item)
- {
- VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
- if(IsEmpty())
- {
- m_Front = item;
- m_Back = item;
- m_Count = 1;
- }
- else
- {
- ItemTypeTraits::AccessNext(item) = m_Front;
- ItemTypeTraits::AccessPrev(m_Front) = item;
- m_Front = item;
- ++m_Count;
- }
- }
- ItemType* PopBack()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- ItemType* const backItem = m_Back;
- ItemType* const prevItem = ItemTypeTraits::GetPrev(backItem);
- if(prevItem != VMA_NULL)
- {
- ItemTypeTraits::AccessNext(prevItem) = VMA_NULL;
- }
- m_Back = prevItem;
- --m_Count;
- ItemTypeTraits::AccessPrev(backItem) = VMA_NULL;
- ItemTypeTraits::AccessNext(backItem) = VMA_NULL;
- return backItem;
- }
- ItemType* PopFront()
- {
- VMA_HEAVY_ASSERT(m_Count > 0);
- ItemType* const frontItem = m_Front;
- ItemType* const nextItem = ItemTypeTraits::GetNext(frontItem);
- if(nextItem != VMA_NULL)
- {
- ItemTypeTraits::AccessPrev(nextItem) = VMA_NULL;
- }
- m_Front = nextItem;
- --m_Count;
- ItemTypeTraits::AccessPrev(frontItem) = VMA_NULL;
- ItemTypeTraits::AccessNext(frontItem) = VMA_NULL;
- return frontItem;
- }
+
+ void PushBack(ItemType* item);
+ void PushFront(ItemType* item);
+ ItemType* PopBack();
+ ItemType* PopFront();
// MyItem can be null - it means PushBack.
- void InsertBefore(ItemType* existingItem, ItemType* newItem)
- {
- VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
- if(existingItem != VMA_NULL)
- {
- ItemType* const prevItem = ItemTypeTraits::GetPrev(existingItem);
- ItemTypeTraits::AccessPrev(newItem) = prevItem;
- ItemTypeTraits::AccessNext(newItem) = existingItem;
- ItemTypeTraits::AccessPrev(existingItem) = newItem;
- if(prevItem != VMA_NULL)
- {
- ItemTypeTraits::AccessNext(prevItem) = newItem;
- }
- else
- {
- VMA_HEAVY_ASSERT(m_Front == existingItem);
- m_Front = newItem;
- }
- ++m_Count;
- }
- else
- PushBack(newItem);
- }
+ void InsertBefore(ItemType* existingItem, ItemType* newItem);
// MyItem can be null - it means PushFront.
- void InsertAfter(ItemType* existingItem, ItemType* newItem)
- {
- VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
- if(existingItem != VMA_NULL)
- {
- ItemType* const nextItem = ItemTypeTraits::GetNext(existingItem);
- ItemTypeTraits::AccessNext(newItem) = nextItem;
- ItemTypeTraits::AccessPrev(newItem) = existingItem;
- ItemTypeTraits::AccessNext(existingItem) = newItem;
- if(nextItem != VMA_NULL)
- {
- ItemTypeTraits::AccessPrev(nextItem) = newItem;
- }
- else
- {
- VMA_HEAVY_ASSERT(m_Back == existingItem);
- m_Back = newItem;
- }
- ++m_Count;
- }
- else
- return PushFront(newItem);
- }
- void Remove(ItemType* item)
- {
- VMA_HEAVY_ASSERT(item != VMA_NULL && m_Count > 0);
- if(ItemTypeTraits::GetPrev(item) != VMA_NULL)
- {
- ItemTypeTraits::AccessNext(ItemTypeTraits::AccessPrev(item)) = ItemTypeTraits::GetNext(item);
- }
- else
- {
- VMA_HEAVY_ASSERT(m_Front == item);
- m_Front = ItemTypeTraits::GetNext(item);
- }
+ void InsertAfter(ItemType* existingItem, ItemType* newItem);
+ void Remove(ItemType* item);
+ void RemoveAll();
- if(ItemTypeTraits::GetNext(item) != VMA_NULL)
- {
- ItemTypeTraits::AccessPrev(ItemTypeTraits::AccessNext(item)) = ItemTypeTraits::GetPrev(item);
- }
- else
- {
- VMA_HEAVY_ASSERT(m_Back == item);
- m_Back = ItemTypeTraits::GetPrev(item);
- }
- ItemTypeTraits::AccessPrev(item) = VMA_NULL;
- ItemTypeTraits::AccessNext(item) = VMA_NULL;
- --m_Count;
- }
private:
ItemType* m_Front = VMA_NULL;
ItemType* m_Back = VMA_NULL;
size_t m_Count = 0;
};
-////////////////////////////////////////////////////////////////////////////////
-// class VmaMap
+#ifndef _VMA_INTRUSIVE_LINKED_LIST_FUNCTIONS
+template
+VmaIntrusiveLinkedList::VmaIntrusiveLinkedList(VmaIntrusiveLinkedList&& src)
+ : m_Front(src.m_Front), m_Back(src.m_Back), m_Count(src.m_Count)
+{
+ src.m_Front = src.m_Back = VMA_NULL;
+ src.m_Count = 0;
+}
+
+template
+VmaIntrusiveLinkedList& VmaIntrusiveLinkedList::operator=(VmaIntrusiveLinkedList&& src)
+{
+ if (&src != this)
+ {
+ VMA_HEAVY_ASSERT(IsEmpty());
+ m_Front = src.m_Front;
+ m_Back = src.m_Back;
+ m_Count = src.m_Count;
+ src.m_Front = src.m_Back = VMA_NULL;
+ src.m_Count = 0;
+ }
+ return *this;
+}
+
+template
+void VmaIntrusiveLinkedList::PushBack(ItemType* item)
+{
+ VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
+ if (IsEmpty())
+ {
+ m_Front = item;
+ m_Back = item;
+ m_Count = 1;
+ }
+ else
+ {
+ ItemTypeTraits::AccessPrev(item) = m_Back;
+ ItemTypeTraits::AccessNext(m_Back) = item;
+ m_Back = item;
+ ++m_Count;
+ }
+}
+
+template
+void VmaIntrusiveLinkedList::PushFront(ItemType* item)
+{
+ VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
+ if (IsEmpty())
+ {
+ m_Front = item;
+ m_Back = item;
+ m_Count = 1;
+ }
+ else
+ {
+ ItemTypeTraits::AccessNext(item) = m_Front;
+ ItemTypeTraits::AccessPrev(m_Front) = item;
+ m_Front = item;
+ ++m_Count;
+ }
+}
+
+template
+typename VmaIntrusiveLinkedList::ItemType* VmaIntrusiveLinkedList::PopBack()
+{
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ ItemType* const backItem = m_Back;
+ ItemType* const prevItem = ItemTypeTraits::GetPrev(backItem);
+ if (prevItem != VMA_NULL)
+ {
+ ItemTypeTraits::AccessNext(prevItem) = VMA_NULL;
+ }
+ m_Back = prevItem;
+ --m_Count;
+ ItemTypeTraits::AccessPrev(backItem) = VMA_NULL;
+ ItemTypeTraits::AccessNext(backItem) = VMA_NULL;
+ return backItem;
+}
+
+template
+typename VmaIntrusiveLinkedList::ItemType* VmaIntrusiveLinkedList::PopFront()
+{
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ ItemType* const frontItem = m_Front;
+ ItemType* const nextItem = ItemTypeTraits::GetNext(frontItem);
+ if (nextItem != VMA_NULL)
+ {
+ ItemTypeTraits::AccessPrev(nextItem) = VMA_NULL;
+ }
+ m_Front = nextItem;
+ --m_Count;
+ ItemTypeTraits::AccessPrev(frontItem) = VMA_NULL;
+ ItemTypeTraits::AccessNext(frontItem) = VMA_NULL;
+ return frontItem;
+}
+
+template
+void VmaIntrusiveLinkedList::InsertBefore(ItemType* existingItem, ItemType* newItem)
+{
+ VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
+ if (existingItem != VMA_NULL)
+ {
+ ItemType* const prevItem = ItemTypeTraits::GetPrev(existingItem);
+ ItemTypeTraits::AccessPrev(newItem) = prevItem;
+ ItemTypeTraits::AccessNext(newItem) = existingItem;
+ ItemTypeTraits::AccessPrev(existingItem) = newItem;
+ if (prevItem != VMA_NULL)
+ {
+ ItemTypeTraits::AccessNext(prevItem) = newItem;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(m_Front == existingItem);
+ m_Front = newItem;
+ }
+ ++m_Count;
+ }
+ else
+ PushBack(newItem);
+}
+
+template
+void VmaIntrusiveLinkedList::InsertAfter(ItemType* existingItem, ItemType* newItem)
+{
+ VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
+ if (existingItem != VMA_NULL)
+ {
+ ItemType* const nextItem = ItemTypeTraits::GetNext(existingItem);
+ ItemTypeTraits::AccessNext(newItem) = nextItem;
+ ItemTypeTraits::AccessPrev(newItem) = existingItem;
+ ItemTypeTraits::AccessNext(existingItem) = newItem;
+ if (nextItem != VMA_NULL)
+ {
+ ItemTypeTraits::AccessPrev(nextItem) = newItem;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(m_Back == existingItem);
+ m_Back = newItem;
+ }
+ ++m_Count;
+ }
+ else
+ return PushFront(newItem);
+}
+
+template
+void VmaIntrusiveLinkedList::Remove(ItemType* item)
+{
+ VMA_HEAVY_ASSERT(item != VMA_NULL && m_Count > 0);
+ if (ItemTypeTraits::GetPrev(item) != VMA_NULL)
+ {
+ ItemTypeTraits::AccessNext(ItemTypeTraits::AccessPrev(item)) = ItemTypeTraits::GetNext(item);
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(m_Front == item);
+ m_Front = ItemTypeTraits::GetNext(item);
+ }
+
+ if (ItemTypeTraits::GetNext(item) != VMA_NULL)
+ {
+ ItemTypeTraits::AccessPrev(ItemTypeTraits::AccessNext(item)) = ItemTypeTraits::GetPrev(item);
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(m_Back == item);
+ m_Back = ItemTypeTraits::GetPrev(item);
+ }
+ ItemTypeTraits::AccessPrev(item) = VMA_NULL;
+ ItemTypeTraits::AccessNext(item) = VMA_NULL;
+ --m_Count;
+}
+
+template
+void VmaIntrusiveLinkedList::RemoveAll()
+{
+ if (!IsEmpty())
+ {
+ ItemType* item = m_Back;
+ while (item != VMA_NULL)
+ {
+ ItemType* const prevItem = ItemTypeTraits::AccessPrev(item);
+ ItemTypeTraits::AccessPrev(item) = VMA_NULL;
+ ItemTypeTraits::AccessNext(item) = VMA_NULL;
+ item = prevItem;
+ }
+ m_Front = VMA_NULL;
+ m_Back = VMA_NULL;
+ m_Count = 0;
+ }
+}
+#endif // _VMA_INTRUSIVE_LINKED_LIST_FUNCTIONS
+#endif // _VMA_INTRUSIVE_LINKED_LIST
// Unused in this version.
#if 0
@@ -4948,7 +4982,7 @@ VmaPair* VmaMap::find(const KeyT& key)
m_Vector.data() + m_Vector.size(),
key,
VmaPairFirstLess());
- if((it != m_Vector.end()) && (it->first == key))
+ if ((it != m_Vector.end()) && (it->first == key))
{
return it;
}
@@ -4968,21 +5002,487 @@ void VmaMap::erase(iterator it)
#endif // #if 0
-////////////////////////////////////////////////////////////////////////////////
+#if !defined(_VMA_STRING_BUILDER) && VMA_STATS_STRING_ENABLED
+class VmaStringBuilder
+{
+public:
+ VmaStringBuilder(const VkAllocationCallbacks* allocationCallbacks) : m_Data(VmaStlAllocator(allocationCallbacks)) {}
+ ~VmaStringBuilder() = default;
-class VmaDeviceMemoryBlock;
+ size_t GetLength() const { return m_Data.size(); }
+ const char* GetData() const { return m_Data.data(); }
+ void AddNewLine() { Add('\n'); }
+ void Add(char ch) { m_Data.push_back(ch); }
-enum VMA_CACHE_OPERATION { VMA_CACHE_FLUSH, VMA_CACHE_INVALIDATE };
+ void Add(const char* pStr);
+ void AddNumber(uint32_t num);
+ void AddNumber(uint64_t num);
+ void AddPointer(const void* ptr);
+private:
+ VmaVector> m_Data;
+};
+
+#ifndef _VMA_STRING_BUILDER_FUNCTIONS
+void VmaStringBuilder::Add(const char* pStr)
+{
+ const size_t strLen = strlen(pStr);
+ if (strLen > 0)
+ {
+ const size_t oldCount = m_Data.size();
+ m_Data.resize(oldCount + strLen);
+ memcpy(m_Data.data() + oldCount, pStr, strLen);
+ }
+}
+
+void VmaStringBuilder::AddNumber(uint32_t num)
+{
+ char buf[11];
+ buf[10] = '\0';
+ char* p = &buf[10];
+ do
+ {
+ *--p = '0' + (num % 10);
+ num /= 10;
+ } while (num);
+ Add(p);
+}
+
+void VmaStringBuilder::AddNumber(uint64_t num)
+{
+ char buf[21];
+ buf[20] = '\0';
+ char* p = &buf[20];
+ do
+ {
+ *--p = '0' + (num % 10);
+ num /= 10;
+ } while (num);
+ Add(p);
+}
+
+void VmaStringBuilder::AddPointer(const void* ptr)
+{
+ char buf[21];
+ VmaPtrToStr(buf, sizeof(buf), ptr);
+ Add(buf);
+}
+#endif //_VMA_STRING_BUILDER_FUNCTIONS
+#endif // _VMA_STRING_BUILDER
+
+#if !defined(_VMA_JSON_WRITER) && VMA_STATS_STRING_ENABLED
+class VmaJsonWriter
+{
+ VMA_CLASS_NO_COPY(VmaJsonWriter)
+public:
+ VmaJsonWriter(const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb);
+ ~VmaJsonWriter();
+
+ void BeginObject(bool singleLine = false);
+ void EndObject();
+
+ void BeginArray(bool singleLine = false);
+ void EndArray();
+
+ void WriteString(const char* pStr);
+ void BeginString(const char* pStr = VMA_NULL);
+ void ContinueString(const char* pStr);
+ void ContinueString(uint32_t n);
+ void ContinueString(uint64_t n);
+ void ContinueString_Pointer(const void* ptr);
+ void EndString(const char* pStr = VMA_NULL);
+
+ void WriteNumber(uint32_t n);
+ void WriteNumber(uint64_t n);
+ void WriteBool(bool b);
+ void WriteNull();
+
+private:
+ enum COLLECTION_TYPE
+ {
+ COLLECTION_TYPE_OBJECT,
+ COLLECTION_TYPE_ARRAY,
+ };
+ struct StackItem
+ {
+ COLLECTION_TYPE type;
+ uint32_t valueCount;
+ bool singleLineMode;
+ };
+
+ static const char* const INDENT;
+
+ VmaStringBuilder& m_SB;
+ VmaVector< StackItem, VmaStlAllocator