diff --git a/docs/html/allocation_annotation.html b/docs/html/allocation_annotation.html
index 312e409..7980ec7 100644
--- a/docs/html/allocation_annotation.html
+++ b/docs/html/allocation_annotation.html
@@ -94,8 +94,8 @@ Allocation user data
MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.
pUserData;
-
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3229
-
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:3278
+
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3236
+
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:3285
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.
diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html
index 2d9ec9a..28aaa0b 100644
--- a/docs/html/custom_memory_pools.html
+++ b/docs/html/custom_memory_pools.html
@@ -108,7 +108,7 @@ $(function() {
Definition: vk_mem_alloc.h:2879
VmaPool pool
Pool that this allocation should be created in.
Definition: vk_mem_alloc.h:2911
Represents single memory allocation.
-Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3229
+Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3236
Describes parameter of created VmaPool.
Definition: vk_mem_alloc.h:3047
uint32_t memoryTypeIndex
Vulkan memory type index to allocate this pool from.
Definition: vk_mem_alloc.h:3050
size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition: vk_mem_alloc.h:3075
diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html
index 3174fd0..b557288 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:3229
+Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3236
Represents main object of this library initialized.
Represents Opaque object that represents started defragmentation process.
-Parameters for defragmentation.
Definition: vk_mem_alloc.h:3628
-uint32_t allocationCount
Number of allocations in pAllocations array.
Definition: vk_mem_alloc.h:3634
-VkBool32 * pAllocationsChanged
Optional, output. Pointer to array that will be filled with information whether the allocation at cer...
Definition: vk_mem_alloc.h:3649
-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:3678
-const VmaAllocation * pAllocations
Pointer to array of allocations that can be defragmented.
Definition: vk_mem_alloc.h:3643
-VkDeviceSize maxCpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3673
+Parameters for defragmentation.
Definition: vk_mem_alloc.h:3635
+uint32_t allocationCount
Number of allocations in pAllocations array.
Definition: vk_mem_alloc.h:3641
+VkBool32 * pAllocationsChanged
Optional, output. Pointer to array that will be filled with information whether the allocation at cer...
Definition: vk_mem_alloc.h:3656
+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:3685
+const VmaAllocation * pAllocations
Pointer to array of allocations that can be defragmented.
Definition: vk_mem_alloc.h:3650
+VkDeviceSize maxCpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3680
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:3688
-VkDeviceSize maxGpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3683
-VkCommandBuffer commandBuffer
Optional. Command buffer where GPU copy commands will be posted.
Definition: vk_mem_alloc.h:3697
+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:3695
+VkDeviceSize maxGpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3690
+VkCommandBuffer commandBuffer
Optional. Command buffer where GPU copy commands will be posted.
Definition: vk_mem_alloc.h:3704
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/functions.html b/docs/html/functions.html
index e6facd2..bfbc17d 100644
--- a/docs/html/functions.html
+++ b/docs/html/functions.html
@@ -195,6 +195,9 @@ $(function() {
memoryTypeIndex
: VmaPoolCreateInfo
+minAllocationAlignment
+: VmaPoolCreateInfo
+
minBlockCount
: VmaPoolCreateInfo
diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html
index f6a20f2..620d4a6 100644
--- a/docs/html/functions_vars.html
+++ b/docs/html/functions_vars.html
@@ -195,6 +195,9 @@ $(function() {
memoryTypeIndex
: VmaPoolCreateInfo
+minAllocationAlignment
+: VmaPoolCreateInfo
+
minBlockCount
: VmaPoolCreateInfo
diff --git a/docs/html/index.html b/docs/html/index.html
index 81203d8..f11d8b4 100644
--- a/docs/html/index.html
+++ b/docs/html/index.html
@@ -65,7 +65,7 @@ $(function() {
Vulkan Memory Allocator
-
Version 3.0.0-development (2021-02-16)
+
Version 3.0.0-development (2021-06-18)
Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved.
License: MIT
Documentation of all members: vk_mem_alloc.h
diff --git a/docs/html/memory_mapping.html b/docs/html/memory_mapping.html
index 4204b48..61ea351 100644
--- a/docs/html/memory_mapping.html
+++ b/docs/html/memory_mapping.html
@@ -119,8 +119,8 @@ Persistently mapped memory
Definition: vk_mem_alloc.h:2879
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:2887
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:2881
-
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3229
-
void * pMappedData
Pointer to the beginning of this allocation as mapped data.
Definition: vk_mem_alloc.h:3273
+
Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3236
+
void * pMappedData
Pointer to the beginning of this allocation as mapped data.
Definition: vk_mem_alloc.h:3280
@ VMA_MEMORY_USAGE_CPU_ONLY
Definition: vk_mem_alloc.h:2731
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:2798
@@ -168,7 +168,7 @@ 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:2897
-
uint32_t memoryType
Memory type index that this allocation was allocated from.
Definition: vk_mem_alloc.h:3234
+
uint32_t memoryType
Memory type index that this allocation was allocated from.
Definition: vk_mem_alloc.h:3241
void vmaGetMemoryTypeProperties(VmaAllocator allocator, uint32_t memoryTypeIndex, VkMemoryPropertyFlags *pFlags)
Given Memory Type Index, returns Property Flags of this memory type.
@ VMA_MEMORY_USAGE_GPU_ONLY
Definition: vk_mem_alloc.h:2721
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:
diff --git a/docs/html/search/all_10.js b/docs/html/search/all_10.js
index 730aac6..965c60c 100644
--- a/docs/html/search/all_10.js
+++ b/docs/html/search/all_10.js
@@ -1,11 +1,11 @@
var searchData=
[
- ['unusedbytes_77',['unusedBytes',['../struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669',1,'VmaStatInfo']]],
- ['unusedrangecount_78',['unusedRangeCount',['../struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9',1,'VmaStatInfo::unusedRangeCount()'],['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()']]],
- ['unusedrangesizeavg_79',['unusedRangeSizeAvg',['../struct_vma_stat_info.html#a2f9b3452af90c9768a30b7fb6ae194fc',1,'VmaStatInfo']]],
- ['unusedrangesizemax_80',['unusedRangeSizeMax',['../struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4',1,'VmaStatInfo::unusedRangeSizeMax()'],['../struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b',1,'VmaPoolStats::unusedRangeSizeMax()']]],
- ['unusedrangesizemin_81',['unusedRangeSizeMin',['../struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4',1,'VmaStatInfo']]],
- ['unusedsize_82',['unusedSize',['../struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8',1,'VmaPoolStats']]],
- ['usage_83',['usage',['../struct_vma_budget.html#a84dd1ecca8b0110259eb206dbadb11f6',1,'VmaBudget::usage()'],['../struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910',1,'VmaAllocationCreateInfo::usage()']]],
- ['usedbytes_84',['usedBytes',['../struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a',1,'VmaStatInfo']]]
+ ['unusedbytes_78',['unusedBytes',['../struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669',1,'VmaStatInfo']]],
+ ['unusedrangecount_79',['unusedRangeCount',['../struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9',1,'VmaStatInfo::unusedRangeCount()'],['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()']]],
+ ['unusedrangesizeavg_80',['unusedRangeSizeAvg',['../struct_vma_stat_info.html#a2f9b3452af90c9768a30b7fb6ae194fc',1,'VmaStatInfo']]],
+ ['unusedrangesizemax_81',['unusedRangeSizeMax',['../struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4',1,'VmaStatInfo::unusedRangeSizeMax()'],['../struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b',1,'VmaPoolStats::unusedRangeSizeMax()']]],
+ ['unusedrangesizemin_82',['unusedRangeSizeMin',['../struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4',1,'VmaStatInfo']]],
+ ['unusedsize_83',['unusedSize',['../struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8',1,'VmaPoolStats']]],
+ ['usage_84',['usage',['../struct_vma_budget.html#a84dd1ecca8b0110259eb206dbadb11f6',1,'VmaBudget::usage()'],['../struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910',1,'VmaAllocationCreateInfo::usage()']]],
+ ['usedbytes_85',['usedBytes',['../struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a',1,'VmaStatInfo']]]
];
diff --git a/docs/html/search/all_11.js b/docs/html/search/all_11.js
index 75a2986..60801bb 100644
--- a/docs/html/search/all_11.js
+++ b/docs/html/search/all_11.js
@@ -1,158 +1,158 @@
var searchData=
[
- ['vk_5famd_5fdevice_5fcoherent_5fmemory_85',['VK_AMD_device_coherent_memory',['../vk_amd_device_coherent_memory.html',1,'index']]],
- ['vk_5fkhr_5fdedicated_5fallocation_86',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]],
- ['vk_5fmem_5falloc_2eh_87',['vk_mem_alloc.h',['../vk__mem__alloc_8h.html',1,'']]],
- ['vkallocatememory_88',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]],
- ['vkbindbuffermemory_89',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]],
- ['vkbindimagememory_90',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]],
- ['vkcmdcopybuffer_91',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]],
- ['vkcreatebuffer_92',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]],
- ['vkcreateimage_93',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]],
- ['vkdestroybuffer_94',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]],
- ['vkdestroyimage_95',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]],
- ['vkflushmappedmemoryranges_96',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]],
- ['vkfreememory_97',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]],
- ['vkgetbuffermemoryrequirements_98',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]],
- ['vkgetimagememoryrequirements_99',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]],
- ['vkgetphysicaldevicememoryproperties_100',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]],
- ['vkgetphysicaldeviceproperties_101',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]],
- ['vkinvalidatemappedmemoryranges_102',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]],
- ['vkmapmemory_103',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]],
- ['vkunmapmemory_104',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]],
- ['vma_5fallocation_5fcreate_5fcan_5fbecome_5flost_5fbit_105',['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_106',['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_107',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_108',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_109',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fmapped_5fbit_110',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_111',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_112',['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_113',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fmask_114',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_115',['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_116',['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_117',['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_118',['VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad242a04f802e25fef0b880afe8bb0a62',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fupper_5faddress_5fbit_119',['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_120',['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_121',['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_122',['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_123',['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_124',['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_125',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7caffdd7a5169be3dbd7cbf6b3619e4f78a',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fexternally_5fsynchronized_5fbit_126',['VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fflag_5fbits_5fmax_5fenum_127',['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_128',['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_129',['VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878',1,'vk_mem_alloc.h']]],
- ['vma_5fbind_5fmemory2_130',['VMA_BIND_MEMORY2',['../vk__mem__alloc_8h.html#a88bef97f86d70a34a4c0746e09a2680d',1,'vk_mem_alloc.h']]],
- ['vma_5fbuffer_5fdevice_5faddress_131',['VMA_BUFFER_DEVICE_ADDRESS',['../vk__mem__alloc_8h.html#a7f9d5e71b70dd1a137c303a8a8262c10',1,'vk_mem_alloc.h']]],
- ['vma_5fdedicated_5fallocation_132',['VMA_DEDICATED_ALLOCATION',['../vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4',1,'vk_mem_alloc.h']]],
- ['vma_5fdefragmentation_5fflag_5fbits_5fmax_5fenum_133',['VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50cab87ec33154803bfeb5ac2b379f1d6a97',1,'vk_mem_alloc.h']]],
- ['vma_5fdefragmentation_5fflag_5fincremental_134',['VMA_DEFRAGMENTATION_FLAG_INCREMENTAL',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50ca31af49446af2459284a568ce2f3fdd33',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fbudget_135',['VMA_MEMORY_BUDGET',['../vk__mem__alloc_8h.html#a05decf1cf4ebf767beba7acca6c1ec3a',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fpriority_136',['VMA_MEMORY_PRIORITY',['../vk__mem__alloc_8h.html#a81af8a3a87e34bbb493848143cde43e4',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fcpu_5fcopy_137',['VMA_MEMORY_USAGE_CPU_COPY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca416a444d4d0fc20067c3f76f32ff2500',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fcpu_5fonly_138',['VMA_MEMORY_USAGE_CPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fcpu_5fto_5fgpu_139',['VMA_MEMORY_USAGE_CPU_TO_GPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fgpu_5flazily_5fallocated_140',['VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca835333d9072db63a653818030e17614d',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fgpu_5fonly_141',['VMA_MEMORY_USAGE_GPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fgpu_5fto_5fcpu_142',['VMA_MEMORY_USAGE_GPU_TO_CPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca7b586d2fdaf82a463b58f581ed72be27',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fmax_5fenum_143',['VMA_MEMORY_USAGE_MAX_ENUM',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5funknown_144',['VMA_MEMORY_USAGE_UNKNOWN',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5falgorithm_5fmask_145',['VMA_POOL_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7af4d270f8f42517a0f70037ceb6ac1d9c',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5fbuddy_5falgorithm_5fbit_146',['VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a97a0dc38e5161b780594d998d313d35e',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_147',['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_148',['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_149',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]],
- ['vma_5frecord_5fflag_5fbits_5fmax_5fenum_150',['VMA_RECORD_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e',1,'vk_mem_alloc.h']]],
- ['vma_5frecord_5fflush_5fafter_5fcall_5fbit_151',['VMA_RECORD_FLUSH_AFTER_CALL_BIT',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7',1,'vk_mem_alloc.h']]],
- ['vma_5frecording_5fenabled_152',['VMA_RECORDING_ENABLED',['../vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c',1,'vk_mem_alloc.h']]],
- ['vma_5fstats_5fstring_5fenabled_153',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]],
- ['vma_5fvulkan_5fversion_154',['VMA_VULKAN_VERSION',['../vk__mem__alloc_8h.html#a1a2407c283893638cc039bb31fcd74b6',1,'vk_mem_alloc.h']]],
- ['vmaallocatememory_155',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]],
- ['vmaallocatememoryforbuffer_156',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]],
- ['vmaallocatememoryforimage_157',['vmaAllocateMemoryForImage',['../vk__mem__alloc_8h.html#a0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]],
- ['vmaallocatememorypages_158',['vmaAllocateMemoryPages',['../vk__mem__alloc_8h.html#ad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]],
- ['vmaallocation_159',['VmaAllocation',['../struct_vma_allocation.html',1,'']]],
- ['vmaallocationcreateflagbits_160',['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_161',['VmaAllocationCreateFlags',['../vk__mem__alloc_8h.html#a5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]],
- ['vmaallocationcreateinfo_162',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'VmaAllocationCreateInfo'],['../vk__mem__alloc_8h.html#a3bf110892ea2fb4649fedb68488d026a',1,'VmaAllocationCreateInfo(): vk_mem_alloc.h']]],
- ['vmaallocationinfo_163',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'VmaAllocationInfo'],['../vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50',1,'VmaAllocationInfo(): vk_mem_alloc.h']]],
- ['vmaallocator_164',['VmaAllocator',['../struct_vma_allocator.html',1,'']]],
- ['vmaallocatorcreateflagbits_165',['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_166',['VmaAllocatorCreateFlags',['../vk__mem__alloc_8h.html#acfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]],
- ['vmaallocatorcreateinfo_167',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'VmaAllocatorCreateInfo'],['../vk__mem__alloc_8h.html#aad9652301d33759b83e52d4f3605a14a',1,'VmaAllocatorCreateInfo(): vk_mem_alloc.h']]],
- ['vmaallocatorinfo_168',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'VmaAllocatorInfo'],['../vk__mem__alloc_8h.html#a1988031b0223fdbd564250fa1edd942c',1,'VmaAllocatorInfo(): vk_mem_alloc.h']]],
- ['vmabegindefragmentationpass_169',['vmaBeginDefragmentationPass',['../vk__mem__alloc_8h.html#ac0f01545b6262f7d4d128fc8f8e5c77b',1,'vk_mem_alloc.h']]],
- ['vmabindbuffermemory_170',['vmaBindBufferMemory',['../vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]],
- ['vmabindbuffermemory2_171',['vmaBindBufferMemory2',['../vk__mem__alloc_8h.html#a927c944f45e0f2941182abb6f608e64a',1,'vk_mem_alloc.h']]],
- ['vmabindimagememory_172',['vmaBindImageMemory',['../vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]],
- ['vmabindimagememory2_173',['vmaBindImageMemory2',['../vk__mem__alloc_8h.html#aa8251ee81b0045a443e35b8e8aa021bc',1,'vk_mem_alloc.h']]],
- ['vmabudget_174',['VmaBudget',['../struct_vma_budget.html',1,'VmaBudget'],['../vk__mem__alloc_8h.html#aa078667e71b1ef24e87a6a30d128381d',1,'VmaBudget(): vk_mem_alloc.h']]],
- ['vmabuildstatsstring_175',['vmaBuildStatsString',['../vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]],
- ['vmacalculatestats_176',['vmaCalculateStats',['../vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3',1,'vk_mem_alloc.h']]],
- ['vmacheckcorruption_177',['vmaCheckCorruption',['../vk__mem__alloc_8h.html#a49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]],
- ['vmacheckpoolcorruption_178',['vmaCheckPoolCorruption',['../vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]],
- ['vmacreateallocator_179',['vmaCreateAllocator',['../vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]],
- ['vmacreatebuffer_180',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]],
- ['vmacreateimage_181',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]],
- ['vmacreatelostallocation_182',['vmaCreateLostAllocation',['../vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1',1,'vk_mem_alloc.h']]],
- ['vmacreatepool_183',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]],
- ['vmadefragment_184',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationbegin_185',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationcontext_186',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]],
- ['vmadefragmentationend_187',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationflagbits_188',['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_189',['VmaDefragmentationFlags',['../vk__mem__alloc_8h.html#a88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationinfo_190',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'VmaDefragmentationInfo'],['../vk__mem__alloc_8h.html#a2bf47f96bf92bed2a49461bd9af3acfa',1,'VmaDefragmentationInfo(): vk_mem_alloc.h']]],
- ['vmadefragmentationinfo2_191',['VmaDefragmentationInfo2',['../struct_vma_defragmentation_info2.html',1,'VmaDefragmentationInfo2'],['../vk__mem__alloc_8h.html#ad6daeffaa670ce6d11a203a6224c9937',1,'VmaDefragmentationInfo2(): vk_mem_alloc.h']]],
- ['vmadefragmentationpassinfo_192',['VmaDefragmentationPassInfo',['../struct_vma_defragmentation_pass_info.html',1,'VmaDefragmentationPassInfo'],['../vk__mem__alloc_8h.html#a72aebd522242d56abea67b4f47f6549e',1,'VmaDefragmentationPassInfo(): vk_mem_alloc.h']]],
- ['vmadefragmentationpassmoveinfo_193',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'VmaDefragmentationPassMoveInfo'],['../vk__mem__alloc_8h.html#ad6799e8e2b1527abfc84d33bc44aeaf5',1,'VmaDefragmentationPassMoveInfo(): vk_mem_alloc.h']]],
- ['vmadefragmentationstats_194',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'VmaDefragmentationStats'],['../vk__mem__alloc_8h.html#ad94034192259c2e34a4d1c5e27810403',1,'VmaDefragmentationStats(): vk_mem_alloc.h']]],
- ['vmadestroyallocator_195',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]],
- ['vmadestroybuffer_196',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]],
- ['vmadestroyimage_197',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]],
- ['vmadestroypool_198',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]],
- ['vmadevicememorycallbacks_199',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'VmaDeviceMemoryCallbacks'],['../vk__mem__alloc_8h.html#a77692d3c8770ea8882d573206bd27b2b',1,'VmaDeviceMemoryCallbacks(): vk_mem_alloc.h']]],
- ['vmaenddefragmentationpass_200',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindex_201',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindexforbufferinfo_202',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindexforimageinfo_203',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]],
- ['vmaflushallocation_204',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]],
- ['vmaflushallocations_205',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]],
- ['vmafreememory_206',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]],
- ['vmafreememorypages_207',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]],
- ['vmafreestatsstring_208',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]],
- ['vmagetallocationinfo_209',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]],
- ['vmagetallocatorinfo_210',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]],
- ['vmagetbudget_211',['vmaGetBudget',['../vk__mem__alloc_8h.html#aec0ed24ebea2d0099eed5f801daaefba',1,'vk_mem_alloc.h']]],
- ['vmagetmemoryproperties_212',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]],
- ['vmagetmemorytypeproperties_213',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]],
- ['vmagetphysicaldeviceproperties_214',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]],
- ['vmagetpoolname_215',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]],
- ['vmagetpoolstats_216',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]],
- ['vmainvalidateallocation_217',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]],
- ['vmainvalidateallocations_218',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]],
- ['vmamakepoolallocationslost_219',['vmaMakePoolAllocationsLost',['../vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024',1,'vk_mem_alloc.h']]],
- ['vmamapmemory_220',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]],
- ['vmamemoryusage_221',['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_222',['VmaPool',['../struct_vma_pool.html',1,'']]],
- ['vmapoolcreateflagbits_223',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a4d4f2efc2509157a9e4ecd4fd7942303',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h']]],
- ['vmapoolcreateflags_224',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]],
- ['vmapoolcreateinfo_225',['VmaPoolCreateInfo',['../vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67',1,'VmaPoolCreateInfo(): vk_mem_alloc.h'],['../struct_vma_pool_create_info.html',1,'VmaPoolCreateInfo']]],
- ['vmapoolstats_226',['VmaPoolStats',['../struct_vma_pool_stats.html',1,'VmaPoolStats'],['../vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1',1,'VmaPoolStats(): vk_mem_alloc.h']]],
- ['vmarecordflagbits_227',['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_228',['VmaRecordFlags',['../vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828',1,'vk_mem_alloc.h']]],
- ['vmarecordsettings_229',['VmaRecordSettings',['../struct_vma_record_settings.html',1,'VmaRecordSettings'],['../vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc',1,'VmaRecordSettings(): vk_mem_alloc.h']]],
- ['vmasetallocationuserdata_230',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]],
- ['vmasetcurrentframeindex_231',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]],
- ['vmasetpoolname_232',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]],
- ['vmastatinfo_233',['VmaStatInfo',['../struct_vma_stat_info.html',1,'VmaStatInfo'],['../vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878',1,'VmaStatInfo(): vk_mem_alloc.h']]],
- ['vmastats_234',['VmaStats',['../struct_vma_stats.html',1,'VmaStats'],['../vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034',1,'VmaStats(): vk_mem_alloc.h']]],
- ['vmatouchallocation_235',['vmaTouchAllocation',['../vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a',1,'vk_mem_alloc.h']]],
- ['vmaunmapmemory_236',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]],
- ['vmavulkanfunctions_237',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074',1,'VmaVulkanFunctions(): vk_mem_alloc.h'],['../struct_vma_vulkan_functions.html',1,'VmaVulkanFunctions']]],
- ['vulkan_20memory_20allocator_238',['Vulkan Memory Allocator',['../index.html',1,'']]],
- ['vulkanapiversion_239',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]]
+ ['vk_5famd_5fdevice_5fcoherent_5fmemory_86',['VK_AMD_device_coherent_memory',['../vk_amd_device_coherent_memory.html',1,'index']]],
+ ['vk_5fkhr_5fdedicated_5fallocation_87',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]],
+ ['vk_5fmem_5falloc_2eh_88',['vk_mem_alloc.h',['../vk__mem__alloc_8h.html',1,'']]],
+ ['vkallocatememory_89',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]],
+ ['vkbindbuffermemory_90',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]],
+ ['vkbindimagememory_91',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]],
+ ['vkcmdcopybuffer_92',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]],
+ ['vkcreatebuffer_93',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]],
+ ['vkcreateimage_94',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]],
+ ['vkdestroybuffer_95',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]],
+ ['vkdestroyimage_96',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]],
+ ['vkflushmappedmemoryranges_97',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]],
+ ['vkfreememory_98',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]],
+ ['vkgetbuffermemoryrequirements_99',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]],
+ ['vkgetimagememoryrequirements_100',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]],
+ ['vkgetphysicaldevicememoryproperties_101',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]],
+ ['vkgetphysicaldeviceproperties_102',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]],
+ ['vkinvalidatemappedmemoryranges_103',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]],
+ ['vkmapmemory_104',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]],
+ ['vkunmapmemory_105',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]],
+ ['vma_5fallocation_5fcreate_5fcan_5fbecome_5flost_5fbit_106',['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_107',['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_108',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_109',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_110',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fmapped_5fbit_111',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_112',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_113',['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_114',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fmask_115',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_116',['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_117',['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_118',['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_119',['VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad242a04f802e25fef0b880afe8bb0a62',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fupper_5faddress_5fbit_120',['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_121',['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_122',['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_123',['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_124',['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_125',['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_126',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7caffdd7a5169be3dbd7cbf6b3619e4f78a',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fexternally_5fsynchronized_5fbit_127',['VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fflag_5fbits_5fmax_5fenum_128',['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_129',['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_130',['VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878',1,'vk_mem_alloc.h']]],
+ ['vma_5fbind_5fmemory2_131',['VMA_BIND_MEMORY2',['../vk__mem__alloc_8h.html#a88bef97f86d70a34a4c0746e09a2680d',1,'vk_mem_alloc.h']]],
+ ['vma_5fbuffer_5fdevice_5faddress_132',['VMA_BUFFER_DEVICE_ADDRESS',['../vk__mem__alloc_8h.html#a7f9d5e71b70dd1a137c303a8a8262c10',1,'vk_mem_alloc.h']]],
+ ['vma_5fdedicated_5fallocation_133',['VMA_DEDICATED_ALLOCATION',['../vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4',1,'vk_mem_alloc.h']]],
+ ['vma_5fdefragmentation_5fflag_5fbits_5fmax_5fenum_134',['VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50cab87ec33154803bfeb5ac2b379f1d6a97',1,'vk_mem_alloc.h']]],
+ ['vma_5fdefragmentation_5fflag_5fincremental_135',['VMA_DEFRAGMENTATION_FLAG_INCREMENTAL',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50ca31af49446af2459284a568ce2f3fdd33',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fbudget_136',['VMA_MEMORY_BUDGET',['../vk__mem__alloc_8h.html#a05decf1cf4ebf767beba7acca6c1ec3a',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fpriority_137',['VMA_MEMORY_PRIORITY',['../vk__mem__alloc_8h.html#a81af8a3a87e34bbb493848143cde43e4',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fcpu_5fcopy_138',['VMA_MEMORY_USAGE_CPU_COPY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca416a444d4d0fc20067c3f76f32ff2500',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fcpu_5fonly_139',['VMA_MEMORY_USAGE_CPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fcpu_5fto_5fgpu_140',['VMA_MEMORY_USAGE_CPU_TO_GPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fgpu_5flazily_5fallocated_141',['VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca835333d9072db63a653818030e17614d',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fgpu_5fonly_142',['VMA_MEMORY_USAGE_GPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fgpu_5fto_5fcpu_143',['VMA_MEMORY_USAGE_GPU_TO_CPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca7b586d2fdaf82a463b58f581ed72be27',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fmax_5fenum_144',['VMA_MEMORY_USAGE_MAX_ENUM',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5funknown_145',['VMA_MEMORY_USAGE_UNKNOWN',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5falgorithm_5fmask_146',['VMA_POOL_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7af4d270f8f42517a0f70037ceb6ac1d9c',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5fbuddy_5falgorithm_5fbit_147',['VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a97a0dc38e5161b780594d998d313d35e',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_148',['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_149',['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_150',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]],
+ ['vma_5frecord_5fflag_5fbits_5fmax_5fenum_151',['VMA_RECORD_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e',1,'vk_mem_alloc.h']]],
+ ['vma_5frecord_5fflush_5fafter_5fcall_5fbit_152',['VMA_RECORD_FLUSH_AFTER_CALL_BIT',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7',1,'vk_mem_alloc.h']]],
+ ['vma_5frecording_5fenabled_153',['VMA_RECORDING_ENABLED',['../vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c',1,'vk_mem_alloc.h']]],
+ ['vma_5fstats_5fstring_5fenabled_154',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]],
+ ['vma_5fvulkan_5fversion_155',['VMA_VULKAN_VERSION',['../vk__mem__alloc_8h.html#a1a2407c283893638cc039bb31fcd74b6',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememory_156',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememoryforbuffer_157',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememoryforimage_158',['vmaAllocateMemoryForImage',['../vk__mem__alloc_8h.html#a0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememorypages_159',['vmaAllocateMemoryPages',['../vk__mem__alloc_8h.html#ad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]],
+ ['vmaallocation_160',['VmaAllocation',['../struct_vma_allocation.html',1,'']]],
+ ['vmaallocationcreateflagbits_161',['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_162',['VmaAllocationCreateFlags',['../vk__mem__alloc_8h.html#a5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]],
+ ['vmaallocationcreateinfo_163',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'VmaAllocationCreateInfo'],['../vk__mem__alloc_8h.html#a3bf110892ea2fb4649fedb68488d026a',1,'VmaAllocationCreateInfo(): vk_mem_alloc.h']]],
+ ['vmaallocationinfo_164',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'VmaAllocationInfo'],['../vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50',1,'VmaAllocationInfo(): vk_mem_alloc.h']]],
+ ['vmaallocator_165',['VmaAllocator',['../struct_vma_allocator.html',1,'']]],
+ ['vmaallocatorcreateflagbits_166',['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_167',['VmaAllocatorCreateFlags',['../vk__mem__alloc_8h.html#acfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]],
+ ['vmaallocatorcreateinfo_168',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'VmaAllocatorCreateInfo'],['../vk__mem__alloc_8h.html#aad9652301d33759b83e52d4f3605a14a',1,'VmaAllocatorCreateInfo(): vk_mem_alloc.h']]],
+ ['vmaallocatorinfo_169',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'VmaAllocatorInfo'],['../vk__mem__alloc_8h.html#a1988031b0223fdbd564250fa1edd942c',1,'VmaAllocatorInfo(): vk_mem_alloc.h']]],
+ ['vmabegindefragmentationpass_170',['vmaBeginDefragmentationPass',['../vk__mem__alloc_8h.html#ac0f01545b6262f7d4d128fc8f8e5c77b',1,'vk_mem_alloc.h']]],
+ ['vmabindbuffermemory_171',['vmaBindBufferMemory',['../vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]],
+ ['vmabindbuffermemory2_172',['vmaBindBufferMemory2',['../vk__mem__alloc_8h.html#a927c944f45e0f2941182abb6f608e64a',1,'vk_mem_alloc.h']]],
+ ['vmabindimagememory_173',['vmaBindImageMemory',['../vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]],
+ ['vmabindimagememory2_174',['vmaBindImageMemory2',['../vk__mem__alloc_8h.html#aa8251ee81b0045a443e35b8e8aa021bc',1,'vk_mem_alloc.h']]],
+ ['vmabudget_175',['VmaBudget',['../struct_vma_budget.html',1,'VmaBudget'],['../vk__mem__alloc_8h.html#aa078667e71b1ef24e87a6a30d128381d',1,'VmaBudget(): vk_mem_alloc.h']]],
+ ['vmabuildstatsstring_176',['vmaBuildStatsString',['../vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]],
+ ['vmacalculatestats_177',['vmaCalculateStats',['../vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3',1,'vk_mem_alloc.h']]],
+ ['vmacheckcorruption_178',['vmaCheckCorruption',['../vk__mem__alloc_8h.html#a49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]],
+ ['vmacheckpoolcorruption_179',['vmaCheckPoolCorruption',['../vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]],
+ ['vmacreateallocator_180',['vmaCreateAllocator',['../vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]],
+ ['vmacreatebuffer_181',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]],
+ ['vmacreateimage_182',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]],
+ ['vmacreatelostallocation_183',['vmaCreateLostAllocation',['../vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1',1,'vk_mem_alloc.h']]],
+ ['vmacreatepool_184',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]],
+ ['vmadefragment_185',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationbegin_186',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationcontext_187',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]],
+ ['vmadefragmentationend_188',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationflagbits_189',['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_190',['VmaDefragmentationFlags',['../vk__mem__alloc_8h.html#a88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationinfo_191',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'VmaDefragmentationInfo'],['../vk__mem__alloc_8h.html#a2bf47f96bf92bed2a49461bd9af3acfa',1,'VmaDefragmentationInfo(): vk_mem_alloc.h']]],
+ ['vmadefragmentationinfo2_192',['VmaDefragmentationInfo2',['../struct_vma_defragmentation_info2.html',1,'VmaDefragmentationInfo2'],['../vk__mem__alloc_8h.html#ad6daeffaa670ce6d11a203a6224c9937',1,'VmaDefragmentationInfo2(): vk_mem_alloc.h']]],
+ ['vmadefragmentationpassinfo_193',['VmaDefragmentationPassInfo',['../struct_vma_defragmentation_pass_info.html',1,'VmaDefragmentationPassInfo'],['../vk__mem__alloc_8h.html#a72aebd522242d56abea67b4f47f6549e',1,'VmaDefragmentationPassInfo(): vk_mem_alloc.h']]],
+ ['vmadefragmentationpassmoveinfo_194',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'VmaDefragmentationPassMoveInfo'],['../vk__mem__alloc_8h.html#ad6799e8e2b1527abfc84d33bc44aeaf5',1,'VmaDefragmentationPassMoveInfo(): vk_mem_alloc.h']]],
+ ['vmadefragmentationstats_195',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'VmaDefragmentationStats'],['../vk__mem__alloc_8h.html#ad94034192259c2e34a4d1c5e27810403',1,'VmaDefragmentationStats(): vk_mem_alloc.h']]],
+ ['vmadestroyallocator_196',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]],
+ ['vmadestroybuffer_197',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]],
+ ['vmadestroyimage_198',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]],
+ ['vmadestroypool_199',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]],
+ ['vmadevicememorycallbacks_200',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'VmaDeviceMemoryCallbacks'],['../vk__mem__alloc_8h.html#a77692d3c8770ea8882d573206bd27b2b',1,'VmaDeviceMemoryCallbacks(): vk_mem_alloc.h']]],
+ ['vmaenddefragmentationpass_201',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindex_202',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindexforbufferinfo_203',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindexforimageinfo_204',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]],
+ ['vmaflushallocation_205',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]],
+ ['vmaflushallocations_206',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]],
+ ['vmafreememory_207',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]],
+ ['vmafreememorypages_208',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]],
+ ['vmafreestatsstring_209',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]],
+ ['vmagetallocationinfo_210',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]],
+ ['vmagetallocatorinfo_211',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]],
+ ['vmagetbudget_212',['vmaGetBudget',['../vk__mem__alloc_8h.html#aec0ed24ebea2d0099eed5f801daaefba',1,'vk_mem_alloc.h']]],
+ ['vmagetmemoryproperties_213',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]],
+ ['vmagetmemorytypeproperties_214',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]],
+ ['vmagetphysicaldeviceproperties_215',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]],
+ ['vmagetpoolname_216',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]],
+ ['vmagetpoolstats_217',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]],
+ ['vmainvalidateallocation_218',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]],
+ ['vmainvalidateallocations_219',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]],
+ ['vmamakepoolallocationslost_220',['vmaMakePoolAllocationsLost',['../vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024',1,'vk_mem_alloc.h']]],
+ ['vmamapmemory_221',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]],
+ ['vmamemoryusage_222',['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_223',['VmaPool',['../struct_vma_pool.html',1,'']]],
+ ['vmapoolcreateflagbits_224',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a4d4f2efc2509157a9e4ecd4fd7942303',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h']]],
+ ['vmapoolcreateflags_225',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]],
+ ['vmapoolcreateinfo_226',['VmaPoolCreateInfo',['../vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67',1,'VmaPoolCreateInfo(): vk_mem_alloc.h'],['../struct_vma_pool_create_info.html',1,'VmaPoolCreateInfo']]],
+ ['vmapoolstats_227',['VmaPoolStats',['../struct_vma_pool_stats.html',1,'VmaPoolStats'],['../vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1',1,'VmaPoolStats(): vk_mem_alloc.h']]],
+ ['vmarecordflagbits_228',['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_229',['VmaRecordFlags',['../vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828',1,'vk_mem_alloc.h']]],
+ ['vmarecordsettings_230',['VmaRecordSettings',['../struct_vma_record_settings.html',1,'VmaRecordSettings'],['../vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc',1,'VmaRecordSettings(): vk_mem_alloc.h']]],
+ ['vmasetallocationuserdata_231',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]],
+ ['vmasetcurrentframeindex_232',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]],
+ ['vmasetpoolname_233',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]],
+ ['vmastatinfo_234',['VmaStatInfo',['../struct_vma_stat_info.html',1,'VmaStatInfo'],['../vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878',1,'VmaStatInfo(): vk_mem_alloc.h']]],
+ ['vmastats_235',['VmaStats',['../struct_vma_stats.html',1,'VmaStats'],['../vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034',1,'VmaStats(): vk_mem_alloc.h']]],
+ ['vmatouchallocation_236',['vmaTouchAllocation',['../vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a',1,'vk_mem_alloc.h']]],
+ ['vmaunmapmemory_237',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]],
+ ['vmavulkanfunctions_238',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074',1,'VmaVulkanFunctions(): vk_mem_alloc.h'],['../struct_vma_vulkan_functions.html',1,'VmaVulkanFunctions']]],
+ ['vulkan_20memory_20allocator_239',['Vulkan Memory Allocator',['../index.html',1,'']]],
+ ['vulkanapiversion_240',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]]
];
diff --git a/docs/html/search/all_9.js b/docs/html/search/all_9.js
index d88c966..a976c0a 100644
--- a/docs/html/search/all_9.js
+++ b/docs/html/search/all_9.js
@@ -13,6 +13,7 @@ var searchData=
['memorytype_40',['memoryType',['../struct_vma_stats.html#a13e3caf754be79352c42408756309331',1,'VmaStats::memoryType()'],['../struct_vma_allocation_info.html#a7f6b0aa58c135e488e6b40a388dad9d5',1,'VmaAllocationInfo::memoryType()']]],
['memorytypebits_41',['memoryTypeBits',['../struct_vma_allocation_create_info.html#a3bf940c0271d85d6ba32a4d820075055',1,'VmaAllocationCreateInfo']]],
['memorytypeindex_42',['memoryTypeIndex',['../struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319',1,'VmaPoolCreateInfo']]],
- ['minblockcount_43',['minBlockCount',['../struct_vma_pool_create_info.html#ad8006fb803185c0a699d30f3e9a865ae',1,'VmaPoolCreateInfo']]],
- ['movecount_44',['moveCount',['../struct_vma_defragmentation_pass_info.html#ac1086e657ba995f8d1f4e49b83dcfb6c',1,'VmaDefragmentationPassInfo']]]
+ ['minallocationalignment_43',['minAllocationAlignment',['../struct_vma_pool_create_info.html#ade3eca546f0c6ab4e8fbf20eb6d854cb',1,'VmaPoolCreateInfo']]],
+ ['minblockcount_44',['minBlockCount',['../struct_vma_pool_create_info.html#ad8006fb803185c0a699d30f3e9a865ae',1,'VmaPoolCreateInfo']]],
+ ['movecount_45',['moveCount',['../struct_vma_defragmentation_pass_info.html#ac1086e657ba995f8d1f4e49b83dcfb6c',1,'VmaDefragmentationPassInfo']]]
];
diff --git a/docs/html/search/all_a.js b/docs/html/search/all_a.js
index 4612195..25ff2bb 100644
--- a/docs/html/search/all_a.js
+++ b/docs/html/search/all_a.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['offset_45',['offset',['../struct_vma_allocation_info.html#a4a3c732388dbdc7a23f9365b00825268',1,'VmaAllocationInfo::offset()'],['../struct_vma_defragmentation_pass_move_info.html#a8ab4508bc03625b0653c880576be96c6',1,'VmaDefragmentationPassMoveInfo::offset()']]]
+ ['offset_46',['offset',['../struct_vma_allocation_info.html#a4a3c732388dbdc7a23f9365b00825268',1,'VmaAllocationInfo::offset()'],['../struct_vma_defragmentation_pass_move_info.html#a8ab4508bc03625b0653c880576be96c6',1,'VmaDefragmentationPassMoveInfo::offset()']]]
];
diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js
index 9907bb7..1abd24f 100644
--- a/docs/html/search/all_b.js
+++ b/docs/html/search/all_b.js
@@ -1,25 +1,25 @@
var searchData=
[
- ['pallocationcallbacks_46',['pAllocationCallbacks',['../struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d',1,'VmaAllocatorCreateInfo']]],
- ['pallocations_47',['pAllocations',['../struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32',1,'VmaDefragmentationInfo2']]],
- ['pallocationschanged_48',['pAllocationsChanged',['../struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc',1,'VmaDefragmentationInfo2']]],
- ['pdevicememorycallbacks_49',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]],
- ['pfilepath_50',['pFilePath',['../struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d',1,'VmaRecordSettings']]],
- ['pfn_5fvmaallocatedevicememoryfunction_51',['PFN_vmaAllocateDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a7e1ed85f7799600b03ad51a77acc21f3',1,'vk_mem_alloc.h']]],
- ['pfn_5fvmafreedevicememoryfunction_52',['PFN_vmaFreeDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a154ccaaf53dc2c36378f80f0c4f3679b',1,'vk_mem_alloc.h']]],
- ['pfnallocate_53',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]],
- ['pfnfree_54',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]],
- ['pheapsizelimit_55',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]],
- ['physicaldevice_56',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo::physicalDevice()'],['../struct_vma_allocator_info.html#aba2b703f96e51d567717e1fb2935b47a',1,'VmaAllocatorInfo::physicalDevice()']]],
- ['pmappeddata_57',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]],
- ['pmoves_58',['pMoves',['../struct_vma_defragmentation_pass_info.html#acbd42d4a3357999da130a95cd99a3792',1,'VmaDefragmentationPassInfo']]],
- ['pool_59',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]],
- ['poolcount_60',['poolCount',['../struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d',1,'VmaDefragmentationInfo2']]],
- ['ppools_61',['pPools',['../struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b',1,'VmaDefragmentationInfo2']]],
- ['precordsettings_62',['pRecordSettings',['../struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee',1,'VmaAllocatorCreateInfo']]],
- ['preferredflags_63',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]],
- ['preferredlargeheapblocksize_64',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]],
- ['priority_65',['priority',['../struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7',1,'VmaAllocationCreateInfo::priority()'],['../struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274',1,'VmaPoolCreateInfo::priority()']]],
- ['puserdata_66',['pUserData',['../struct_vma_device_memory_callbacks.html#a24052de0937ddd54015a2df0363903c6',1,'VmaDeviceMemoryCallbacks::pUserData()'],['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()']]],
- ['pvulkanfunctions_67',['pVulkanFunctions',['../struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd',1,'VmaAllocatorCreateInfo']]]
+ ['pallocationcallbacks_47',['pAllocationCallbacks',['../struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d',1,'VmaAllocatorCreateInfo']]],
+ ['pallocations_48',['pAllocations',['../struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32',1,'VmaDefragmentationInfo2']]],
+ ['pallocationschanged_49',['pAllocationsChanged',['../struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc',1,'VmaDefragmentationInfo2']]],
+ ['pdevicememorycallbacks_50',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]],
+ ['pfilepath_51',['pFilePath',['../struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d',1,'VmaRecordSettings']]],
+ ['pfn_5fvmaallocatedevicememoryfunction_52',['PFN_vmaAllocateDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a7e1ed85f7799600b03ad51a77acc21f3',1,'vk_mem_alloc.h']]],
+ ['pfn_5fvmafreedevicememoryfunction_53',['PFN_vmaFreeDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a154ccaaf53dc2c36378f80f0c4f3679b',1,'vk_mem_alloc.h']]],
+ ['pfnallocate_54',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]],
+ ['pfnfree_55',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]],
+ ['pheapsizelimit_56',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]],
+ ['physicaldevice_57',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo::physicalDevice()'],['../struct_vma_allocator_info.html#aba2b703f96e51d567717e1fb2935b47a',1,'VmaAllocatorInfo::physicalDevice()']]],
+ ['pmappeddata_58',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]],
+ ['pmoves_59',['pMoves',['../struct_vma_defragmentation_pass_info.html#acbd42d4a3357999da130a95cd99a3792',1,'VmaDefragmentationPassInfo']]],
+ ['pool_60',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]],
+ ['poolcount_61',['poolCount',['../struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d',1,'VmaDefragmentationInfo2']]],
+ ['ppools_62',['pPools',['../struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b',1,'VmaDefragmentationInfo2']]],
+ ['precordsettings_63',['pRecordSettings',['../struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee',1,'VmaAllocatorCreateInfo']]],
+ ['preferredflags_64',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]],
+ ['preferredlargeheapblocksize_65',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]],
+ ['priority_66',['priority',['../struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7',1,'VmaAllocationCreateInfo::priority()'],['../struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274',1,'VmaPoolCreateInfo::priority()']]],
+ ['puserdata_67',['pUserData',['../struct_vma_device_memory_callbacks.html#a24052de0937ddd54015a2df0363903c6',1,'VmaDeviceMemoryCallbacks::pUserData()'],['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()']]],
+ ['pvulkanfunctions_68',['pVulkanFunctions',['../struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd',1,'VmaAllocatorCreateInfo']]]
];
diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js
index d58e218..e916746 100644
--- a/docs/html/search/all_c.js
+++ b/docs/html/search/all_c.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['quick_20start_68',['Quick start',['../quick_start.html',1,'index']]]
+ ['quick_20start_69',['Quick start',['../quick_start.html',1,'index']]]
];
diff --git a/docs/html/search/all_d.js b/docs/html/search/all_d.js
index 1d3630a..4e822a9 100644
--- a/docs/html/search/all_d.js
+++ b/docs/html/search/all_d.js
@@ -1,7 +1,7 @@
var searchData=
[
- ['recommended_20usage_20patterns_69',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
- ['record_20and_20replay_70',['Record and replay',['../record_and_replay.html',1,'index']]],
- ['requiredflags_71',['requiredFlags',['../struct_vma_allocation_create_info.html#a9166390303ff42d783305bc31c2b6b90',1,'VmaAllocationCreateInfo']]],
- ['resource_20aliasing_20_28overlap_29_72',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
+ ['recommended_20usage_20patterns_70',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
+ ['record_20and_20replay_71',['Record and replay',['../record_and_replay.html',1,'index']]],
+ ['requiredflags_72',['requiredFlags',['../struct_vma_allocation_create_info.html#a9166390303ff42d783305bc31c2b6b90',1,'VmaAllocationCreateInfo']]],
+ ['resource_20aliasing_20_28overlap_29_73',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
];
diff --git a/docs/html/search/all_e.js b/docs/html/search/all_e.js
index 03fa2d8..8ac7675 100644
--- a/docs/html/search/all_e.js
+++ b/docs/html/search/all_e.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['size_73',['size',['../struct_vma_pool_stats.html#a326807b2de2b0931cee4ed9a5f2e420c',1,'VmaPoolStats::size()'],['../struct_vma_allocation_info.html#aac76d113a6a5ccbb09fea00fb25fd18f',1,'VmaAllocationInfo::size()']]],
- ['statistics_74',['Statistics',['../statistics.html',1,'index']]],
- ['staying_20within_20budget_75',['Staying within budget',['../staying_within_budget.html',1,'index']]]
+ ['size_74',['size',['../struct_vma_pool_stats.html#a326807b2de2b0931cee4ed9a5f2e420c',1,'VmaPoolStats::size()'],['../struct_vma_allocation_info.html#aac76d113a6a5ccbb09fea00fb25fd18f',1,'VmaAllocationInfo::size()']]],
+ ['statistics_75',['Statistics',['../statistics.html',1,'index']]],
+ ['staying_20within_20budget_76',['Staying within budget',['../staying_within_budget.html',1,'index']]]
];
diff --git a/docs/html/search/all_f.js b/docs/html/search/all_f.js
index be734f5..8f8506c 100644
--- a/docs/html/search/all_f.js
+++ b/docs/html/search/all_f.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['total_76',['total',['../struct_vma_stats.html#a2e8f5b3353f2fefef3c27f29e245a1f9',1,'VmaStats']]]
+ ['total_77',['total',['../struct_vma_stats.html#a2e8f5b3353f2fefef3c27f29e245a1f9',1,'VmaStats']]]
];
diff --git a/docs/html/search/classes_0.js b/docs/html/search/classes_0.js
index f7b0e84..3944cca 100644
--- a/docs/html/search/classes_0.js
+++ b/docs/html/search/classes_0.js
@@ -1,24 +1,24 @@
var searchData=
[
- ['vmaallocation_240',['VmaAllocation',['../struct_vma_allocation.html',1,'']]],
- ['vmaallocationcreateinfo_241',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'']]],
- ['vmaallocationinfo_242',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'']]],
- ['vmaallocator_243',['VmaAllocator',['../struct_vma_allocator.html',1,'']]],
- ['vmaallocatorcreateinfo_244',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'']]],
- ['vmaallocatorinfo_245',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'']]],
- ['vmabudget_246',['VmaBudget',['../struct_vma_budget.html',1,'']]],
- ['vmadefragmentationcontext_247',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]],
- ['vmadefragmentationinfo_248',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'']]],
- ['vmadefragmentationinfo2_249',['VmaDefragmentationInfo2',['../struct_vma_defragmentation_info2.html',1,'']]],
- ['vmadefragmentationpassinfo_250',['VmaDefragmentationPassInfo',['../struct_vma_defragmentation_pass_info.html',1,'']]],
- ['vmadefragmentationpassmoveinfo_251',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'']]],
- ['vmadefragmentationstats_252',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'']]],
- ['vmadevicememorycallbacks_253',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'']]],
- ['vmapool_254',['VmaPool',['../struct_vma_pool.html',1,'']]],
- ['vmapoolcreateinfo_255',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'']]],
- ['vmapoolstats_256',['VmaPoolStats',['../struct_vma_pool_stats.html',1,'']]],
- ['vmarecordsettings_257',['VmaRecordSettings',['../struct_vma_record_settings.html',1,'']]],
- ['vmastatinfo_258',['VmaStatInfo',['../struct_vma_stat_info.html',1,'']]],
- ['vmastats_259',['VmaStats',['../struct_vma_stats.html',1,'']]],
- ['vmavulkanfunctions_260',['VmaVulkanFunctions',['../struct_vma_vulkan_functions.html',1,'']]]
+ ['vmaallocation_241',['VmaAllocation',['../struct_vma_allocation.html',1,'']]],
+ ['vmaallocationcreateinfo_242',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'']]],
+ ['vmaallocationinfo_243',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'']]],
+ ['vmaallocator_244',['VmaAllocator',['../struct_vma_allocator.html',1,'']]],
+ ['vmaallocatorcreateinfo_245',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'']]],
+ ['vmaallocatorinfo_246',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'']]],
+ ['vmabudget_247',['VmaBudget',['../struct_vma_budget.html',1,'']]],
+ ['vmadefragmentationcontext_248',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]],
+ ['vmadefragmentationinfo_249',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'']]],
+ ['vmadefragmentationinfo2_250',['VmaDefragmentationInfo2',['../struct_vma_defragmentation_info2.html',1,'']]],
+ ['vmadefragmentationpassinfo_251',['VmaDefragmentationPassInfo',['../struct_vma_defragmentation_pass_info.html',1,'']]],
+ ['vmadefragmentationpassmoveinfo_252',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'']]],
+ ['vmadefragmentationstats_253',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'']]],
+ ['vmadevicememorycallbacks_254',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'']]],
+ ['vmapool_255',['VmaPool',['../struct_vma_pool.html',1,'']]],
+ ['vmapoolcreateinfo_256',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'']]],
+ ['vmapoolstats_257',['VmaPoolStats',['../struct_vma_pool_stats.html',1,'']]],
+ ['vmarecordsettings_258',['VmaRecordSettings',['../struct_vma_record_settings.html',1,'']]],
+ ['vmastatinfo_259',['VmaStatInfo',['../struct_vma_stat_info.html',1,'']]],
+ ['vmastats_260',['VmaStats',['../struct_vma_stats.html',1,'']]],
+ ['vmavulkanfunctions_261',['VmaVulkanFunctions',['../struct_vma_vulkan_functions.html',1,'']]]
];
diff --git a/docs/html/search/defines_0.js b/docs/html/search/defines_0.js
index 34117b3..1f59a46 100644
--- a/docs/html/search/defines_0.js
+++ b/docs/html/search/defines_0.js
@@ -1,11 +1,11 @@
var searchData=
[
- ['vma_5fbind_5fmemory2_475',['VMA_BIND_MEMORY2',['../vk__mem__alloc_8h.html#a88bef97f86d70a34a4c0746e09a2680d',1,'vk_mem_alloc.h']]],
- ['vma_5fbuffer_5fdevice_5faddress_476',['VMA_BUFFER_DEVICE_ADDRESS',['../vk__mem__alloc_8h.html#a7f9d5e71b70dd1a137c303a8a8262c10',1,'vk_mem_alloc.h']]],
- ['vma_5fdedicated_5fallocation_477',['VMA_DEDICATED_ALLOCATION',['../vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fbudget_478',['VMA_MEMORY_BUDGET',['../vk__mem__alloc_8h.html#a05decf1cf4ebf767beba7acca6c1ec3a',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fpriority_479',['VMA_MEMORY_PRIORITY',['../vk__mem__alloc_8h.html#a81af8a3a87e34bbb493848143cde43e4',1,'vk_mem_alloc.h']]],
- ['vma_5frecording_5fenabled_480',['VMA_RECORDING_ENABLED',['../vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c',1,'vk_mem_alloc.h']]],
- ['vma_5fstats_5fstring_5fenabled_481',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]],
- ['vma_5fvulkan_5fversion_482',['VMA_VULKAN_VERSION',['../vk__mem__alloc_8h.html#a1a2407c283893638cc039bb31fcd74b6',1,'vk_mem_alloc.h']]]
+ ['vma_5fbind_5fmemory2_477',['VMA_BIND_MEMORY2',['../vk__mem__alloc_8h.html#a88bef97f86d70a34a4c0746e09a2680d',1,'vk_mem_alloc.h']]],
+ ['vma_5fbuffer_5fdevice_5faddress_478',['VMA_BUFFER_DEVICE_ADDRESS',['../vk__mem__alloc_8h.html#a7f9d5e71b70dd1a137c303a8a8262c10',1,'vk_mem_alloc.h']]],
+ ['vma_5fdedicated_5fallocation_479',['VMA_DEDICATED_ALLOCATION',['../vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fbudget_480',['VMA_MEMORY_BUDGET',['../vk__mem__alloc_8h.html#a05decf1cf4ebf767beba7acca6c1ec3a',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fpriority_481',['VMA_MEMORY_PRIORITY',['../vk__mem__alloc_8h.html#a81af8a3a87e34bbb493848143cde43e4',1,'vk_mem_alloc.h']]],
+ ['vma_5frecording_5fenabled_482',['VMA_RECORDING_ENABLED',['../vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c',1,'vk_mem_alloc.h']]],
+ ['vma_5fstats_5fstring_5fenabled_483',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]],
+ ['vma_5fvulkan_5fversion_484',['VMA_VULKAN_VERSION',['../vk__mem__alloc_8h.html#a1a2407c283893638cc039bb31fcd74b6',1,'vk_mem_alloc.h']]]
];
diff --git a/docs/html/search/enums_0.js b/docs/html/search/enums_0.js
index 734333c..b676710 100644
--- a/docs/html/search/enums_0.js
+++ b/docs/html/search/enums_0.js
@@ -1,9 +1,9 @@
var searchData=
[
- ['vmaallocationcreateflagbits_427',['VmaAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597',1,'vk_mem_alloc.h']]],
- ['vmaallocatorcreateflagbits_428',['VmaAllocatorCreateFlagBits',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7c',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationflagbits_429',['VmaDefragmentationFlagBits',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50c',1,'vk_mem_alloc.h']]],
- ['vmamemoryusage_430',['VmaMemoryUsage',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc',1,'vk_mem_alloc.h']]],
- ['vmapoolcreateflagbits_431',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'vk_mem_alloc.h']]],
- ['vmarecordflagbits_432',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2',1,'vk_mem_alloc.h']]]
+ ['vmaallocationcreateflagbits_429',['VmaAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597',1,'vk_mem_alloc.h']]],
+ ['vmaallocatorcreateflagbits_430',['VmaAllocatorCreateFlagBits',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7c',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationflagbits_431',['VmaDefragmentationFlagBits',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50c',1,'vk_mem_alloc.h']]],
+ ['vmamemoryusage_432',['VmaMemoryUsage',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc',1,'vk_mem_alloc.h']]],
+ ['vmapoolcreateflagbits_433',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'vk_mem_alloc.h']]],
+ ['vmarecordflagbits_434',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2',1,'vk_mem_alloc.h']]]
];
diff --git a/docs/html/search/enumvalues_0.js b/docs/html/search/enumvalues_0.js
index 74bac7a..575bac2 100644
--- a/docs/html/search/enumvalues_0.js
+++ b/docs/html/search/enumvalues_0.js
@@ -1,45 +1,45 @@
var searchData=
[
- ['vma_5fallocation_5fcreate_5fcan_5fbecome_5flost_5fbit_433',['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_434',['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_435',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_436',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_437',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fmapped_5fbit_438',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_439',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_440',['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_441',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fmask_442',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_443',['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_444',['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_445',['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_446',['VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad242a04f802e25fef0b880afe8bb0a62',1,'vk_mem_alloc.h']]],
- ['vma_5fallocation_5fcreate_5fupper_5faddress_5fbit_447',['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_448',['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_449',['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_450',['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_451',['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_452',['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_453',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7caffdd7a5169be3dbd7cbf6b3619e4f78a',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fexternally_5fsynchronized_5fbit_454',['VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d',1,'vk_mem_alloc.h']]],
- ['vma_5fallocator_5fcreate_5fflag_5fbits_5fmax_5fenum_455',['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_456',['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_457',['VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878',1,'vk_mem_alloc.h']]],
- ['vma_5fdefragmentation_5fflag_5fbits_5fmax_5fenum_458',['VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50cab87ec33154803bfeb5ac2b379f1d6a97',1,'vk_mem_alloc.h']]],
- ['vma_5fdefragmentation_5fflag_5fincremental_459',['VMA_DEFRAGMENTATION_FLAG_INCREMENTAL',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50ca31af49446af2459284a568ce2f3fdd33',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fcpu_5fcopy_460',['VMA_MEMORY_USAGE_CPU_COPY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca416a444d4d0fc20067c3f76f32ff2500',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fcpu_5fonly_461',['VMA_MEMORY_USAGE_CPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fcpu_5fto_5fgpu_462',['VMA_MEMORY_USAGE_CPU_TO_GPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fgpu_5flazily_5fallocated_463',['VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca835333d9072db63a653818030e17614d',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fgpu_5fonly_464',['VMA_MEMORY_USAGE_GPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fgpu_5fto_5fcpu_465',['VMA_MEMORY_USAGE_GPU_TO_CPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca7b586d2fdaf82a463b58f581ed72be27',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5fmax_5fenum_466',['VMA_MEMORY_USAGE_MAX_ENUM',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]],
- ['vma_5fmemory_5fusage_5funknown_467',['VMA_MEMORY_USAGE_UNKNOWN',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5falgorithm_5fmask_468',['VMA_POOL_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7af4d270f8f42517a0f70037ceb6ac1d9c',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5fbuddy_5falgorithm_5fbit_469',['VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a97a0dc38e5161b780594d998d313d35e',1,'vk_mem_alloc.h']]],
- ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_470',['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_471',['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_472',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]],
- ['vma_5frecord_5fflag_5fbits_5fmax_5fenum_473',['VMA_RECORD_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e',1,'vk_mem_alloc.h']]],
- ['vma_5frecord_5fflush_5fafter_5fcall_5fbit_474',['VMA_RECORD_FLUSH_AFTER_CALL_BIT',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7',1,'vk_mem_alloc.h']]]
+ ['vma_5fallocation_5fcreate_5fcan_5fbecome_5flost_5fbit_435',['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_436',['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_437',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_438',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_439',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fmapped_5fbit_440',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_441',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_442',['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_443',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fmask_444',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_445',['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_446',['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_447',['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_448',['VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad242a04f802e25fef0b880afe8bb0a62',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocation_5fcreate_5fupper_5faddress_5fbit_449',['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_450',['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_451',['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_452',['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_453',['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_454',['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_455',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7caffdd7a5169be3dbd7cbf6b3619e4f78a',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fexternally_5fsynchronized_5fbit_456',['VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d',1,'vk_mem_alloc.h']]],
+ ['vma_5fallocator_5fcreate_5fflag_5fbits_5fmax_5fenum_457',['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_458',['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_459',['VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878',1,'vk_mem_alloc.h']]],
+ ['vma_5fdefragmentation_5fflag_5fbits_5fmax_5fenum_460',['VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50cab87ec33154803bfeb5ac2b379f1d6a97',1,'vk_mem_alloc.h']]],
+ ['vma_5fdefragmentation_5fflag_5fincremental_461',['VMA_DEFRAGMENTATION_FLAG_INCREMENTAL',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50ca31af49446af2459284a568ce2f3fdd33',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fcpu_5fcopy_462',['VMA_MEMORY_USAGE_CPU_COPY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca416a444d4d0fc20067c3f76f32ff2500',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fcpu_5fonly_463',['VMA_MEMORY_USAGE_CPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fcpu_5fto_5fgpu_464',['VMA_MEMORY_USAGE_CPU_TO_GPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fgpu_5flazily_5fallocated_465',['VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca835333d9072db63a653818030e17614d',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fgpu_5fonly_466',['VMA_MEMORY_USAGE_GPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fgpu_5fto_5fcpu_467',['VMA_MEMORY_USAGE_GPU_TO_CPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca7b586d2fdaf82a463b58f581ed72be27',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5fmax_5fenum_468',['VMA_MEMORY_USAGE_MAX_ENUM',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]],
+ ['vma_5fmemory_5fusage_5funknown_469',['VMA_MEMORY_USAGE_UNKNOWN',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5falgorithm_5fmask_470',['VMA_POOL_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7af4d270f8f42517a0f70037ceb6ac1d9c',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5fbuddy_5falgorithm_5fbit_471',['VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a97a0dc38e5161b780594d998d313d35e',1,'vk_mem_alloc.h']]],
+ ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_472',['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_473',['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_474',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]],
+ ['vma_5frecord_5fflag_5fbits_5fmax_5fenum_475',['VMA_RECORD_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e',1,'vk_mem_alloc.h']]],
+ ['vma_5frecord_5fflush_5fafter_5fcall_5fbit_476',['VMA_RECORD_FLUSH_AFTER_CALL_BIT',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7',1,'vk_mem_alloc.h']]]
];
diff --git a/docs/html/search/files_0.js b/docs/html/search/files_0.js
index 10428fd..bcac042 100644
--- a/docs/html/search/files_0.js
+++ b/docs/html/search/files_0.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['vk_5fmem_5falloc_2eh_261',['vk_mem_alloc.h',['../vk__mem__alloc_8h.html',1,'']]]
+ ['vk_5fmem_5falloc_2eh_262',['vk_mem_alloc.h',['../vk__mem__alloc_8h.html',1,'']]]
];
diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js
index 6940455..2934994 100644
--- a/docs/html/search/functions_0.js
+++ b/docs/html/search/functions_0.js
@@ -1,54 +1,54 @@
var searchData=
[
- ['vmaallocatememory_262',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]],
- ['vmaallocatememoryforbuffer_263',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]],
- ['vmaallocatememoryforimage_264',['vmaAllocateMemoryForImage',['../vk__mem__alloc_8h.html#a0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]],
- ['vmaallocatememorypages_265',['vmaAllocateMemoryPages',['../vk__mem__alloc_8h.html#ad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]],
- ['vmabegindefragmentationpass_266',['vmaBeginDefragmentationPass',['../vk__mem__alloc_8h.html#ac0f01545b6262f7d4d128fc8f8e5c77b',1,'vk_mem_alloc.h']]],
- ['vmabindbuffermemory_267',['vmaBindBufferMemory',['../vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]],
- ['vmabindbuffermemory2_268',['vmaBindBufferMemory2',['../vk__mem__alloc_8h.html#a927c944f45e0f2941182abb6f608e64a',1,'vk_mem_alloc.h']]],
- ['vmabindimagememory_269',['vmaBindImageMemory',['../vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]],
- ['vmabindimagememory2_270',['vmaBindImageMemory2',['../vk__mem__alloc_8h.html#aa8251ee81b0045a443e35b8e8aa021bc',1,'vk_mem_alloc.h']]],
- ['vmabuildstatsstring_271',['vmaBuildStatsString',['../vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]],
- ['vmacalculatestats_272',['vmaCalculateStats',['../vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3',1,'vk_mem_alloc.h']]],
- ['vmacheckcorruption_273',['vmaCheckCorruption',['../vk__mem__alloc_8h.html#a49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]],
- ['vmacheckpoolcorruption_274',['vmaCheckPoolCorruption',['../vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]],
- ['vmacreateallocator_275',['vmaCreateAllocator',['../vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]],
- ['vmacreatebuffer_276',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]],
- ['vmacreateimage_277',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]],
- ['vmacreatelostallocation_278',['vmaCreateLostAllocation',['../vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1',1,'vk_mem_alloc.h']]],
- ['vmacreatepool_279',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]],
- ['vmadefragment_280',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationbegin_281',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationend_282',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]],
- ['vmadestroyallocator_283',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]],
- ['vmadestroybuffer_284',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]],
- ['vmadestroyimage_285',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]],
- ['vmadestroypool_286',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]],
- ['vmaenddefragmentationpass_287',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindex_288',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindexforbufferinfo_289',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]],
- ['vmafindmemorytypeindexforimageinfo_290',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]],
- ['vmaflushallocation_291',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]],
- ['vmaflushallocations_292',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]],
- ['vmafreememory_293',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]],
- ['vmafreememorypages_294',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]],
- ['vmafreestatsstring_295',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]],
- ['vmagetallocationinfo_296',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]],
- ['vmagetallocatorinfo_297',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]],
- ['vmagetbudget_298',['vmaGetBudget',['../vk__mem__alloc_8h.html#aec0ed24ebea2d0099eed5f801daaefba',1,'vk_mem_alloc.h']]],
- ['vmagetmemoryproperties_299',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]],
- ['vmagetmemorytypeproperties_300',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]],
- ['vmagetphysicaldeviceproperties_301',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]],
- ['vmagetpoolname_302',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]],
- ['vmagetpoolstats_303',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]],
- ['vmainvalidateallocation_304',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]],
- ['vmainvalidateallocations_305',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]],
- ['vmamakepoolallocationslost_306',['vmaMakePoolAllocationsLost',['../vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024',1,'vk_mem_alloc.h']]],
- ['vmamapmemory_307',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]],
- ['vmasetallocationuserdata_308',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]],
- ['vmasetcurrentframeindex_309',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]],
- ['vmasetpoolname_310',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]],
- ['vmatouchallocation_311',['vmaTouchAllocation',['../vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a',1,'vk_mem_alloc.h']]],
- ['vmaunmapmemory_312',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]]
+ ['vmaallocatememory_263',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememoryforbuffer_264',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememoryforimage_265',['vmaAllocateMemoryForImage',['../vk__mem__alloc_8h.html#a0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]],
+ ['vmaallocatememorypages_266',['vmaAllocateMemoryPages',['../vk__mem__alloc_8h.html#ad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]],
+ ['vmabegindefragmentationpass_267',['vmaBeginDefragmentationPass',['../vk__mem__alloc_8h.html#ac0f01545b6262f7d4d128fc8f8e5c77b',1,'vk_mem_alloc.h']]],
+ ['vmabindbuffermemory_268',['vmaBindBufferMemory',['../vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]],
+ ['vmabindbuffermemory2_269',['vmaBindBufferMemory2',['../vk__mem__alloc_8h.html#a927c944f45e0f2941182abb6f608e64a',1,'vk_mem_alloc.h']]],
+ ['vmabindimagememory_270',['vmaBindImageMemory',['../vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]],
+ ['vmabindimagememory2_271',['vmaBindImageMemory2',['../vk__mem__alloc_8h.html#aa8251ee81b0045a443e35b8e8aa021bc',1,'vk_mem_alloc.h']]],
+ ['vmabuildstatsstring_272',['vmaBuildStatsString',['../vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]],
+ ['vmacalculatestats_273',['vmaCalculateStats',['../vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3',1,'vk_mem_alloc.h']]],
+ ['vmacheckcorruption_274',['vmaCheckCorruption',['../vk__mem__alloc_8h.html#a49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]],
+ ['vmacheckpoolcorruption_275',['vmaCheckPoolCorruption',['../vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]],
+ ['vmacreateallocator_276',['vmaCreateAllocator',['../vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]],
+ ['vmacreatebuffer_277',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]],
+ ['vmacreateimage_278',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]],
+ ['vmacreatelostallocation_279',['vmaCreateLostAllocation',['../vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1',1,'vk_mem_alloc.h']]],
+ ['vmacreatepool_280',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]],
+ ['vmadefragment_281',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationbegin_282',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationend_283',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]],
+ ['vmadestroyallocator_284',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]],
+ ['vmadestroybuffer_285',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]],
+ ['vmadestroyimage_286',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]],
+ ['vmadestroypool_287',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]],
+ ['vmaenddefragmentationpass_288',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindex_289',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindexforbufferinfo_290',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]],
+ ['vmafindmemorytypeindexforimageinfo_291',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]],
+ ['vmaflushallocation_292',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]],
+ ['vmaflushallocations_293',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]],
+ ['vmafreememory_294',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]],
+ ['vmafreememorypages_295',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]],
+ ['vmafreestatsstring_296',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]],
+ ['vmagetallocationinfo_297',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]],
+ ['vmagetallocatorinfo_298',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]],
+ ['vmagetbudget_299',['vmaGetBudget',['../vk__mem__alloc_8h.html#aec0ed24ebea2d0099eed5f801daaefba',1,'vk_mem_alloc.h']]],
+ ['vmagetmemoryproperties_300',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]],
+ ['vmagetmemorytypeproperties_301',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]],
+ ['vmagetphysicaldeviceproperties_302',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]],
+ ['vmagetpoolname_303',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]],
+ ['vmagetpoolstats_304',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]],
+ ['vmainvalidateallocation_305',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]],
+ ['vmainvalidateallocations_306',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]],
+ ['vmamakepoolallocationslost_307',['vmaMakePoolAllocationsLost',['../vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024',1,'vk_mem_alloc.h']]],
+ ['vmamapmemory_308',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]],
+ ['vmasetallocationuserdata_309',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]],
+ ['vmasetcurrentframeindex_310',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]],
+ ['vmasetpoolname_311',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]],
+ ['vmatouchallocation_312',['vmaTouchAllocation',['../vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a',1,'vk_mem_alloc.h']]],
+ ['vmaunmapmemory_313',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]]
];
diff --git a/docs/html/search/pages_0.js b/docs/html/search/pages_0.js
index 25ac023..b317590 100644
--- a/docs/html/search/pages_0.js
+++ b/docs/html/search/pages_0.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['allocation_20names_20and_20user_20data_483',['Allocation names and user data',['../allocation_annotation.html',1,'index']]]
+ ['allocation_20names_20and_20user_20data_485',['Allocation names and user data',['../allocation_annotation.html',1,'index']]]
];
diff --git a/docs/html/search/pages_1.js b/docs/html/search/pages_1.js
index bc544e5..f6dd8a9 100644
--- a/docs/html/search/pages_1.js
+++ b/docs/html/search/pages_1.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['choosing_20memory_20type_484',['Choosing memory type',['../choosing_memory_type.html',1,'index']]],
- ['configuration_485',['Configuration',['../configuration.html',1,'index']]],
- ['custom_20memory_20pools_486',['Custom memory pools',['../custom_memory_pools.html',1,'index']]]
+ ['choosing_20memory_20type_486',['Choosing memory type',['../choosing_memory_type.html',1,'index']]],
+ ['configuration_487',['Configuration',['../configuration.html',1,'index']]],
+ ['custom_20memory_20pools_488',['Custom memory pools',['../custom_memory_pools.html',1,'index']]]
];
diff --git a/docs/html/search/pages_2.js b/docs/html/search/pages_2.js
index a3326f9..eec09ef 100644
--- a/docs/html/search/pages_2.js
+++ b/docs/html/search/pages_2.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['debugging_20incorrect_20memory_20usage_487',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]],
- ['defragmentation_488',['Defragmentation',['../defragmentation.html',1,'index']]],
- ['deprecated_20list_489',['Deprecated List',['../deprecated.html',1,'']]]
+ ['debugging_20incorrect_20memory_20usage_489',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]],
+ ['defragmentation_490',['Defragmentation',['../defragmentation.html',1,'index']]],
+ ['deprecated_20list_491',['Deprecated List',['../deprecated.html',1,'']]]
];
diff --git a/docs/html/search/pages_3.js b/docs/html/search/pages_3.js
index 6d55588..e2a1445 100644
--- a/docs/html/search/pages_3.js
+++ b/docs/html/search/pages_3.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['enabling_20buffer_20device_20address_490',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]]
+ ['enabling_20buffer_20device_20address_492',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]]
];
diff --git a/docs/html/search/pages_4.js b/docs/html/search/pages_4.js
index 24152c1..19c7b4a 100644
--- a/docs/html/search/pages_4.js
+++ b/docs/html/search/pages_4.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['general_20considerations_491',['General considerations',['../general_considerations.html',1,'index']]]
+ ['general_20considerations_493',['General considerations',['../general_considerations.html',1,'index']]]
];
diff --git a/docs/html/search/pages_5.js b/docs/html/search/pages_5.js
index 3fb7c9e..d827ca2 100644
--- a/docs/html/search/pages_5.js
+++ b/docs/html/search/pages_5.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['lost_20allocations_492',['Lost allocations',['../lost_allocations.html',1,'index']]]
+ ['lost_20allocations_494',['Lost allocations',['../lost_allocations.html',1,'index']]]
];
diff --git a/docs/html/search/pages_6.js b/docs/html/search/pages_6.js
index 90c7a07..92ae94e 100644
--- a/docs/html/search/pages_6.js
+++ b/docs/html/search/pages_6.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['memory_20mapping_493',['Memory mapping',['../memory_mapping.html',1,'index']]]
+ ['memory_20mapping_495',['Memory mapping',['../memory_mapping.html',1,'index']]]
];
diff --git a/docs/html/search/pages_7.js b/docs/html/search/pages_7.js
index ea54719..349a27c 100644
--- a/docs/html/search/pages_7.js
+++ b/docs/html/search/pages_7.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['quick_20start_494',['Quick start',['../quick_start.html',1,'index']]]
+ ['quick_20start_496',['Quick start',['../quick_start.html',1,'index']]]
];
diff --git a/docs/html/search/pages_8.js b/docs/html/search/pages_8.js
index 348ea46..a1962ed 100644
--- a/docs/html/search/pages_8.js
+++ b/docs/html/search/pages_8.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['recommended_20usage_20patterns_495',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
- ['record_20and_20replay_496',['Record and replay',['../record_and_replay.html',1,'index']]],
- ['resource_20aliasing_20_28overlap_29_497',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
+ ['recommended_20usage_20patterns_497',['Recommended usage patterns',['../usage_patterns.html',1,'index']]],
+ ['record_20and_20replay_498',['Record and replay',['../record_and_replay.html',1,'index']]],
+ ['resource_20aliasing_20_28overlap_29_499',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
];
diff --git a/docs/html/search/pages_9.js b/docs/html/search/pages_9.js
index e9d588e..4c218b5 100644
--- a/docs/html/search/pages_9.js
+++ b/docs/html/search/pages_9.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['statistics_498',['Statistics',['../statistics.html',1,'index']]],
- ['staying_20within_20budget_499',['Staying within budget',['../staying_within_budget.html',1,'index']]]
+ ['statistics_500',['Statistics',['../statistics.html',1,'index']]],
+ ['staying_20within_20budget_501',['Staying within budget',['../staying_within_budget.html',1,'index']]]
];
diff --git a/docs/html/search/pages_a.js b/docs/html/search/pages_a.js
index bf4af17..c356f50 100644
--- a/docs/html/search/pages_a.js
+++ b/docs/html/search/pages_a.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['vk_5famd_5fdevice_5fcoherent_5fmemory_500',['VK_AMD_device_coherent_memory',['../vk_amd_device_coherent_memory.html',1,'index']]],
- ['vk_5fkhr_5fdedicated_5fallocation_501',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]],
- ['vulkan_20memory_20allocator_502',['Vulkan Memory Allocator',['../index.html',1,'']]]
+ ['vk_5famd_5fdevice_5fcoherent_5fmemory_502',['VK_AMD_device_coherent_memory',['../vk_amd_device_coherent_memory.html',1,'index']]],
+ ['vk_5fkhr_5fdedicated_5fallocation_503',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]],
+ ['vulkan_20memory_20allocator_504',['Vulkan Memory Allocator',['../index.html',1,'']]]
];
diff --git a/docs/html/search/typedefs_0.js b/docs/html/search/typedefs_0.js
index 25302c7..1f52652 100644
--- a/docs/html/search/typedefs_0.js
+++ b/docs/html/search/typedefs_0.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['pfn_5fvmaallocatedevicememoryfunction_397',['PFN_vmaAllocateDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a7e1ed85f7799600b03ad51a77acc21f3',1,'vk_mem_alloc.h']]],
- ['pfn_5fvmafreedevicememoryfunction_398',['PFN_vmaFreeDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a154ccaaf53dc2c36378f80f0c4f3679b',1,'vk_mem_alloc.h']]]
+ ['pfn_5fvmaallocatedevicememoryfunction_399',['PFN_vmaAllocateDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a7e1ed85f7799600b03ad51a77acc21f3',1,'vk_mem_alloc.h']]],
+ ['pfn_5fvmafreedevicememoryfunction_400',['PFN_vmaFreeDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a154ccaaf53dc2c36378f80f0c4f3679b',1,'vk_mem_alloc.h']]]
];
diff --git a/docs/html/search/typedefs_1.js b/docs/html/search/typedefs_1.js
index ff31250..33b4cde 100644
--- a/docs/html/search/typedefs_1.js
+++ b/docs/html/search/typedefs_1.js
@@ -1,31 +1,31 @@
var searchData=
[
- ['vmaallocationcreateflagbits_399',['VmaAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a4fceecc301f4064dc808d3cd6c038941',1,'vk_mem_alloc.h']]],
- ['vmaallocationcreateflags_400',['VmaAllocationCreateFlags',['../vk__mem__alloc_8h.html#a5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]],
- ['vmaallocationcreateinfo_401',['VmaAllocationCreateInfo',['../vk__mem__alloc_8h.html#a3bf110892ea2fb4649fedb68488d026a',1,'vk_mem_alloc.h']]],
- ['vmaallocationinfo_402',['VmaAllocationInfo',['../vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50',1,'vk_mem_alloc.h']]],
- ['vmaallocatorcreateflagbits_403',['VmaAllocatorCreateFlagBits',['../vk__mem__alloc_8h.html#afd73b95e737ee7e76f827cb5472f559f',1,'vk_mem_alloc.h']]],
- ['vmaallocatorcreateflags_404',['VmaAllocatorCreateFlags',['../vk__mem__alloc_8h.html#acfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]],
- ['vmaallocatorcreateinfo_405',['VmaAllocatorCreateInfo',['../vk__mem__alloc_8h.html#aad9652301d33759b83e52d4f3605a14a',1,'vk_mem_alloc.h']]],
- ['vmaallocatorinfo_406',['VmaAllocatorInfo',['../vk__mem__alloc_8h.html#a1988031b0223fdbd564250fa1edd942c',1,'vk_mem_alloc.h']]],
- ['vmabudget_407',['VmaBudget',['../vk__mem__alloc_8h.html#aa078667e71b1ef24e87a6a30d128381d',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationflagbits_408',['VmaDefragmentationFlagBits',['../vk__mem__alloc_8h.html#a13415cc0b443353a7b5abda300b833fc',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationflags_409',['VmaDefragmentationFlags',['../vk__mem__alloc_8h.html#a88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationinfo_410',['VmaDefragmentationInfo',['../vk__mem__alloc_8h.html#a2bf47f96bf92bed2a49461bd9af3acfa',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationinfo2_411',['VmaDefragmentationInfo2',['../vk__mem__alloc_8h.html#ad6daeffaa670ce6d11a203a6224c9937',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationpassinfo_412',['VmaDefragmentationPassInfo',['../vk__mem__alloc_8h.html#a72aebd522242d56abea67b4f47f6549e',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationpassmoveinfo_413',['VmaDefragmentationPassMoveInfo',['../vk__mem__alloc_8h.html#ad6799e8e2b1527abfc84d33bc44aeaf5',1,'vk_mem_alloc.h']]],
- ['vmadefragmentationstats_414',['VmaDefragmentationStats',['../vk__mem__alloc_8h.html#ad94034192259c2e34a4d1c5e27810403',1,'vk_mem_alloc.h']]],
- ['vmadevicememorycallbacks_415',['VmaDeviceMemoryCallbacks',['../vk__mem__alloc_8h.html#a77692d3c8770ea8882d573206bd27b2b',1,'vk_mem_alloc.h']]],
- ['vmamemoryusage_416',['VmaMemoryUsage',['../vk__mem__alloc_8h.html#a806e8499dde802e59eb72a1dc811c35f',1,'vk_mem_alloc.h']]],
- ['vmapoolcreateflagbits_417',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a4d4f2efc2509157a9e4ecd4fd7942303',1,'vk_mem_alloc.h']]],
- ['vmapoolcreateflags_418',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]],
- ['vmapoolcreateinfo_419',['VmaPoolCreateInfo',['../vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67',1,'vk_mem_alloc.h']]],
- ['vmapoolstats_420',['VmaPoolStats',['../vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1',1,'vk_mem_alloc.h']]],
- ['vmarecordflagbits_421',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#acd24d5eb58abff7e1f43cb32a1ba1413',1,'vk_mem_alloc.h']]],
- ['vmarecordflags_422',['VmaRecordFlags',['../vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828',1,'vk_mem_alloc.h']]],
- ['vmarecordsettings_423',['VmaRecordSettings',['../vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc',1,'vk_mem_alloc.h']]],
- ['vmastatinfo_424',['VmaStatInfo',['../vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878',1,'vk_mem_alloc.h']]],
- ['vmastats_425',['VmaStats',['../vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034',1,'vk_mem_alloc.h']]],
- ['vmavulkanfunctions_426',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074',1,'vk_mem_alloc.h']]]
+ ['vmaallocationcreateflagbits_401',['VmaAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a4fceecc301f4064dc808d3cd6c038941',1,'vk_mem_alloc.h']]],
+ ['vmaallocationcreateflags_402',['VmaAllocationCreateFlags',['../vk__mem__alloc_8h.html#a5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]],
+ ['vmaallocationcreateinfo_403',['VmaAllocationCreateInfo',['../vk__mem__alloc_8h.html#a3bf110892ea2fb4649fedb68488d026a',1,'vk_mem_alloc.h']]],
+ ['vmaallocationinfo_404',['VmaAllocationInfo',['../vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50',1,'vk_mem_alloc.h']]],
+ ['vmaallocatorcreateflagbits_405',['VmaAllocatorCreateFlagBits',['../vk__mem__alloc_8h.html#afd73b95e737ee7e76f827cb5472f559f',1,'vk_mem_alloc.h']]],
+ ['vmaallocatorcreateflags_406',['VmaAllocatorCreateFlags',['../vk__mem__alloc_8h.html#acfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]],
+ ['vmaallocatorcreateinfo_407',['VmaAllocatorCreateInfo',['../vk__mem__alloc_8h.html#aad9652301d33759b83e52d4f3605a14a',1,'vk_mem_alloc.h']]],
+ ['vmaallocatorinfo_408',['VmaAllocatorInfo',['../vk__mem__alloc_8h.html#a1988031b0223fdbd564250fa1edd942c',1,'vk_mem_alloc.h']]],
+ ['vmabudget_409',['VmaBudget',['../vk__mem__alloc_8h.html#aa078667e71b1ef24e87a6a30d128381d',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationflagbits_410',['VmaDefragmentationFlagBits',['../vk__mem__alloc_8h.html#a13415cc0b443353a7b5abda300b833fc',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationflags_411',['VmaDefragmentationFlags',['../vk__mem__alloc_8h.html#a88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationinfo_412',['VmaDefragmentationInfo',['../vk__mem__alloc_8h.html#a2bf47f96bf92bed2a49461bd9af3acfa',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationinfo2_413',['VmaDefragmentationInfo2',['../vk__mem__alloc_8h.html#ad6daeffaa670ce6d11a203a6224c9937',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationpassinfo_414',['VmaDefragmentationPassInfo',['../vk__mem__alloc_8h.html#a72aebd522242d56abea67b4f47f6549e',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationpassmoveinfo_415',['VmaDefragmentationPassMoveInfo',['../vk__mem__alloc_8h.html#ad6799e8e2b1527abfc84d33bc44aeaf5',1,'vk_mem_alloc.h']]],
+ ['vmadefragmentationstats_416',['VmaDefragmentationStats',['../vk__mem__alloc_8h.html#ad94034192259c2e34a4d1c5e27810403',1,'vk_mem_alloc.h']]],
+ ['vmadevicememorycallbacks_417',['VmaDeviceMemoryCallbacks',['../vk__mem__alloc_8h.html#a77692d3c8770ea8882d573206bd27b2b',1,'vk_mem_alloc.h']]],
+ ['vmamemoryusage_418',['VmaMemoryUsage',['../vk__mem__alloc_8h.html#a806e8499dde802e59eb72a1dc811c35f',1,'vk_mem_alloc.h']]],
+ ['vmapoolcreateflagbits_419',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a4d4f2efc2509157a9e4ecd4fd7942303',1,'vk_mem_alloc.h']]],
+ ['vmapoolcreateflags_420',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]],
+ ['vmapoolcreateinfo_421',['VmaPoolCreateInfo',['../vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67',1,'vk_mem_alloc.h']]],
+ ['vmapoolstats_422',['VmaPoolStats',['../vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1',1,'vk_mem_alloc.h']]],
+ ['vmarecordflagbits_423',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#acd24d5eb58abff7e1f43cb32a1ba1413',1,'vk_mem_alloc.h']]],
+ ['vmarecordflags_424',['VmaRecordFlags',['../vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828',1,'vk_mem_alloc.h']]],
+ ['vmarecordsettings_425',['VmaRecordSettings',['../vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc',1,'vk_mem_alloc.h']]],
+ ['vmastatinfo_426',['VmaStatInfo',['../vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878',1,'vk_mem_alloc.h']]],
+ ['vmastats_427',['VmaStats',['../vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034',1,'vk_mem_alloc.h']]],
+ ['vmavulkanfunctions_428',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074',1,'vk_mem_alloc.h']]]
];
diff --git a/docs/html/search/variables_0.js b/docs/html/search/variables_0.js
index b736596..2e7180b 100644
--- a/docs/html/search/variables_0.js
+++ b/docs/html/search/variables_0.js
@@ -1,10 +1,10 @@
var searchData=
[
- ['allocation_313',['allocation',['../struct_vma_defragmentation_pass_move_info.html#ae885c861c2dd8d622e6c19e281d035cc',1,'VmaDefragmentationPassMoveInfo']]],
- ['allocationbytes_314',['allocationBytes',['../struct_vma_budget.html#a7e2a6583ebd63e194951c542563804d8',1,'VmaBudget']]],
- ['allocationcount_315',['allocationCount',['../struct_vma_stat_info.html#a537741e4d5cdddc1c0ab95ec650afaff',1,'VmaStatInfo::allocationCount()'],['../struct_vma_pool_stats.html#ad1924eb54fffa45e9e0e65670c8fe5eb',1,'VmaPoolStats::allocationCount()'],['../struct_vma_defragmentation_info2.html#a3cf86ab32c1da779b4923d301a3056ba',1,'VmaDefragmentationInfo2::allocationCount()']]],
- ['allocationsizeavg_316',['allocationSizeAvg',['../struct_vma_stat_info.html#a1081a039964e566c672e7a2347f9e599',1,'VmaStatInfo']]],
- ['allocationsizemax_317',['allocationSizeMax',['../struct_vma_stat_info.html#a17e9733a5ecd76287d4db6e66f71f50c',1,'VmaStatInfo']]],
- ['allocationsizemin_318',['allocationSizeMin',['../struct_vma_stat_info.html#ade8b40bd3139c04aabd2fc538a356fea',1,'VmaStatInfo']]],
- ['allocationsmoved_319',['allocationsMoved',['../struct_vma_defragmentation_stats.html#aefeabf130022008eadd75999478af3f9',1,'VmaDefragmentationStats']]]
+ ['allocation_314',['allocation',['../struct_vma_defragmentation_pass_move_info.html#ae885c861c2dd8d622e6c19e281d035cc',1,'VmaDefragmentationPassMoveInfo']]],
+ ['allocationbytes_315',['allocationBytes',['../struct_vma_budget.html#a7e2a6583ebd63e194951c542563804d8',1,'VmaBudget']]],
+ ['allocationcount_316',['allocationCount',['../struct_vma_stat_info.html#a537741e4d5cdddc1c0ab95ec650afaff',1,'VmaStatInfo::allocationCount()'],['../struct_vma_pool_stats.html#ad1924eb54fffa45e9e0e65670c8fe5eb',1,'VmaPoolStats::allocationCount()'],['../struct_vma_defragmentation_info2.html#a3cf86ab32c1da779b4923d301a3056ba',1,'VmaDefragmentationInfo2::allocationCount()']]],
+ ['allocationsizeavg_317',['allocationSizeAvg',['../struct_vma_stat_info.html#a1081a039964e566c672e7a2347f9e599',1,'VmaStatInfo']]],
+ ['allocationsizemax_318',['allocationSizeMax',['../struct_vma_stat_info.html#a17e9733a5ecd76287d4db6e66f71f50c',1,'VmaStatInfo']]],
+ ['allocationsizemin_319',['allocationSizeMin',['../struct_vma_stat_info.html#ade8b40bd3139c04aabd2fc538a356fea',1,'VmaStatInfo']]],
+ ['allocationsmoved_320',['allocationsMoved',['../struct_vma_defragmentation_stats.html#aefeabf130022008eadd75999478af3f9',1,'VmaDefragmentationStats']]]
];
diff --git a/docs/html/search/variables_1.js b/docs/html/search/variables_1.js
index 71f3c5d..65fb434 100644
--- a/docs/html/search/variables_1.js
+++ b/docs/html/search/variables_1.js
@@ -1,9 +1,9 @@
var searchData=
[
- ['blockbytes_320',['blockBytes',['../struct_vma_budget.html#a58b492901baab685f466199124e514a0',1,'VmaBudget']]],
- ['blockcount_321',['blockCount',['../struct_vma_stat_info.html#abc4bb7cd611900778464c56e50c970a4',1,'VmaStatInfo::blockCount()'],['../struct_vma_pool_stats.html#aa0b5cb45cef6f18571cefb03b9a230e7',1,'VmaPoolStats::blockCount()']]],
- ['blocksize_322',['blockSize',['../struct_vma_pool_create_info.html#aa4265160536cdb9be821b7686c16c676',1,'VmaPoolCreateInfo']]],
- ['budget_323',['budget',['../struct_vma_budget.html#ab82e1d1754c2d210d0bdf90220bc6cdd',1,'VmaBudget']]],
- ['bytesfreed_324',['bytesFreed',['../struct_vma_defragmentation_stats.html#ab0cb9ac0dbc106c77e384ea676422f28',1,'VmaDefragmentationStats']]],
- ['bytesmoved_325',['bytesMoved',['../struct_vma_defragmentation_stats.html#a36f9d5df2a10ba2a36b16e126d60572d',1,'VmaDefragmentationStats']]]
+ ['blockbytes_321',['blockBytes',['../struct_vma_budget.html#a58b492901baab685f466199124e514a0',1,'VmaBudget']]],
+ ['blockcount_322',['blockCount',['../struct_vma_stat_info.html#abc4bb7cd611900778464c56e50c970a4',1,'VmaStatInfo::blockCount()'],['../struct_vma_pool_stats.html#aa0b5cb45cef6f18571cefb03b9a230e7',1,'VmaPoolStats::blockCount()']]],
+ ['blocksize_323',['blockSize',['../struct_vma_pool_create_info.html#aa4265160536cdb9be821b7686c16c676',1,'VmaPoolCreateInfo']]],
+ ['budget_324',['budget',['../struct_vma_budget.html#ab82e1d1754c2d210d0bdf90220bc6cdd',1,'VmaBudget']]],
+ ['bytesfreed_325',['bytesFreed',['../struct_vma_defragmentation_stats.html#ab0cb9ac0dbc106c77e384ea676422f28',1,'VmaDefragmentationStats']]],
+ ['bytesmoved_326',['bytesMoved',['../struct_vma_defragmentation_stats.html#a36f9d5df2a10ba2a36b16e126d60572d',1,'VmaDefragmentationStats']]]
];
diff --git a/docs/html/search/variables_2.js b/docs/html/search/variables_2.js
index edcfe09..db4c03a 100644
--- a/docs/html/search/variables_2.js
+++ b/docs/html/search/variables_2.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['commandbuffer_326',['commandBuffer',['../struct_vma_defragmentation_info2.html#a7f71f39590c5316771493d2333f9c1bd',1,'VmaDefragmentationInfo2']]]
+ ['commandbuffer_327',['commandBuffer',['../struct_vma_defragmentation_info2.html#a7f71f39590c5316771493d2333f9c1bd',1,'VmaDefragmentationInfo2']]]
];
diff --git a/docs/html/search/variables_3.js b/docs/html/search/variables_3.js
index 65200bb..7783384 100644
--- a/docs/html/search/variables_3.js
+++ b/docs/html/search/variables_3.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['device_327',['device',['../struct_vma_allocator_create_info.html#ad924ddd77b04039c88d0c09b0ffcd500',1,'VmaAllocatorCreateInfo::device()'],['../struct_vma_allocator_info.html#a012b4c485bf3b0ea8921352c5ee0c357',1,'VmaAllocatorInfo::device()']]],
- ['devicememory_328',['deviceMemory',['../struct_vma_allocation_info.html#ae0bfb7dfdf79a76ffefc9a94677a2f67',1,'VmaAllocationInfo']]],
- ['devicememoryblocksfreed_329',['deviceMemoryBlocksFreed',['../struct_vma_defragmentation_stats.html#a0113f1877904a5d1ee8f409216ff276b',1,'VmaDefragmentationStats']]]
+ ['device_328',['device',['../struct_vma_allocator_create_info.html#ad924ddd77b04039c88d0c09b0ffcd500',1,'VmaAllocatorCreateInfo::device()'],['../struct_vma_allocator_info.html#a012b4c485bf3b0ea8921352c5ee0c357',1,'VmaAllocatorInfo::device()']]],
+ ['devicememory_329',['deviceMemory',['../struct_vma_allocation_info.html#ae0bfb7dfdf79a76ffefc9a94677a2f67',1,'VmaAllocationInfo']]],
+ ['devicememoryblocksfreed_330',['deviceMemoryBlocksFreed',['../struct_vma_defragmentation_stats.html#a0113f1877904a5d1ee8f409216ff276b',1,'VmaDefragmentationStats']]]
];
diff --git a/docs/html/search/variables_4.js b/docs/html/search/variables_4.js
index 31b9769..6590296 100644
--- a/docs/html/search/variables_4.js
+++ b/docs/html/search/variables_4.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['flags_330',['flags',['../struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a',1,'VmaRecordSettings::flags()'],['../struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346',1,'VmaAllocatorCreateInfo::flags()'],['../struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b',1,'VmaAllocationCreateInfo::flags()'],['../struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446',1,'VmaPoolCreateInfo::flags()'],['../struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9',1,'VmaDefragmentationInfo2::flags()']]],
- ['frameinusecount_331',['frameInUseCount',['../struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7',1,'VmaAllocatorCreateInfo::frameInUseCount()'],['../struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa',1,'VmaPoolCreateInfo::frameInUseCount()']]]
+ ['flags_331',['flags',['../struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a',1,'VmaRecordSettings::flags()'],['../struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346',1,'VmaAllocatorCreateInfo::flags()'],['../struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b',1,'VmaAllocationCreateInfo::flags()'],['../struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446',1,'VmaPoolCreateInfo::flags()'],['../struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9',1,'VmaDefragmentationInfo2::flags()']]],
+ ['frameinusecount_332',['frameInUseCount',['../struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7',1,'VmaAllocatorCreateInfo::frameInUseCount()'],['../struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa',1,'VmaPoolCreateInfo::frameInUseCount()']]]
];
diff --git a/docs/html/search/variables_5.js b/docs/html/search/variables_5.js
index 0aad120..2f2e850 100644
--- a/docs/html/search/variables_5.js
+++ b/docs/html/search/variables_5.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['instance_332',['instance',['../struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b',1,'VmaAllocatorCreateInfo::instance()'],['../struct_vma_allocator_info.html#a2ed6a4d2d3fea039d66a13f15d0ce5fe',1,'VmaAllocatorInfo::instance()']]]
+ ['instance_333',['instance',['../struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b',1,'VmaAllocatorCreateInfo::instance()'],['../struct_vma_allocator_info.html#a2ed6a4d2d3fea039d66a13f15d0ce5fe',1,'VmaAllocatorInfo::instance()']]]
];
diff --git a/docs/html/search/variables_6.js b/docs/html/search/variables_6.js
index 168f828..06349d3 100644
--- a/docs/html/search/variables_6.js
+++ b/docs/html/search/variables_6.js
@@ -1,17 +1,18 @@
var searchData=
[
- ['maxallocationstomove_333',['maxAllocationsToMove',['../struct_vma_defragmentation_info.html#aa7c7304e13c71f604c907196c4e28fbc',1,'VmaDefragmentationInfo']]],
- ['maxblockcount_334',['maxBlockCount',['../struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c',1,'VmaPoolCreateInfo']]],
- ['maxbytestomove_335',['maxBytesToMove',['../struct_vma_defragmentation_info.html#acb311c940a777270e67e1b81c5ab6a1d',1,'VmaDefragmentationInfo']]],
- ['maxcpuallocationstomove_336',['maxCpuAllocationsToMove',['../struct_vma_defragmentation_info2.html#a94c2c7223d52878445a8cccce396b671',1,'VmaDefragmentationInfo2']]],
- ['maxcpubytestomove_337',['maxCpuBytesToMove',['../struct_vma_defragmentation_info2.html#af78e1ea40c22d85137b65f6b384a4d0a',1,'VmaDefragmentationInfo2']]],
- ['maxgpuallocationstomove_338',['maxGpuAllocationsToMove',['../struct_vma_defragmentation_info2.html#a40d53d33e71ba0b66f844ed63c05a3f6',1,'VmaDefragmentationInfo2']]],
- ['maxgpubytestomove_339',['maxGpuBytesToMove',['../struct_vma_defragmentation_info2.html#a4ddbc898d0afe1518f863a3763628f08',1,'VmaDefragmentationInfo2']]],
- ['memory_340',['memory',['../struct_vma_defragmentation_pass_move_info.html#a06eb0c8690aa0d3478a036753492e769',1,'VmaDefragmentationPassMoveInfo']]],
- ['memoryheap_341',['memoryHeap',['../struct_vma_stats.html#a0e6611508c29a187f0fd14ff1a0329c0',1,'VmaStats']]],
- ['memorytype_342',['memoryType',['../struct_vma_stats.html#a13e3caf754be79352c42408756309331',1,'VmaStats::memoryType()'],['../struct_vma_allocation_info.html#a7f6b0aa58c135e488e6b40a388dad9d5',1,'VmaAllocationInfo::memoryType()']]],
- ['memorytypebits_343',['memoryTypeBits',['../struct_vma_allocation_create_info.html#a3bf940c0271d85d6ba32a4d820075055',1,'VmaAllocationCreateInfo']]],
- ['memorytypeindex_344',['memoryTypeIndex',['../struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319',1,'VmaPoolCreateInfo']]],
- ['minblockcount_345',['minBlockCount',['../struct_vma_pool_create_info.html#ad8006fb803185c0a699d30f3e9a865ae',1,'VmaPoolCreateInfo']]],
- ['movecount_346',['moveCount',['../struct_vma_defragmentation_pass_info.html#ac1086e657ba995f8d1f4e49b83dcfb6c',1,'VmaDefragmentationPassInfo']]]
+ ['maxallocationstomove_334',['maxAllocationsToMove',['../struct_vma_defragmentation_info.html#aa7c7304e13c71f604c907196c4e28fbc',1,'VmaDefragmentationInfo']]],
+ ['maxblockcount_335',['maxBlockCount',['../struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c',1,'VmaPoolCreateInfo']]],
+ ['maxbytestomove_336',['maxBytesToMove',['../struct_vma_defragmentation_info.html#acb311c940a777270e67e1b81c5ab6a1d',1,'VmaDefragmentationInfo']]],
+ ['maxcpuallocationstomove_337',['maxCpuAllocationsToMove',['../struct_vma_defragmentation_info2.html#a94c2c7223d52878445a8cccce396b671',1,'VmaDefragmentationInfo2']]],
+ ['maxcpubytestomove_338',['maxCpuBytesToMove',['../struct_vma_defragmentation_info2.html#af78e1ea40c22d85137b65f6b384a4d0a',1,'VmaDefragmentationInfo2']]],
+ ['maxgpuallocationstomove_339',['maxGpuAllocationsToMove',['../struct_vma_defragmentation_info2.html#a40d53d33e71ba0b66f844ed63c05a3f6',1,'VmaDefragmentationInfo2']]],
+ ['maxgpubytestomove_340',['maxGpuBytesToMove',['../struct_vma_defragmentation_info2.html#a4ddbc898d0afe1518f863a3763628f08',1,'VmaDefragmentationInfo2']]],
+ ['memory_341',['memory',['../struct_vma_defragmentation_pass_move_info.html#a06eb0c8690aa0d3478a036753492e769',1,'VmaDefragmentationPassMoveInfo']]],
+ ['memoryheap_342',['memoryHeap',['../struct_vma_stats.html#a0e6611508c29a187f0fd14ff1a0329c0',1,'VmaStats']]],
+ ['memorytype_343',['memoryType',['../struct_vma_stats.html#a13e3caf754be79352c42408756309331',1,'VmaStats::memoryType()'],['../struct_vma_allocation_info.html#a7f6b0aa58c135e488e6b40a388dad9d5',1,'VmaAllocationInfo::memoryType()']]],
+ ['memorytypebits_344',['memoryTypeBits',['../struct_vma_allocation_create_info.html#a3bf940c0271d85d6ba32a4d820075055',1,'VmaAllocationCreateInfo']]],
+ ['memorytypeindex_345',['memoryTypeIndex',['../struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319',1,'VmaPoolCreateInfo']]],
+ ['minallocationalignment_346',['minAllocationAlignment',['../struct_vma_pool_create_info.html#ade3eca546f0c6ab4e8fbf20eb6d854cb',1,'VmaPoolCreateInfo']]],
+ ['minblockcount_347',['minBlockCount',['../struct_vma_pool_create_info.html#ad8006fb803185c0a699d30f3e9a865ae',1,'VmaPoolCreateInfo']]],
+ ['movecount_348',['moveCount',['../struct_vma_defragmentation_pass_info.html#ac1086e657ba995f8d1f4e49b83dcfb6c',1,'VmaDefragmentationPassInfo']]]
];
diff --git a/docs/html/search/variables_7.js b/docs/html/search/variables_7.js
index e68edf1..968b3a7 100644
--- a/docs/html/search/variables_7.js
+++ b/docs/html/search/variables_7.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['offset_347',['offset',['../struct_vma_allocation_info.html#a4a3c732388dbdc7a23f9365b00825268',1,'VmaAllocationInfo::offset()'],['../struct_vma_defragmentation_pass_move_info.html#a8ab4508bc03625b0653c880576be96c6',1,'VmaDefragmentationPassMoveInfo::offset()']]]
+ ['offset_349',['offset',['../struct_vma_allocation_info.html#a4a3c732388dbdc7a23f9365b00825268',1,'VmaAllocationInfo::offset()'],['../struct_vma_defragmentation_pass_move_info.html#a8ab4508bc03625b0653c880576be96c6',1,'VmaDefragmentationPassMoveInfo::offset()']]]
];
diff --git a/docs/html/search/variables_8.js b/docs/html/search/variables_8.js
index 22a6742..2493d69 100644
--- a/docs/html/search/variables_8.js
+++ b/docs/html/search/variables_8.js
@@ -1,23 +1,23 @@
var searchData=
[
- ['pallocationcallbacks_348',['pAllocationCallbacks',['../struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d',1,'VmaAllocatorCreateInfo']]],
- ['pallocations_349',['pAllocations',['../struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32',1,'VmaDefragmentationInfo2']]],
- ['pallocationschanged_350',['pAllocationsChanged',['../struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc',1,'VmaDefragmentationInfo2']]],
- ['pdevicememorycallbacks_351',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]],
- ['pfilepath_352',['pFilePath',['../struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d',1,'VmaRecordSettings']]],
- ['pfnallocate_353',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]],
- ['pfnfree_354',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]],
- ['pheapsizelimit_355',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]],
- ['physicaldevice_356',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo::physicalDevice()'],['../struct_vma_allocator_info.html#aba2b703f96e51d567717e1fb2935b47a',1,'VmaAllocatorInfo::physicalDevice()']]],
- ['pmappeddata_357',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]],
- ['pmoves_358',['pMoves',['../struct_vma_defragmentation_pass_info.html#acbd42d4a3357999da130a95cd99a3792',1,'VmaDefragmentationPassInfo']]],
- ['pool_359',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]],
- ['poolcount_360',['poolCount',['../struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d',1,'VmaDefragmentationInfo2']]],
- ['ppools_361',['pPools',['../struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b',1,'VmaDefragmentationInfo2']]],
- ['precordsettings_362',['pRecordSettings',['../struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee',1,'VmaAllocatorCreateInfo']]],
- ['preferredflags_363',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]],
- ['preferredlargeheapblocksize_364',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]],
- ['priority_365',['priority',['../struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7',1,'VmaAllocationCreateInfo::priority()'],['../struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274',1,'VmaPoolCreateInfo::priority()']]],
- ['puserdata_366',['pUserData',['../struct_vma_device_memory_callbacks.html#a24052de0937ddd54015a2df0363903c6',1,'VmaDeviceMemoryCallbacks::pUserData()'],['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()']]],
- ['pvulkanfunctions_367',['pVulkanFunctions',['../struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd',1,'VmaAllocatorCreateInfo']]]
+ ['pallocationcallbacks_350',['pAllocationCallbacks',['../struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d',1,'VmaAllocatorCreateInfo']]],
+ ['pallocations_351',['pAllocations',['../struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32',1,'VmaDefragmentationInfo2']]],
+ ['pallocationschanged_352',['pAllocationsChanged',['../struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc',1,'VmaDefragmentationInfo2']]],
+ ['pdevicememorycallbacks_353',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]],
+ ['pfilepath_354',['pFilePath',['../struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d',1,'VmaRecordSettings']]],
+ ['pfnallocate_355',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]],
+ ['pfnfree_356',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]],
+ ['pheapsizelimit_357',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]],
+ ['physicaldevice_358',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo::physicalDevice()'],['../struct_vma_allocator_info.html#aba2b703f96e51d567717e1fb2935b47a',1,'VmaAllocatorInfo::physicalDevice()']]],
+ ['pmappeddata_359',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]],
+ ['pmoves_360',['pMoves',['../struct_vma_defragmentation_pass_info.html#acbd42d4a3357999da130a95cd99a3792',1,'VmaDefragmentationPassInfo']]],
+ ['pool_361',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]],
+ ['poolcount_362',['poolCount',['../struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d',1,'VmaDefragmentationInfo2']]],
+ ['ppools_363',['pPools',['../struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b',1,'VmaDefragmentationInfo2']]],
+ ['precordsettings_364',['pRecordSettings',['../struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee',1,'VmaAllocatorCreateInfo']]],
+ ['preferredflags_365',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]],
+ ['preferredlargeheapblocksize_366',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]],
+ ['priority_367',['priority',['../struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7',1,'VmaAllocationCreateInfo::priority()'],['../struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274',1,'VmaPoolCreateInfo::priority()']]],
+ ['puserdata_368',['pUserData',['../struct_vma_device_memory_callbacks.html#a24052de0937ddd54015a2df0363903c6',1,'VmaDeviceMemoryCallbacks::pUserData()'],['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()']]],
+ ['pvulkanfunctions_369',['pVulkanFunctions',['../struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd',1,'VmaAllocatorCreateInfo']]]
];
diff --git a/docs/html/search/variables_9.js b/docs/html/search/variables_9.js
index 18f4728..839c821 100644
--- a/docs/html/search/variables_9.js
+++ b/docs/html/search/variables_9.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['requiredflags_368',['requiredFlags',['../struct_vma_allocation_create_info.html#a9166390303ff42d783305bc31c2b6b90',1,'VmaAllocationCreateInfo']]]
+ ['requiredflags_370',['requiredFlags',['../struct_vma_allocation_create_info.html#a9166390303ff42d783305bc31c2b6b90',1,'VmaAllocationCreateInfo']]]
];
diff --git a/docs/html/search/variables_a.js b/docs/html/search/variables_a.js
index d9db73f..ce02717 100644
--- a/docs/html/search/variables_a.js
+++ b/docs/html/search/variables_a.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['size_369',['size',['../struct_vma_pool_stats.html#a326807b2de2b0931cee4ed9a5f2e420c',1,'VmaPoolStats::size()'],['../struct_vma_allocation_info.html#aac76d113a6a5ccbb09fea00fb25fd18f',1,'VmaAllocationInfo::size()']]]
+ ['size_371',['size',['../struct_vma_pool_stats.html#a326807b2de2b0931cee4ed9a5f2e420c',1,'VmaPoolStats::size()'],['../struct_vma_allocation_info.html#aac76d113a6a5ccbb09fea00fb25fd18f',1,'VmaAllocationInfo::size()']]]
];
diff --git a/docs/html/search/variables_b.js b/docs/html/search/variables_b.js
index 2132c6b..a4a74ee 100644
--- a/docs/html/search/variables_b.js
+++ b/docs/html/search/variables_b.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['total_370',['total',['../struct_vma_stats.html#a2e8f5b3353f2fefef3c27f29e245a1f9',1,'VmaStats']]]
+ ['total_372',['total',['../struct_vma_stats.html#a2e8f5b3353f2fefef3c27f29e245a1f9',1,'VmaStats']]]
];
diff --git a/docs/html/search/variables_c.js b/docs/html/search/variables_c.js
index 9a7df57..c39f789 100644
--- a/docs/html/search/variables_c.js
+++ b/docs/html/search/variables_c.js
@@ -1,11 +1,11 @@
var searchData=
[
- ['unusedbytes_371',['unusedBytes',['../struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669',1,'VmaStatInfo']]],
- ['unusedrangecount_372',['unusedRangeCount',['../struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9',1,'VmaStatInfo::unusedRangeCount()'],['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()']]],
- ['unusedrangesizeavg_373',['unusedRangeSizeAvg',['../struct_vma_stat_info.html#a2f9b3452af90c9768a30b7fb6ae194fc',1,'VmaStatInfo']]],
- ['unusedrangesizemax_374',['unusedRangeSizeMax',['../struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4',1,'VmaStatInfo::unusedRangeSizeMax()'],['../struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b',1,'VmaPoolStats::unusedRangeSizeMax()']]],
- ['unusedrangesizemin_375',['unusedRangeSizeMin',['../struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4',1,'VmaStatInfo']]],
- ['unusedsize_376',['unusedSize',['../struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8',1,'VmaPoolStats']]],
- ['usage_377',['usage',['../struct_vma_budget.html#a84dd1ecca8b0110259eb206dbadb11f6',1,'VmaBudget::usage()'],['../struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910',1,'VmaAllocationCreateInfo::usage()']]],
- ['usedbytes_378',['usedBytes',['../struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a',1,'VmaStatInfo']]]
+ ['unusedbytes_373',['unusedBytes',['../struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669',1,'VmaStatInfo']]],
+ ['unusedrangecount_374',['unusedRangeCount',['../struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9',1,'VmaStatInfo::unusedRangeCount()'],['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()']]],
+ ['unusedrangesizeavg_375',['unusedRangeSizeAvg',['../struct_vma_stat_info.html#a2f9b3452af90c9768a30b7fb6ae194fc',1,'VmaStatInfo']]],
+ ['unusedrangesizemax_376',['unusedRangeSizeMax',['../struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4',1,'VmaStatInfo::unusedRangeSizeMax()'],['../struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b',1,'VmaPoolStats::unusedRangeSizeMax()']]],
+ ['unusedrangesizemin_377',['unusedRangeSizeMin',['../struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4',1,'VmaStatInfo']]],
+ ['unusedsize_378',['unusedSize',['../struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8',1,'VmaPoolStats']]],
+ ['usage_379',['usage',['../struct_vma_budget.html#a84dd1ecca8b0110259eb206dbadb11f6',1,'VmaBudget::usage()'],['../struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910',1,'VmaAllocationCreateInfo::usage()']]],
+ ['usedbytes_380',['usedBytes',['../struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a',1,'VmaStatInfo']]]
];
diff --git a/docs/html/search/variables_d.js b/docs/html/search/variables_d.js
index 54b59a5..fe41f7e 100644
--- a/docs/html/search/variables_d.js
+++ b/docs/html/search/variables_d.js
@@ -1,21 +1,21 @@
var searchData=
[
- ['vkallocatememory_379',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]],
- ['vkbindbuffermemory_380',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]],
- ['vkbindimagememory_381',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]],
- ['vkcmdcopybuffer_382',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]],
- ['vkcreatebuffer_383',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]],
- ['vkcreateimage_384',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]],
- ['vkdestroybuffer_385',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]],
- ['vkdestroyimage_386',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]],
- ['vkflushmappedmemoryranges_387',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]],
- ['vkfreememory_388',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]],
- ['vkgetbuffermemoryrequirements_389',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]],
- ['vkgetimagememoryrequirements_390',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]],
- ['vkgetphysicaldevicememoryproperties_391',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]],
- ['vkgetphysicaldeviceproperties_392',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]],
- ['vkinvalidatemappedmemoryranges_393',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]],
- ['vkmapmemory_394',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]],
- ['vkunmapmemory_395',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]],
- ['vulkanapiversion_396',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]]
+ ['vkallocatememory_381',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]],
+ ['vkbindbuffermemory_382',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]],
+ ['vkbindimagememory_383',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]],
+ ['vkcmdcopybuffer_384',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]],
+ ['vkcreatebuffer_385',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]],
+ ['vkcreateimage_386',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]],
+ ['vkdestroybuffer_387',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]],
+ ['vkdestroyimage_388',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]],
+ ['vkflushmappedmemoryranges_389',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]],
+ ['vkfreememory_390',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]],
+ ['vkgetbuffermemoryrequirements_391',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]],
+ ['vkgetimagememoryrequirements_392',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]],
+ ['vkgetphysicaldevicememoryproperties_393',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]],
+ ['vkgetphysicaldeviceproperties_394',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]],
+ ['vkinvalidatemappedmemoryranges_395',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]],
+ ['vkmapmemory_396',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]],
+ ['vkunmapmemory_397',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]],
+ ['vulkanapiversion_398',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]]
];
diff --git a/docs/html/struct_vma_pool_create_info-members.html b/docs/html/struct_vma_pool_create_info-members.html
index 484aaff..dfb43a4 100644
--- a/docs/html/struct_vma_pool_create_info-members.html
+++ b/docs/html/struct_vma_pool_create_info-members.html
@@ -73,8 +73,9 @@ $(function() {
frameInUseCount | VmaPoolCreateInfo | |
maxBlockCount | VmaPoolCreateInfo | |
memoryTypeIndex | VmaPoolCreateInfo | |
-
minBlockCount | VmaPoolCreateInfo | |
-
priority | VmaPoolCreateInfo | |
+
minAllocationAlignment | VmaPoolCreateInfo | |
+
minBlockCount | VmaPoolCreateInfo | |
+
priority | VmaPoolCreateInfo | |
+
+◆ minAllocationAlignment
+
+
+
+
+
+ VkDeviceSize VmaPoolCreateInfo::minAllocationAlignment |
+
+
+
+
+
Additional minimum alignment to be used for all allocations created from this pool. Can be 0.
+
Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two. It can be useful in cases where alignment returned by Vulkan by functions like vkGetBufferMemoryRequirements
is not enough, e.g. when doing interop with OpenGL.
+
diff --git a/docs/html/vk__mem__alloc_8h_source.html b/docs/html/vk__mem__alloc_8h_source.html
index 2f4f341..d24963b 100644
--- a/docs/html/vk__mem__alloc_8h_source.html
+++ b/docs/html/vk__mem__alloc_8h_source.html
@@ -548,757 +548,751 @@ $(function() {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 3134 VmaPool VMA_NULLABLE * VMA_NOT_NULL pPool);
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- 3162 size_t* VMA_NULLABLE pLostAllocationCount);
-
-
-
-
-
-
- 3189 const char* VMA_NULLABLE * VMA_NOT_NULL ppName);
-
-
-
-
- 3199 const char* VMA_NULLABLE pName);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 3293 const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements,
-
-
-
-
-
-
- 3319 const VkMemoryRequirements* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pVkMemoryRequirements,
-
- 3321 size_t allocationCount,
- 3322 VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
- 3323 VmaAllocationInfo* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationInfo);
-
-
-
- 3333 VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer,
-
-
-
-
-
-
- 3341 VkImage VMA_NOT_NULL_NON_DISPATCHABLE image,
-
-
-
-
-
-
-
-
-
-
- 3366 size_t allocationCount,
- 3367 const VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations);
-
-
-
-
-
-
-
-
-
-
-
-
-
- 3424 void* VMA_NULLABLE pUserData);
-
-
-
-
-
-
-
-
- 3481 void* VMA_NULLABLE * VMA_NOT_NULL ppData);
-
-
-
-
-
-
-
-
- 3519 VkDeviceSize offset,
-
-
-
-
-
- 3546 VkDeviceSize offset,
-
-
-
-
- 3565 uint32_t allocationCount,
- 3566 const VmaAllocation VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
- 3567 const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) offsets,
- 3568 const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) sizes);
-
-
-
- 3586 uint32_t allocationCount,
- 3587 const VmaAllocation VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
- 3588 const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) offsets,
- 3589 const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) sizes);
-
-
-
-
-
-
-
-
-
-
+
+ 3141 VmaPool VMA_NULLABLE * VMA_NOT_NULL pPool);
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3169 size_t* VMA_NULLABLE pLostAllocationCount);
+
+
+
+
+
+
+ 3196 const char* VMA_NULLABLE * VMA_NOT_NULL ppName);
+
+
+
+
+ 3206 const char* VMA_NULLABLE pName);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3300 const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements,
+
+
+
+
+
+
+ 3326 const VkMemoryRequirements* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pVkMemoryRequirements,
+
+ 3328 size_t allocationCount,
+ 3329 VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
+ 3330 VmaAllocationInfo* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationInfo);
+
+
+
+ 3340 VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer,
+
+
+
+
+
+
+ 3348 VkImage VMA_NOT_NULL_NON_DISPATCHABLE image,
+
+
+
+
+
+
+
+
+
+
+ 3373 size_t allocationCount,
+ 3374 const VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations);
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3431 void* VMA_NULLABLE pUserData);
+
+
+
+
+
+
+
+
+ 3488 void* VMA_NULLABLE * VMA_NOT_NULL ppData);
+
+
+
+
+
+
+
+
+ 3526 VkDeviceSize offset,
+
+
+
+
+
+ 3553 VkDeviceSize offset,
+
+
+
+
+ 3572 uint32_t allocationCount,
+ 3573 const VmaAllocation VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
+ 3574 const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) offsets,
+ 3575 const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) sizes);
+
+
+
+ 3593 uint32_t allocationCount,
+ 3594 const VmaAllocation VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) allocations,
+ 3595 const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) offsets,
+ 3596 const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) sizes);
+
+
+
+
-
-
-
-
-
-
- 3668 const VmaPool VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(poolCount)
pPools;
-
-
-
-
-
-
-
-
-
- 3702 VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE
memory;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 3840 const VmaAllocation VMA_NOT_NULL * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
- 3841 size_t allocationCount,
- 3842 VkBool32* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationsChanged,
-
-
-
-
-
-
- 3861 VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer);
-
-
-
-
- 3876 VkDeviceSize allocationLocalOffset,
- 3877 VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer,
- 3878 const void* VMA_NULLABLE pNext);
-
-
-
-
- 3895 VkImage VMA_NOT_NULL_NON_DISPATCHABLE image);
-
-
-
-
- 3910 VkDeviceSize allocationLocalOffset,
- 3911 VkImage VMA_NOT_NULL_NON_DISPATCHABLE image,
- 3912 const void* VMA_NULLABLE pNext);
-
-
-
- 3946 const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
-
- 3948 VkBuffer VMA_NULLABLE_NON_DISPATCHABLE * VMA_NOT_NULL pBuffer,
-
-
-
-
-
- 3965 VkBuffer VMA_NULLABLE_NON_DISPATCHABLE buffer,
-
-
-
-
- 3971 const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
-
- 3973 VkImage VMA_NULLABLE_NON_DISPATCHABLE * VMA_NOT_NULL pImage,
-
-
-
-
-
- 3990 VkImage VMA_NULLABLE_NON_DISPATCHABLE image,
-
-
-
-
-
-
-
-
-
- 4000 #if defined(__cplusplus) && defined(__INTELLISENSE__)
- 4001 #define VMA_IMPLEMENTATION
+
+
+
+
+
+
+
+
+
+
+
+
+ 3675 const VmaPool VMA_NOT_NULL * VMA_NULLABLE VMA_LEN_IF_NOT_NULL(poolCount)
pPools;
+
+
+
+
+
+
+
+
+
+ 3709 VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE
memory;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3847 const VmaAllocation VMA_NOT_NULL * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
+ 3848 size_t allocationCount,
+ 3849 VkBool32* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationsChanged,
+
+
+
+
+
+
+ 3868 VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer);
+
+
+
+
+ 3883 VkDeviceSize allocationLocalOffset,
+ 3884 VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer,
+ 3885 const void* VMA_NULLABLE pNext);
+
+
+
+
+ 3902 VkImage VMA_NOT_NULL_NON_DISPATCHABLE image);
+
+
+
+
+ 3917 VkDeviceSize allocationLocalOffset,
+ 3918 VkImage VMA_NOT_NULL_NON_DISPATCHABLE image,
+ 3919 const void* VMA_NULLABLE pNext);
+
+
+
+ 3953 const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo,
+
+ 3955 VkBuffer VMA_NULLABLE_NON_DISPATCHABLE * VMA_NOT_NULL pBuffer,
+
+
+
+
+
+ 3972 VkBuffer VMA_NULLABLE_NON_DISPATCHABLE buffer,
+
+
+
+
+ 3978 const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
+
+ 3980 VkImage VMA_NULLABLE_NON_DISPATCHABLE * VMA_NOT_NULL pImage,
+
+
+
+
+
+ 3997 VkImage VMA_NULLABLE_NON_DISPATCHABLE image,
+
+
+
+
- 4004 #ifdef VMA_IMPLEMENTATION
- 4005 #undef VMA_IMPLEMENTATION
-
-
-
-
-
-
- 4012 #if VMA_RECORDING_ENABLED
-
-
- 4015 #include <windows.h>
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ 4007 #if defined(__cplusplus) && defined(__INTELLISENSE__)
+ 4008 #define VMA_IMPLEMENTATION
+
+
+ 4011 #ifdef VMA_IMPLEMENTATION
+ 4012 #undef VMA_IMPLEMENTATION
+
+
+
+
+
+
+ 4019 #if VMA_RECORDING_ENABLED
+
+
+ 4022 #include <windows.h>
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
- 4035 #if !defined(VMA_STATIC_VULKAN_FUNCTIONS) && !defined(VK_NO_PROTOTYPES)
- 4036 #define VMA_STATIC_VULKAN_FUNCTIONS 1
-
-
-
-
-
-
-
-
- 4045 #if !defined(VMA_DYNAMIC_VULKAN_FUNCTIONS)
- 4046 #define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
- 4047 #if defined(VK_NO_PROTOTYPES)
- 4048 extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
- 4049 extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
-
-
-
-
-
-
-
-
-
-
-
-
- 4062 #if VMA_USE_STL_CONTAINERS
- 4063 #define VMA_USE_STL_VECTOR 1
- 4064 #define VMA_USE_STL_UNORDERED_MAP 1
- 4065 #define VMA_USE_STL_LIST 1
-
-
- 4068 #ifndef VMA_USE_STL_SHARED_MUTEX
-
- 4070 #if __cplusplus >= 201703L
- 4071 #define VMA_USE_STL_SHARED_MUTEX 1
-
-
-
- 4075 #elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 && __cplusplus == 199711L && _MSVC_LANG >= 201703L
- 4076 #define VMA_USE_STL_SHARED_MUTEX 1
-
- 4078 #define VMA_USE_STL_SHARED_MUTEX 0
-
-
-
-
-
-
-
- 4086 #if VMA_USE_STL_VECTOR
-
-
-
- 4090 #if VMA_USE_STL_UNORDERED_MAP
- 4091 #include <unordered_map>
-
-
- 4094 #if VMA_USE_STL_LIST
-
-
-
-
-
-
-
-
- 4103 #include <algorithm>
-
-
-
-
- 4108 #define VMA_NULL nullptr
-
-
- 4111 #if defined(__ANDROID_API__) && (__ANDROID_API__ < 16)
-
- 4113 static void* vma_aligned_alloc(
size_t alignment,
size_t size)
-
-
- 4116 if(alignment <
sizeof(
void*))
-
- 4118 alignment =
sizeof(
void*);
-
-
- 4121 return memalign(alignment, size);
-
- 4123 #elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__linux__) && defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC))
-
-
- 4126 #if defined(__APPLE__)
- 4127 #include <AvailabilityMacros.h>
-
-
- 4130 static void* vma_aligned_alloc(
size_t alignment,
size_t size)
-
- 4132 #if defined(__APPLE__) && (defined(MAC_OS_X_VERSION_10_16) || defined(__IPHONE_14_0))
- 4133 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0
-
-
-
-
-
-
- 4140 if (__builtin_available(macOS 10.15, iOS 13, *))
- 4141 return aligned_alloc(alignment, size);
-
-
-
- 4145 if(alignment <
sizeof(
void*))
-
- 4147 alignment =
sizeof(
void*);
-
-
-
- 4151 if(posix_memalign(&pointer, alignment, size) == 0)
-
-
-
- 4155 #elif defined(_WIN32)
- 4156 static void* vma_aligned_alloc(
size_t alignment,
size_t size)
-
- 4158 return _aligned_malloc(size, alignment);
-
-
- 4161 static void* vma_aligned_alloc(
size_t alignment,
size_t size)
-
- 4163 return aligned_alloc(alignment, size);
-
-
-
-
- 4168 static void vma_aligned_free(
void* ptr)
+
+
+
+
+
+
+
+ 4042 #if !defined(VMA_STATIC_VULKAN_FUNCTIONS) && !defined(VK_NO_PROTOTYPES)
+ 4043 #define VMA_STATIC_VULKAN_FUNCTIONS 1
+
+
+
+
+
+
+
+
+ 4052 #if !defined(VMA_DYNAMIC_VULKAN_FUNCTIONS)
+ 4053 #define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
+ 4054 #if defined(VK_NO_PROTOTYPES)
+ 4055 extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
+ 4056 extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
+
+
+
+
+
+
+
+
+
+
+
+
+ 4069 #if VMA_USE_STL_CONTAINERS
+ 4070 #define VMA_USE_STL_VECTOR 1
+ 4071 #define VMA_USE_STL_UNORDERED_MAP 1
+ 4072 #define VMA_USE_STL_LIST 1
+
+
+ 4075 #ifndef VMA_USE_STL_SHARED_MUTEX
+
+ 4077 #if __cplusplus >= 201703L
+ 4078 #define VMA_USE_STL_SHARED_MUTEX 1
+
+
+
+ 4082 #elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 && __cplusplus == 199711L && _MSVC_LANG >= 201703L
+ 4083 #define VMA_USE_STL_SHARED_MUTEX 1
+
+ 4085 #define VMA_USE_STL_SHARED_MUTEX 0
+
+
+
+
+
+
+
+ 4093 #if VMA_USE_STL_VECTOR
+
+
+
+ 4097 #if VMA_USE_STL_UNORDERED_MAP
+ 4098 #include <unordered_map>
+
+
+ 4101 #if VMA_USE_STL_LIST
+
+
+
+
+
+
+
+
+ 4110 #include <algorithm>
+
+
+
+
+ 4115 #define VMA_NULL nullptr
+
+
+ 4118 #if defined(__ANDROID_API__) && (__ANDROID_API__ < 16)
+
+ 4120 static void* vma_aligned_alloc(
size_t alignment,
size_t size)
+
+
+ 4123 if(alignment <
sizeof(
void*))
+
+ 4125 alignment =
sizeof(
void*);
+
+
+ 4128 return memalign(alignment, size);
+
+ 4130 #elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__linux__) && defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC))
+
+
+ 4133 #if defined(__APPLE__)
+ 4134 #include <AvailabilityMacros.h>
+
+
+ 4137 static void* vma_aligned_alloc(
size_t alignment,
size_t size)
+
+ 4139 #if defined(__APPLE__) && (defined(MAC_OS_X_VERSION_10_16) || defined(__IPHONE_14_0))
+ 4140 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0
+
+
+
+
+
+
+ 4147 if (__builtin_available(macOS 10.15, iOS 13, *))
+ 4148 return aligned_alloc(alignment, size);
+
+
+
+ 4152 if(alignment <
sizeof(
void*))
+
+ 4154 alignment =
sizeof(
void*);
+
+
+
+ 4158 if(posix_memalign(&pointer, alignment, size) == 0)
+
+
+
+ 4162 #elif defined(_WIN32)
+ 4163 static void* vma_aligned_alloc(
size_t alignment,
size_t size)
+
+ 4165 return _aligned_malloc(size, alignment);
+
+
+ 4168 static void* vma_aligned_alloc(
size_t alignment,
size_t size)
-
+ 4170 return aligned_alloc(alignment, size);
-
- 4173 static void vma_aligned_free(
void* VMA_NULLABLE ptr)
-
-
-
-
-
-
-
-
-
-
-
-
-
- 4187 #define VMA_ASSERT(expr)
-
- 4189 #define VMA_ASSERT(expr) assert(expr)
-
-
-
-
-
- 4195 #ifndef VMA_HEAVY_ASSERT
-
- 4197 #define VMA_HEAVY_ASSERT(expr)
-
- 4199 #define VMA_HEAVY_ASSERT(expr)
-
-
-
- 4203 #ifndef VMA_ALIGN_OF
- 4204 #define VMA_ALIGN_OF(type) (__alignof(type))
-
-
- 4207 #ifndef VMA_SYSTEM_ALIGNED_MALLOC
- 4208 #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) vma_aligned_alloc((alignment), (size))
-
-
- 4211 #ifndef VMA_SYSTEM_ALIGNED_FREE
-
- 4213 #if defined(VMA_SYSTEM_FREE)
- 4214 #define VMA_SYSTEM_ALIGNED_FREE(ptr) VMA_SYSTEM_FREE(ptr)
-
- 4216 #define VMA_SYSTEM_ALIGNED_FREE(ptr) vma_aligned_free(ptr)
-
-
-
-
- 4221 #define VMA_MIN(v1, v2) (std::min((v1), (v2)))
-
-
-
- 4225 #define VMA_MAX(v1, v2) (std::max((v1), (v2)))
-
-
-
- 4229 #define VMA_SWAP(v1, v2) std::swap((v1), (v2))
-
-
-
- 4233 #define VMA_SORT(beg, end, cmp) std::sort(beg, end, cmp)
-
-
- 4236 #ifndef VMA_DEBUG_LOG
- 4237 #define VMA_DEBUG_LOG(format, ...)
-
-
-
-
-
-
-
-
-
- 4247 #if VMA_STATS_STRING_ENABLED
- 4248 static inline void VmaUint32ToStr(
char* VMA_NOT_NULL outStr,
size_t strLen, uint32_t num)
-
- 4250 snprintf(outStr, strLen,
"%u",
static_cast<unsigned int>(num));
-
- 4252 static inline void VmaUint64ToStr(
char* VMA_NOT_NULL outStr,
size_t strLen, uint64_t num)
-
- 4254 snprintf(outStr, strLen,
"%llu",
static_cast<unsigned long long>(num));
-
- 4256 static inline void VmaPtrToStr(
char* VMA_NOT_NULL outStr,
size_t strLen,
const void* ptr)
-
- 4258 snprintf(outStr, strLen,
"%p", ptr);
-
-
-
-
-
+
+
+
+ 4175 static void vma_aligned_free(
void* ptr)
+
+
+
+
+ 4180 static void vma_aligned_free(
void* VMA_NULLABLE ptr)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4194 #define VMA_ASSERT(expr)
+
+ 4196 #define VMA_ASSERT(expr) assert(expr)
+
+
+
+
+
+ 4202 #ifndef VMA_HEAVY_ASSERT
+
+ 4204 #define VMA_HEAVY_ASSERT(expr)
+
+ 4206 #define VMA_HEAVY_ASSERT(expr)
+
+
+
+ 4210 #ifndef VMA_ALIGN_OF
+ 4211 #define VMA_ALIGN_OF(type) (__alignof(type))
+
+
+ 4214 #ifndef VMA_SYSTEM_ALIGNED_MALLOC
+ 4215 #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) vma_aligned_alloc((alignment), (size))
+
+
+ 4218 #ifndef VMA_SYSTEM_ALIGNED_FREE
+
+ 4220 #if defined(VMA_SYSTEM_FREE)
+ 4221 #define VMA_SYSTEM_ALIGNED_FREE(ptr) VMA_SYSTEM_FREE(ptr)
+
+ 4223 #define VMA_SYSTEM_ALIGNED_FREE(ptr) vma_aligned_free(ptr)
+
+
+
+
+ 4228 #define VMA_MIN(v1, v2) (std::min((v1), (v2)))
+
+
+
+ 4232 #define VMA_MAX(v1, v2) (std::max((v1), (v2)))
+
+
+
+ 4236 #define VMA_SWAP(v1, v2) std::swap((v1), (v2))
+
+
+
+ 4240 #define VMA_SORT(beg, end, cmp) std::sort(beg, end, cmp)
+
+
+ 4243 #ifndef VMA_DEBUG_LOG
+ 4244 #define VMA_DEBUG_LOG(format, ...)
+
+
+
+
+
+
+
+
+
+ 4254 #if VMA_STATS_STRING_ENABLED
+ 4255 static inline void VmaUint32ToStr(
char* VMA_NOT_NULL outStr,
size_t strLen, uint32_t num)
+
+ 4257 snprintf(outStr, strLen,
"%u",
static_cast<unsigned int>(num));
+
+ 4259 static inline void VmaUint64ToStr(
char* VMA_NOT_NULL outStr,
size_t strLen, uint64_t num)
+
+ 4261 snprintf(outStr, strLen,
"%llu",
static_cast<unsigned long long>(num));
+
+ 4263 static inline void VmaPtrToStr(
char* VMA_NOT_NULL outStr,
size_t strLen,
const void* ptr)
-
- 4266 void Lock() { m_Mutex.lock(); }
- 4267 void Unlock() { m_Mutex.unlock(); }
- 4268 bool TryLock() {
return m_Mutex.try_lock(); }
-
-
-
- 4272 #define VMA_MUTEX VmaMutex
-
-
-
- 4276 #ifndef VMA_RW_MUTEX
- 4277 #if VMA_USE_STL_SHARED_MUTEX
-
- 4279 #include <shared_mutex>
-
-
-
- 4283 void LockRead() { m_Mutex.lock_shared(); }
- 4284 void UnlockRead() { m_Mutex.unlock_shared(); }
- 4285 bool TryLockRead() {
return m_Mutex.try_lock_shared(); }
- 4286 void LockWrite() { m_Mutex.lock(); }
- 4287 void UnlockWrite() { m_Mutex.unlock(); }
- 4288 bool TryLockWrite() {
return m_Mutex.try_lock(); }
-
- 4290 std::shared_mutex m_Mutex;
-
- 4292 #define VMA_RW_MUTEX VmaRWMutex
- 4293 #elif defined(_WIN32) && defined(WINVER) && WINVER >= 0x0600
-
-
-
-
-
- 4299 VmaRWMutex() { InitializeSRWLock(&m_Lock); }
- 4300 void LockRead() { AcquireSRWLockShared(&m_Lock); }
- 4301 void UnlockRead() { ReleaseSRWLockShared(&m_Lock); }
- 4302 bool TryLockRead() {
return TryAcquireSRWLockShared(&m_Lock) != FALSE; }
- 4303 void LockWrite() { AcquireSRWLockExclusive(&m_Lock); }
- 4304 void UnlockWrite() { ReleaseSRWLockExclusive(&m_Lock); }
- 4305 bool TryLockWrite() {
return TryAcquireSRWLockExclusive(&m_Lock) != FALSE; }
-
-
-
- 4309 #define VMA_RW_MUTEX VmaRWMutex
-
-
-
-
-
- 4315 void LockRead() { m_Mutex.Lock(); }
- 4316 void UnlockRead() { m_Mutex.Unlock(); }
- 4317 bool TryLockRead() {
return m_Mutex.TryLock(); }
- 4318 void LockWrite() { m_Mutex.Lock(); }
- 4319 void UnlockWrite() { m_Mutex.Unlock(); }
- 4320 bool TryLockWrite() {
return m_Mutex.TryLock(); }
-
-
-
- 4324 #define VMA_RW_MUTEX VmaRWMutex
-
-
-
-
-
-
- 4331 #ifndef VMA_ATOMIC_UINT32
-
- 4333 #define VMA_ATOMIC_UINT32 std::atomic<uint32_t>
-
-
- 4336 #ifndef VMA_ATOMIC_UINT64
-
- 4338 #define VMA_ATOMIC_UINT64 std::atomic<uint64_t>
-
-
- 4341 #ifndef VMA_DEBUG_ALWAYS_DEDICATED_MEMORY
- 4346 #define VMA_DEBUG_ALWAYS_DEDICATED_MEMORY (0)
-
-
- 4349 #ifndef VMA_DEBUG_ALIGNMENT
- 4354 #define VMA_DEBUG_ALIGNMENT (1)
-
-
- 4357 #ifndef VMA_DEBUG_MARGIN
- 4362 #define VMA_DEBUG_MARGIN (0)
-
-
- 4365 #ifndef VMA_DEBUG_INITIALIZE_ALLOCATIONS
- 4370 #define VMA_DEBUG_INITIALIZE_ALLOCATIONS (0)
-
-
- 4373 #ifndef VMA_DEBUG_DETECT_CORRUPTION
- 4379 #define VMA_DEBUG_DETECT_CORRUPTION (0)
-
-
- 4382 #ifndef VMA_DEBUG_GLOBAL_MUTEX
- 4387 #define VMA_DEBUG_GLOBAL_MUTEX (0)
-
-
- 4390 #ifndef VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY
- 4395 #define VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY (1)
-
-
- 4398 #ifndef VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT
-
-
-
-
- 4403 #define VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT (0)
-
-
- 4406 #ifndef VMA_SMALL_HEAP_MAX_SIZE
- 4408 #define VMA_SMALL_HEAP_MAX_SIZE (1024ull * 1024 * 1024)
-
-
- 4411 #ifndef VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE
- 4413 #define VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE (256ull * 1024 * 1024)
-
-
- 4416 #ifndef VMA_CLASS_NO_COPY
- 4417 #define VMA_CLASS_NO_COPY(className) \
-
- 4419 className(const className&) = delete; \
- 4420 className& operator=(const className&) = delete;
-
-
- 4423 static const uint32_t VMA_FRAME_INDEX_LOST = UINT32_MAX;
-
-
- 4426 static const uint32_t VMA_CORRUPTION_DETECTION_MAGIC_VALUE = 0x7F84E666;
-
- 4428 static const uint8_t VMA_ALLOCATION_FILL_PATTERN_CREATED = 0xDC;
- 4429 static const uint8_t VMA_ALLOCATION_FILL_PATTERN_DESTROYED = 0xEF;
-
-
-
-
-
-
-
- 4437 static const uint32_t VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY = 0x00000040;
- 4438 static const uint32_t VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY = 0x00000080;
- 4439 static const uint32_t VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY = 0x00020000;
-
- 4441 static const uint32_t VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET = 0x10000000u;
-
- 4443 static VkAllocationCallbacks VmaEmptyAllocationCallbacks = {
- 4444 VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL };
+ 4265 snprintf(outStr, strLen,
"%p", ptr);
+
+
+
+
+
+
+
+ 4273 void Lock() { m_Mutex.lock(); }
+ 4274 void Unlock() { m_Mutex.unlock(); }
+ 4275 bool TryLock() {
return m_Mutex.try_lock(); }
+
+
+
+ 4279 #define VMA_MUTEX VmaMutex
+
+
+
+ 4283 #ifndef VMA_RW_MUTEX
+ 4284 #if VMA_USE_STL_SHARED_MUTEX
+
+ 4286 #include <shared_mutex>
+
+
+
+ 4290 void LockRead() { m_Mutex.lock_shared(); }
+ 4291 void UnlockRead() { m_Mutex.unlock_shared(); }
+ 4292 bool TryLockRead() {
return m_Mutex.try_lock_shared(); }
+ 4293 void LockWrite() { m_Mutex.lock(); }
+ 4294 void UnlockWrite() { m_Mutex.unlock(); }
+ 4295 bool TryLockWrite() {
return m_Mutex.try_lock(); }
+
+ 4297 std::shared_mutex m_Mutex;
+
+ 4299 #define VMA_RW_MUTEX VmaRWMutex
+ 4300 #elif defined(_WIN32) && defined(WINVER) && WINVER >= 0x0600
+
+
+
+
+
+ 4306 VmaRWMutex() { InitializeSRWLock(&m_Lock); }
+ 4307 void LockRead() { AcquireSRWLockShared(&m_Lock); }
+ 4308 void UnlockRead() { ReleaseSRWLockShared(&m_Lock); }
+ 4309 bool TryLockRead() {
return TryAcquireSRWLockShared(&m_Lock) != FALSE; }
+ 4310 void LockWrite() { AcquireSRWLockExclusive(&m_Lock); }
+ 4311 void UnlockWrite() { ReleaseSRWLockExclusive(&m_Lock); }
+ 4312 bool TryLockWrite() {
return TryAcquireSRWLockExclusive(&m_Lock) != FALSE; }
+
+
+
+ 4316 #define VMA_RW_MUTEX VmaRWMutex
+
+
+
+
+
+ 4322 void LockRead() { m_Mutex.Lock(); }
+ 4323 void UnlockRead() { m_Mutex.Unlock(); }
+ 4324 bool TryLockRead() {
return m_Mutex.TryLock(); }
+ 4325 void LockWrite() { m_Mutex.Lock(); }
+ 4326 void UnlockWrite() { m_Mutex.Unlock(); }
+ 4327 bool TryLockWrite() {
return m_Mutex.TryLock(); }
+
+
+
+ 4331 #define VMA_RW_MUTEX VmaRWMutex
+
+
+
+
+
+
+ 4338 #ifndef VMA_ATOMIC_UINT32
+
+ 4340 #define VMA_ATOMIC_UINT32 std::atomic<uint32_t>
+
+
+ 4343 #ifndef VMA_ATOMIC_UINT64
+
+ 4345 #define VMA_ATOMIC_UINT64 std::atomic<uint64_t>
+
+
+ 4348 #ifndef VMA_DEBUG_ALWAYS_DEDICATED_MEMORY
+ 4353 #define VMA_DEBUG_ALWAYS_DEDICATED_MEMORY (0)
+
+
+ 4356 #ifndef VMA_MIN_ALIGNMENT
+ 4361 #ifdef VMA_DEBUG_ALIGNMENT
+ 4362 #define VMA_MIN_ALIGNMENT VMA_DEBUG_ALIGNMENT
+
+ 4364 #define VMA_MIN_ALIGNMENT (1)
+
+
+
+ 4368 #ifndef VMA_DEBUG_MARGIN
+ 4373 #define VMA_DEBUG_MARGIN (0)
+
+
+ 4376 #ifndef VMA_DEBUG_INITIALIZE_ALLOCATIONS
+ 4381 #define VMA_DEBUG_INITIALIZE_ALLOCATIONS (0)
+
+
+ 4384 #ifndef VMA_DEBUG_DETECT_CORRUPTION
+ 4390 #define VMA_DEBUG_DETECT_CORRUPTION (0)
+
+
+ 4393 #ifndef VMA_DEBUG_GLOBAL_MUTEX
+ 4398 #define VMA_DEBUG_GLOBAL_MUTEX (0)
+
+
+ 4401 #ifndef VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY
+ 4406 #define VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY (1)
+
+
+ 4409 #ifndef VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT
+
+
+
+
+ 4414 #define VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT (0)
+
+
+ 4417 #ifndef VMA_SMALL_HEAP_MAX_SIZE
+ 4419 #define VMA_SMALL_HEAP_MAX_SIZE (1024ull * 1024 * 1024)
+
+
+ 4422 #ifndef VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE
+ 4424 #define VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE (256ull * 1024 * 1024)
+
+
+ 4427 #ifndef VMA_CLASS_NO_COPY
+ 4428 #define VMA_CLASS_NO_COPY(className) \
+
+ 4430 className(const className&) = delete; \
+ 4431 className& operator=(const className&) = delete;
+
+
+ 4434 static const uint32_t VMA_FRAME_INDEX_LOST = UINT32_MAX;
+
+
+ 4437 static const uint32_t VMA_CORRUPTION_DETECTION_MAGIC_VALUE = 0x7F84E666;
+
+ 4439 static const uint8_t VMA_ALLOCATION_FILL_PATTERN_CREATED = 0xDC;
+ 4440 static const uint8_t VMA_ALLOCATION_FILL_PATTERN_DESTROYED = 0xEF;
+
+
+
+
-
- 4447 static inline uint32_t VmaCountBitsSet(uint32_t v)
-
- 4449 uint32_t c = v - ((v >> 1) & 0x55555555);
- 4450 c = ((c >> 2) & 0x33333333) + (c & 0x33333333);
- 4451 c = ((c >> 4) + c) & 0x0F0F0F0F;
- 4452 c = ((c >> 8) + c) & 0x00FF00FF;
- 4453 c = ((c >> 16) + c) & 0x0000FFFF;
-
-
+
+
+ 4448 static const uint32_t VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY = 0x00000040;
+ 4449 static const uint32_t VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY = 0x00000080;
+ 4450 static const uint32_t VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY = 0x00020000;
+
+ 4452 static const uint32_t VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET = 0x10000000u;
+
+ 4454 static VkAllocationCallbacks VmaEmptyAllocationCallbacks = {
+ 4455 VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL };
-
-
-
-
-
- 4462 template <
typename T>
- 4463 inline bool VmaIsPow2(T x)
-
- 4465 return (x & (x-1)) == 0;
+
+ 4458 static inline uint32_t VmaCountBitsSet(uint32_t v)
+
+ 4460 uint32_t c = v - ((v >> 1) & 0x55555555);
+ 4461 c = ((c >> 2) & 0x33333333) + (c & 0x33333333);
+ 4462 c = ((c >> 4) + c) & 0x0F0F0F0F;
+ 4463 c = ((c >> 8) + c) & 0x00FF00FF;
+ 4464 c = ((c >> 16) + c) & 0x0000FFFF;
+
-
-
- 4470 template <
typename T>
- 4471 static inline T VmaAlignUp(T val, T alignment)
-
- 4473 VMA_HEAVY_ASSERT(VmaIsPow2(alignment));
- 4474 return (val + alignment - 1) & ~(alignment - 1);
-
-
-
- 4478 template <
typename T>
- 4479 static inline T VmaAlignDown(T val, T alignment)
-
- 4481 VMA_HEAVY_ASSERT(VmaIsPow2(alignment));
- 4482 return val & ~(alignment - 1);
-
-
-
- 4486 template <
typename T>
- 4487 static inline T VmaRoundDiv(T x, T y)
-
- 4489 return (x + (y / (T)2)) / y;
-
-
-
- 4493 static inline uint32_t VmaNextPow2(uint32_t v)
-
-
-
-
-
-
-
-
-
-
- 4504 static inline uint64_t VmaNextPow2(uint64_t v)
+
+
+
+
+
+ 4473 template <
typename T>
+ 4474 inline bool VmaIsPow2(T x)
+
+ 4476 return (x & (x-1)) == 0;
+
+
+
+
+ 4481 template <
typename T>
+ 4482 static inline T VmaAlignUp(T val, T alignment)
+
+ 4484 VMA_HEAVY_ASSERT(VmaIsPow2(alignment));
+ 4485 return (val + alignment - 1) & ~(alignment - 1);
+
+
+
+ 4489 template <
typename T>
+ 4490 static inline T VmaAlignDown(T val, T alignment)
+
+ 4492 VMA_HEAVY_ASSERT(VmaIsPow2(alignment));
+ 4493 return val & ~(alignment - 1);
+
+
+
+ 4497 template <
typename T>
+ 4498 static inline T VmaRoundDiv(T x, T y)
+
+ 4500 return (x + (y / (T)2)) / y;
+
+
+
+ 4504 static inline uint32_t VmaNextPow2(uint32_t v)
@@ -1306,15052 +1300,15063 @@ $(function() {
-
-
-
-
-
-
- 4518 static inline uint32_t VmaPrevPow2(uint32_t v)
-
-
-
-
-
-
-
-
-
- 4528 static inline uint64_t VmaPrevPow2(uint64_t v)
-
-
-
-
-
-
-
+
+
+
+ 4515 static inline uint64_t VmaNextPow2(uint64_t v)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4529 static inline uint32_t VmaPrevPow2(uint32_t v)
+
+
+
+
+
+
-
- 4540 static inline bool VmaStrIsEmpty(
const char* pStr)
-
- 4542 return pStr == VMA_NULL || *pStr ==
'\0';
-
-
- 4545 #if VMA_STATS_STRING_ENABLED
-
- 4547 static const char* VmaAlgorithmToStr(uint32_t algorithm)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 4567 template<
typename Iterator,
typename Compare>
- 4568 Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)
-
- 4570 Iterator centerValue = end; --centerValue;
- 4571 Iterator insertIndex = beg;
- 4572 for(Iterator memTypeIndex = beg; memTypeIndex < centerValue; ++memTypeIndex)
-
- 4574 if(cmp(*memTypeIndex, *centerValue))
-
- 4576 if(insertIndex != memTypeIndex)
-
- 4578 VMA_SWAP(*memTypeIndex, *insertIndex);
-
-
-
-
- 4583 if(insertIndex != centerValue)
+ 4539 static inline uint64_t VmaPrevPow2(uint64_t v)
+
+
+
+
+
+
+
+
+
+
+
+ 4551 static inline bool VmaStrIsEmpty(
const char* pStr)
+
+ 4553 return pStr == VMA_NULL || *pStr ==
'\0';
+
+
+ 4556 #if VMA_STATS_STRING_ENABLED
+
+ 4558 static const char* VmaAlgorithmToStr(uint32_t algorithm)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4578 template<
typename Iterator,
typename Compare>
+ 4579 Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)
+
+ 4581 Iterator centerValue = end; --centerValue;
+ 4582 Iterator insertIndex = beg;
+ 4583 for(Iterator memTypeIndex = beg; memTypeIndex < centerValue; ++memTypeIndex)
- 4585 VMA_SWAP(*insertIndex, *centerValue);
-
-
-
-
- 4590 template<
typename Iterator,
typename Compare>
- 4591 void VmaQuickSort(Iterator beg, Iterator end, Compare cmp)
-
-
-
- 4595 Iterator it = VmaQuickSortPartition<Iterator, Compare>(beg, end, cmp);
- 4596 VmaQuickSort<Iterator, Compare>(beg, it, cmp);
- 4597 VmaQuickSort<Iterator, Compare>(it + 1, end, cmp);
-
+ 4585 if(cmp(*memTypeIndex, *centerValue))
+
+ 4587 if(insertIndex != memTypeIndex)
+
+ 4589 VMA_SWAP(*memTypeIndex, *insertIndex);
+
+
+
+
+ 4594 if(insertIndex != centerValue)
+
+ 4596 VMA_SWAP(*insertIndex, *centerValue);
+
+
- 4601 #define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp)
-
-
-
-
-
-
-
-
-
-
- 4612 static inline bool VmaBlocksOnSamePage(
- 4613 VkDeviceSize resourceAOffset,
- 4614 VkDeviceSize resourceASize,
- 4615 VkDeviceSize resourceBOffset,
- 4616 VkDeviceSize pageSize)
-
- 4618 VMA_ASSERT(resourceAOffset + resourceASize <= resourceBOffset && resourceASize > 0 && pageSize > 0);
- 4619 VkDeviceSize resourceAEnd = resourceAOffset + resourceASize - 1;
- 4620 VkDeviceSize resourceAEndPage = resourceAEnd & ~(pageSize - 1);
- 4621 VkDeviceSize resourceBStart = resourceBOffset;
- 4622 VkDeviceSize resourceBStartPage = resourceBStart & ~(pageSize - 1);
- 4623 return resourceAEndPage == resourceBStartPage;
-
-
- 4626 enum VmaSuballocationType
-
- 4628 VMA_SUBALLOCATION_TYPE_FREE = 0,
- 4629 VMA_SUBALLOCATION_TYPE_UNKNOWN = 1,
- 4630 VMA_SUBALLOCATION_TYPE_BUFFER = 2,
- 4631 VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN = 3,
- 4632 VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR = 4,
- 4633 VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL = 5,
- 4634 VMA_SUBALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF
-
+ 4601 template<
typename Iterator,
typename Compare>
+ 4602 void VmaQuickSort(Iterator beg, Iterator end, Compare cmp)
+
+
+
+ 4606 Iterator it = VmaQuickSortPartition<Iterator, Compare>(beg, end, cmp);
+ 4607 VmaQuickSort<Iterator, Compare>(beg, it, cmp);
+ 4608 VmaQuickSort<Iterator, Compare>(it + 1, end, cmp);
+
+
+
+ 4612 #define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp)
+
+
+
+
+
+
+
+
+
+
+ 4623 static inline bool VmaBlocksOnSamePage(
+ 4624 VkDeviceSize resourceAOffset,
+ 4625 VkDeviceSize resourceASize,
+ 4626 VkDeviceSize resourceBOffset,
+ 4627 VkDeviceSize pageSize)
+
+ 4629 VMA_ASSERT(resourceAOffset + resourceASize <= resourceBOffset && resourceASize > 0 && pageSize > 0);
+ 4630 VkDeviceSize resourceAEnd = resourceAOffset + resourceASize - 1;
+ 4631 VkDeviceSize resourceAEndPage = resourceAEnd & ~(pageSize - 1);
+ 4632 VkDeviceSize resourceBStart = resourceBOffset;
+ 4633 VkDeviceSize resourceBStartPage = resourceBStart & ~(pageSize - 1);
+ 4634 return resourceAEndPage == resourceBStartPage;
+
-
-
-
-
-
-
- 4643 static inline bool VmaIsBufferImageGranularityConflict(
- 4644 VmaSuballocationType suballocType1,
- 4645 VmaSuballocationType suballocType2)
-
- 4647 if(suballocType1 > suballocType2)
-
- 4649 VMA_SWAP(suballocType1, suballocType2);
-
-
- 4652 switch(suballocType1)
-
- 4654 case VMA_SUBALLOCATION_TYPE_FREE:
-
- 4656 case VMA_SUBALLOCATION_TYPE_UNKNOWN:
-
- 4658 case VMA_SUBALLOCATION_TYPE_BUFFER:
-
- 4660 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
- 4661 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
- 4662 case VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN:
-
- 4664 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
- 4665 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR ||
- 4666 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
- 4667 case VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR:
-
- 4669 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
- 4670 case VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL:
-
-
-
-
-
-
-
- 4678 static void VmaWriteMagicValue(
void* pData, VkDeviceSize offset)
-
- 4680 #if VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_DETECT_CORRUPTION
- 4681 uint32_t* pDst = (uint32_t*)((
char*)pData + offset);
- 4682 const size_t numberCount = VMA_DEBUG_MARGIN /
sizeof(uint32_t);
- 4683 for(
size_t i = 0; i < numberCount; ++i, ++pDst)
-
- 4685 *pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
+ 4637 enum VmaSuballocationType
+
+ 4639 VMA_SUBALLOCATION_TYPE_FREE = 0,
+ 4640 VMA_SUBALLOCATION_TYPE_UNKNOWN = 1,
+ 4641 VMA_SUBALLOCATION_TYPE_BUFFER = 2,
+ 4642 VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN = 3,
+ 4643 VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR = 4,
+ 4644 VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL = 5,
+ 4645 VMA_SUBALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF
+
+
+
+
+
+
+
+
+ 4654 static inline bool VmaIsBufferImageGranularityConflict(
+ 4655 VmaSuballocationType suballocType1,
+ 4656 VmaSuballocationType suballocType2)
+
+ 4658 if(suballocType1 > suballocType2)
+
+ 4660 VMA_SWAP(suballocType1, suballocType2);
+
+
+ 4663 switch(suballocType1)
+
+ 4665 case VMA_SUBALLOCATION_TYPE_FREE:
+
+ 4667 case VMA_SUBALLOCATION_TYPE_UNKNOWN:
+
+ 4669 case VMA_SUBALLOCATION_TYPE_BUFFER:
+
+ 4671 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
+ 4672 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
+ 4673 case VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN:
+
+ 4675 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
+ 4676 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR ||
+ 4677 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
+ 4678 case VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR:
+
+ 4680 suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
+ 4681 case VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL:
+
+
+
+
-
-
-
-
-
- 4692 static bool VmaValidateMagicValue(
const void* pData, VkDeviceSize offset)
-
- 4694 #if VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_DETECT_CORRUPTION
- 4695 const uint32_t* pSrc = (
const uint32_t*)((
const char*)pData + offset);
- 4696 const size_t numberCount = VMA_DEBUG_MARGIN /
sizeof(uint32_t);
- 4697 for(
size_t i = 0; i < numberCount; ++i, ++pSrc)
-
- 4699 if(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
-
-
-
-
-
-
-
-
-
-
-
-
- 4712 static void VmaFillGpuDefragmentationBufferCreateInfo(VkBufferCreateInfo& outBufCreateInfo)
-
- 4714 memset(&outBufCreateInfo, 0,
sizeof(outBufCreateInfo));
- 4715 outBufCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
- 4716 outBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
- 4717 outBufCreateInfo.size = (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE;
-
-
-
-
-
- 4723 VMA_CLASS_NO_COPY(VmaMutexLock)
-
- 4725 VmaMutexLock(VMA_MUTEX& mutex,
bool useMutex =
true) :
- 4726 m_pMutex(useMutex ? &mutex : VMA_NULL)
- 4727 {
if(m_pMutex) { m_pMutex->Lock(); } }
-
- 4729 {
if(m_pMutex) { m_pMutex->Unlock(); } }
-
- 4731 VMA_MUTEX* m_pMutex;
-
-
-
- 4735 struct VmaMutexLockRead
-
- 4737 VMA_CLASS_NO_COPY(VmaMutexLockRead)
-
- 4739 VmaMutexLockRead(VMA_RW_MUTEX& mutex,
bool useMutex) :
- 4740 m_pMutex(useMutex ? &mutex : VMA_NULL)
- 4741 {
if(m_pMutex) { m_pMutex->LockRead(); } }
- 4742 ~VmaMutexLockRead() {
if(m_pMutex) { m_pMutex->UnlockRead(); } }
-
- 4744 VMA_RW_MUTEX* m_pMutex;
-
-
-
- 4748 struct VmaMutexLockWrite
-
- 4750 VMA_CLASS_NO_COPY(VmaMutexLockWrite)
-
- 4752 VmaMutexLockWrite(VMA_RW_MUTEX& mutex,
bool useMutex) :
- 4753 m_pMutex(useMutex ? &mutex : VMA_NULL)
- 4754 {
if(m_pMutex) { m_pMutex->LockWrite(); } }
- 4755 ~VmaMutexLockWrite() {
if(m_pMutex) { m_pMutex->UnlockWrite(); } }
-
- 4757 VMA_RW_MUTEX* m_pMutex;
-
-
- 4760 #if VMA_DEBUG_GLOBAL_MUTEX
- 4761 static VMA_MUTEX gDebugGlobalMutex;
- 4762 #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex, true);
-
- 4764 #define VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-
-
- 4768 static const VkDeviceSize VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER = 16;
-
-
-
-
-
-
-
-
-
-
- 4779 template <
typename CmpLess,
typename IterT,
typename KeyT>
- 4780 static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end,
const KeyT &key,
const CmpLess& cmp)
-
- 4782 size_t down = 0, up = (end - beg);
-
-
- 4785 const size_t mid = down + (up - down) / 2;
- 4786 if(cmp(*(beg+mid), key))
-
-
-
-
-
-
-
-
-
-
-
- 4798 template<
typename CmpLess,
typename IterT,
typename KeyT>
- 4799 IterT VmaBinaryFindSorted(
const IterT& beg,
const IterT& end,
const KeyT& value,
const CmpLess& cmp)
-
- 4801 IterT it = VmaBinaryFindFirstNotLess<CmpLess, IterT, KeyT>(
- 4802 beg, end, value, cmp);
-
- 4804 (!cmp(*it, value) && !cmp(value, *it)))
-
-
-
-
-
-
-
-
-
-
-
- 4816 template<
typename T>
- 4817 static bool VmaValidatePointerArray(uint32_t count,
const T* arr)
-
- 4819 for(uint32_t i = 0; i < count; ++i)
-
- 4821 const T iPtr = arr[i];
- 4822 if(iPtr == VMA_NULL)
-
-
-
- 4826 for(uint32_t j = i + 1; j < count; ++j)
-
-
-
-
-
-
-
-
-
-
- 4837 template<
typename MainT,
typename NewT>
- 4838 static inline void VmaPnextChainPushFront(MainT* mainStruct, NewT* newStruct)
-
- 4840 newStruct->pNext = mainStruct->pNext;
- 4841 mainStruct->pNext = newStruct;
-
-
-
-
- 4847 static void* VmaMalloc(
const VkAllocationCallbacks* pAllocationCallbacks,
size_t size,
size_t alignment)
-
- 4849 void* result = VMA_NULL;
- 4850 if((pAllocationCallbacks != VMA_NULL) &&
- 4851 (pAllocationCallbacks->pfnAllocation != VMA_NULL))
-
- 4853 result = (*pAllocationCallbacks->pfnAllocation)(
- 4854 pAllocationCallbacks->pUserData,
-
-
- 4857 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
-
-
-
- 4861 result = VMA_SYSTEM_ALIGNED_MALLOC(size, alignment);
-
- 4863 VMA_ASSERT(result != VMA_NULL &&
"CPU memory allocation failed.");
-
-
-
- 4867 static void VmaFree(
const VkAllocationCallbacks* pAllocationCallbacks,
void* ptr)
-
- 4869 if((pAllocationCallbacks != VMA_NULL) &&
- 4870 (pAllocationCallbacks->pfnFree != VMA_NULL))
+
+
+ 4689 static void VmaWriteMagicValue(
void* pData, VkDeviceSize offset)
+
+ 4691 #if VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_DETECT_CORRUPTION
+ 4692 uint32_t* pDst = (uint32_t*)((
char*)pData + offset);
+ 4693 const size_t numberCount = VMA_DEBUG_MARGIN /
sizeof(uint32_t);
+ 4694 for(
size_t i = 0; i < numberCount; ++i, ++pDst)
+
+ 4696 *pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
+
+
+
+
+
+
+ 4703 static bool VmaValidateMagicValue(
const void* pData, VkDeviceSize offset)
+
+ 4705 #if VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_DETECT_CORRUPTION
+ 4706 const uint32_t* pSrc = (
const uint32_t*)((
const char*)pData + offset);
+ 4707 const size_t numberCount = VMA_DEBUG_MARGIN /
sizeof(uint32_t);
+ 4708 for(
size_t i = 0; i < numberCount; ++i, ++pSrc)
+
+ 4710 if(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
+
+
+
+
+
+
+
+
+
+
+
+
+ 4723 static void VmaFillGpuDefragmentationBufferCreateInfo(VkBufferCreateInfo& outBufCreateInfo)
+
+ 4725 memset(&outBufCreateInfo, 0,
sizeof(outBufCreateInfo));
+ 4726 outBufCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
+ 4727 outBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+ 4728 outBufCreateInfo.size = (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE;
+
+
+
+
+
+ 4734 VMA_CLASS_NO_COPY(VmaMutexLock)
+
+ 4736 VmaMutexLock(VMA_MUTEX& mutex,
bool useMutex =
true) :
+ 4737 m_pMutex(useMutex ? &mutex : VMA_NULL)
+ 4738 {
if(m_pMutex) { m_pMutex->Lock(); } }
+
+ 4740 {
if(m_pMutex) { m_pMutex->Unlock(); } }
+
+ 4742 VMA_MUTEX* m_pMutex;
+
+
+
+ 4746 struct VmaMutexLockRead
+
+ 4748 VMA_CLASS_NO_COPY(VmaMutexLockRead)
+
+ 4750 VmaMutexLockRead(VMA_RW_MUTEX& mutex,
bool useMutex) :
+ 4751 m_pMutex(useMutex ? &mutex : VMA_NULL)
+ 4752 {
if(m_pMutex) { m_pMutex->LockRead(); } }
+ 4753 ~VmaMutexLockRead() {
if(m_pMutex) { m_pMutex->UnlockRead(); } }
+
+ 4755 VMA_RW_MUTEX* m_pMutex;
+
+
+
+ 4759 struct VmaMutexLockWrite
+
+ 4761 VMA_CLASS_NO_COPY(VmaMutexLockWrite)
+
+ 4763 VmaMutexLockWrite(VMA_RW_MUTEX& mutex,
bool useMutex) :
+ 4764 m_pMutex(useMutex ? &mutex : VMA_NULL)
+ 4765 {
if(m_pMutex) { m_pMutex->LockWrite(); } }
+ 4766 ~VmaMutexLockWrite() {
if(m_pMutex) { m_pMutex->UnlockWrite(); } }
+
+ 4768 VMA_RW_MUTEX* m_pMutex;
+
+
+ 4771 #if VMA_DEBUG_GLOBAL_MUTEX
+ 4772 static VMA_MUTEX gDebugGlobalMutex;
+ 4773 #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex, true);
+
+ 4775 #define VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+
+
+ 4779 static const VkDeviceSize VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER = 16;
+
+
+
+
+
+
+
+
+
+
+ 4790 template <
typename CmpLess,
typename IterT,
typename KeyT>
+ 4791 static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end,
const KeyT &key,
const CmpLess& cmp)
+
+ 4793 size_t down = 0, up = (end - beg);
+
+
+ 4796 const size_t mid = down + (up - down) / 2;
+ 4797 if(cmp(*(beg+mid), key))
+
+
+
+
+
+
+
+
+
+
+
+ 4809 template<
typename CmpLess,
typename IterT,
typename KeyT>
+ 4810 IterT VmaBinaryFindSorted(
const IterT& beg,
const IterT& end,
const KeyT& value,
const CmpLess& cmp)
+
+ 4812 IterT it = VmaBinaryFindFirstNotLess<CmpLess, IterT, KeyT>(
+ 4813 beg, end, value, cmp);
+
+ 4815 (!cmp(*it, value) && !cmp(value, *it)))
+
+
+
+
+
+
+
+
+
+
+
+ 4827 template<
typename T>
+ 4828 static bool VmaValidatePointerArray(uint32_t count,
const T* arr)
+
+ 4830 for(uint32_t i = 0; i < count; ++i)
+
+ 4832 const T iPtr = arr[i];
+ 4833 if(iPtr == VMA_NULL)
+
+
+
+ 4837 for(uint32_t j = i + 1; j < count; ++j)
+
+
+
+
+
+
+
+
+
+
+ 4848 template<
typename MainT,
typename NewT>
+ 4849 static inline void VmaPnextChainPushFront(MainT* mainStruct, NewT* newStruct)
+
+ 4851 newStruct->pNext = mainStruct->pNext;
+ 4852 mainStruct->pNext = newStruct;
+
+
+
+
+ 4858 static void* VmaMalloc(
const VkAllocationCallbacks* pAllocationCallbacks,
size_t size,
size_t alignment)
+
+ 4860 void* result = VMA_NULL;
+ 4861 if((pAllocationCallbacks != VMA_NULL) &&
+ 4862 (pAllocationCallbacks->pfnAllocation != VMA_NULL))
+
+ 4864 result = (*pAllocationCallbacks->pfnAllocation)(
+ 4865 pAllocationCallbacks->pUserData,
+
+
+ 4868 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+
+
- 4872 (*pAllocationCallbacks->pfnFree)(pAllocationCallbacks->pUserData, ptr);
+ 4872 result = VMA_SYSTEM_ALIGNED_MALLOC(size, alignment);
-
-
- 4876 VMA_SYSTEM_ALIGNED_FREE(ptr);
-
-
-
- 4880 template<
typename T>
- 4881 static T* VmaAllocate(
const VkAllocationCallbacks* pAllocationCallbacks)
-
- 4883 return (T*)VmaMalloc(pAllocationCallbacks,
sizeof(T), VMA_ALIGN_OF(T));
-
-
- 4886 template<
typename T>
- 4887 static T* VmaAllocateArray(
const VkAllocationCallbacks* pAllocationCallbacks,
size_t count)
-
- 4889 return (T*)VmaMalloc(pAllocationCallbacks,
sizeof(T) * count, VMA_ALIGN_OF(T));
-
-
- 4892 #define vma_new(allocator, type) new(VmaAllocate<type>(allocator))(type)
-
- 4894 #define vma_new_array(allocator, type, count) new(VmaAllocateArray<type>((allocator), (count)))(type)
-
- 4896 template<
typename T>
- 4897 static void vma_delete(
const VkAllocationCallbacks* pAllocationCallbacks, T* ptr)
-
-
- 4900 VmaFree(pAllocationCallbacks, ptr);
+ 4874 VMA_ASSERT(result != VMA_NULL &&
"CPU memory allocation failed.");
+
+
+
+ 4878 static void VmaFree(
const VkAllocationCallbacks* pAllocationCallbacks,
void* ptr)
+
+ 4880 if((pAllocationCallbacks != VMA_NULL) &&
+ 4881 (pAllocationCallbacks->pfnFree != VMA_NULL))
+
+ 4883 (*pAllocationCallbacks->pfnFree)(pAllocationCallbacks->pUserData, ptr);
+
+
+
+ 4887 VMA_SYSTEM_ALIGNED_FREE(ptr);
+
+
+
+ 4891 template<
typename T>
+ 4892 static T* VmaAllocate(
const VkAllocationCallbacks* pAllocationCallbacks)
+
+ 4894 return (T*)VmaMalloc(pAllocationCallbacks,
sizeof(T), VMA_ALIGN_OF(T));
+
+
+ 4897 template<
typename T>
+ 4898 static T* VmaAllocateArray(
const VkAllocationCallbacks* pAllocationCallbacks,
size_t count)
+
+ 4900 return (T*)VmaMalloc(pAllocationCallbacks,
sizeof(T) * count, VMA_ALIGN_OF(T));
- 4903 template<
typename T>
- 4904 static void vma_delete_array(
const VkAllocationCallbacks* pAllocationCallbacks, T* ptr,
size_t count)
-
-
-
- 4908 for(
size_t i = count; i--; )
-
-
-
- 4912 VmaFree(pAllocationCallbacks, ptr);
-
-
-
- 4916 static char* VmaCreateStringCopy(
const VkAllocationCallbacks* allocs,
const char* srcStr)
-
- 4918 if(srcStr != VMA_NULL)
-
- 4920 const size_t len = strlen(srcStr);
- 4921 char*
const result = vma_new_array(allocs,
char, len + 1);
- 4922 memcpy(result, srcStr, len + 1);
-
+ 4903 #define vma_new(allocator, type) new(VmaAllocate<type>(allocator))(type)
+
+ 4905 #define vma_new_array(allocator, type, count) new(VmaAllocateArray<type>((allocator), (count)))(type)
+
+ 4907 template<
typename T>
+ 4908 static void vma_delete(
const VkAllocationCallbacks* pAllocationCallbacks, T* ptr)
+
+
+ 4911 VmaFree(pAllocationCallbacks, ptr);
+
+
+ 4914 template<
typename T>
+ 4915 static void vma_delete_array(
const VkAllocationCallbacks* pAllocationCallbacks, T* ptr,
size_t count)
+
+
+
+ 4919 for(
size_t i = count; i--; )
+
+
+
+ 4923 VmaFree(pAllocationCallbacks, ptr);
-
-
-
-
-
-
- 4931 static void VmaFreeString(
const VkAllocationCallbacks* allocs,
char* str)
-
-
-
- 4935 const size_t len = strlen(str);
- 4936 vma_delete_array(allocs, str, len + 1);
-
-
-
-
- 4941 template<
typename T>
- 4942 class VmaStlAllocator
+
+
+ 4927 static char* VmaCreateStringCopy(
const VkAllocationCallbacks* allocs,
const char* srcStr)
+
+ 4929 if(srcStr != VMA_NULL)
+
+ 4931 const size_t len = strlen(srcStr);
+ 4932 char*
const result = vma_new_array(allocs,
char, len + 1);
+ 4933 memcpy(result, srcStr, len + 1);
+
+
+
+
+
+
+
+
+ 4942 static void VmaFreeString(
const VkAllocationCallbacks* allocs,
char* str)
-
- 4945 const VkAllocationCallbacks*
const m_pCallbacks;
- 4946 typedef T value_type;
-
- 4948 VmaStlAllocator(
const VkAllocationCallbacks* pCallbacks) : m_pCallbacks(pCallbacks) { }
- 4949 template<
typename U> VmaStlAllocator(
const VmaStlAllocator<U>& src) : m_pCallbacks(src.m_pCallbacks) { }
+
+
+ 4946 const size_t len = strlen(str);
+ 4947 vma_delete_array(allocs, str, len + 1);
+
+
- 4951 T* allocate(
size_t n) {
return VmaAllocateArray<T>(m_pCallbacks, n); }
- 4952 void deallocate(T* p,
size_t n) { VmaFree(m_pCallbacks, p); }
-
- 4954 template<
typename U>
- 4955 bool operator==(
const VmaStlAllocator<U>& rhs)
const
-
- 4957 return m_pCallbacks == rhs.m_pCallbacks;
-
- 4959 template<
typename U>
- 4960 bool operator!=(
const VmaStlAllocator<U>& rhs)
const
-
- 4962 return m_pCallbacks != rhs.m_pCallbacks;
-
+
+ 4952 template<
typename T>
+ 4953 class VmaStlAllocator
+
+
+ 4956 const VkAllocationCallbacks*
const m_pCallbacks;
+ 4957 typedef T value_type;
+
+ 4959 VmaStlAllocator(
const VkAllocationCallbacks* pCallbacks) : m_pCallbacks(pCallbacks) { }
+ 4960 template<
typename U> VmaStlAllocator(
const VmaStlAllocator<U>& src) : m_pCallbacks(src.m_pCallbacks) { }
+
+ 4962 T* allocate(
size_t n) {
return VmaAllocateArray<T>(m_pCallbacks, n); }
+ 4963 void deallocate(T* p,
size_t n) { VmaFree(m_pCallbacks, p); }
- 4965 VmaStlAllocator& operator=(
const VmaStlAllocator& x) =
delete;
- 4966 VmaStlAllocator(
const VmaStlAllocator&) =
default;
-
-
- 4969 #if VMA_USE_STL_VECTOR
-
- 4971 #define VmaVector std::vector
-
- 4973 template<
typename T,
typename allocatorT>
- 4974 static void VmaVectorInsert(std::vector<T, allocatorT>& vec,
size_t index,
const T& item)
-
- 4976 vec.insert(vec.begin() + index, item);
-
-
- 4979 template<
typename T,
typename allocatorT>
- 4980 static void VmaVectorRemove(std::vector<T, allocatorT>& vec,
size_t index)
-
- 4982 vec.erase(vec.begin() + index);
-
-
-
-
-
-
-
- 4990 template<
typename T,
typename AllocatorT>
-
+ 4965 template<
typename U>
+ 4966 bool operator==(
const VmaStlAllocator<U>& rhs)
const
+
+ 4968 return m_pCallbacks == rhs.m_pCallbacks;
+
+ 4970 template<
typename U>
+ 4971 bool operator!=(
const VmaStlAllocator<U>& rhs)
const
+
+ 4973 return m_pCallbacks != rhs.m_pCallbacks;
+
+
+ 4976 VmaStlAllocator& operator=(
const VmaStlAllocator& x) =
delete;
+ 4977 VmaStlAllocator(
const VmaStlAllocator&) =
default;
+
+
+ 4980 #if VMA_USE_STL_VECTOR
+
+ 4982 #define VmaVector std::vector
+
+ 4984 template<
typename T,
typename allocatorT>
+ 4985 static void VmaVectorInsert(std::vector<T, allocatorT>& vec,
size_t index,
const T& item)
+
+ 4987 vec.insert(vec.begin() + index, item);
+
+
+ 4990 template<
typename T,
typename allocatorT>
+ 4991 static void VmaVectorRemove(std::vector<T, allocatorT>& vec,
size_t index)
-
- 4994 typedef T value_type;
+ 4993 vec.erase(vec.begin() + index);
+
- 4996 VmaVector(
const AllocatorT& allocator) :
- 4997 m_Allocator(allocator),
-
-
-
-
-
-
- 5004 VmaVector(
size_t count,
const AllocatorT& allocator) :
- 5005 m_Allocator(allocator),
- 5006 m_pArray(count ? (T*)VmaAllocateArray<T>(allocator.m_pCallbacks, count) : VMA_NULL),
-
-
-
-
-
-
-
- 5014 VmaVector(
size_t count,
const T& value,
const AllocatorT& allocator)
- 5015 : VmaVector(count, allocator) {}
-
- 5017 VmaVector(
const VmaVector<T, AllocatorT>& src) :
- 5018 m_Allocator(src.m_Allocator),
- 5019 m_pArray(src.m_Count ? (T*)VmaAllocateArray<T>(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),
- 5020 m_Count(src.m_Count),
- 5021 m_Capacity(src.m_Count)
-
-
-
- 5025 memcpy(m_pArray, src.m_pArray, m_Count *
sizeof(T));
-
-
-
-
-
- 5031 VmaFree(m_Allocator.m_pCallbacks, m_pArray);
-
-
- 5034 VmaVector& operator=(
const VmaVector<T, AllocatorT>& rhs)
-
-
-
- 5038 resize(rhs.m_Count);
-
-
- 5041 memcpy(m_pArray, rhs.m_pArray, m_Count *
sizeof(T));
-
-
-
-
-
- 5047 bool empty()
const {
return m_Count == 0; }
- 5048 size_t size()
const {
return m_Count; }
- 5049 T* data() {
return m_pArray; }
- 5050 const T* data()
const {
return m_pArray; }
-
- 5052 T& operator[](
size_t index)
-
- 5054 VMA_HEAVY_ASSERT(index < m_Count);
- 5055 return m_pArray[index];
+
+
+
+
+
+ 5001 template<
typename T,
typename AllocatorT>
+
+
+
+ 5005 typedef T value_type;
+
+ 5007 VmaVector(
const AllocatorT& allocator) :
+ 5008 m_Allocator(allocator),
+
+
+
+
+
+
+ 5015 VmaVector(
size_t count,
const AllocatorT& allocator) :
+ 5016 m_Allocator(allocator),
+ 5017 m_pArray(count ? (T*)VmaAllocateArray<T>(allocator.m_pCallbacks, count) : VMA_NULL),
+
+
+
+
+
+
+
+ 5025 VmaVector(
size_t count,
const T& value,
const AllocatorT& allocator)
+ 5026 : VmaVector(count, allocator) {}
+
+ 5028 VmaVector(
const VmaVector<T, AllocatorT>& src) :
+ 5029 m_Allocator(src.m_Allocator),
+ 5030 m_pArray(src.m_Count ? (T*)VmaAllocateArray<T>(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),
+ 5031 m_Count(src.m_Count),
+ 5032 m_Capacity(src.m_Count)
+
+
+
+ 5036 memcpy(m_pArray, src.m_pArray, m_Count *
sizeof(T));
+
+
+
+
+
+ 5042 VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+
+
+ 5045 VmaVector& operator=(
const VmaVector<T, AllocatorT>& rhs)
+
+
+
+ 5049 resize(rhs.m_Count);
+
+
+ 5052 memcpy(m_pArray, rhs.m_pArray, m_Count *
sizeof(T));
+
+
+
- 5057 const T& operator[](
size_t index)
const
-
- 5059 VMA_HEAVY_ASSERT(index < m_Count);
- 5060 return m_pArray[index];
-
+
+ 5058 bool empty()
const {
return m_Count == 0; }
+ 5059 size_t size()
const {
return m_Count; }
+ 5060 T* data() {
return m_pArray; }
+ 5061 const T* data()
const {
return m_pArray; }
-
+ 5063 T& operator[](
size_t index)
- 5065 VMA_HEAVY_ASSERT(m_Count > 0);
-
+ 5065 VMA_HEAVY_ASSERT(index < m_Count);
+ 5066 return m_pArray[index];
- 5068 const T& front()
const
+ 5068 const T& operator[](
size_t index)
const
- 5070 VMA_HEAVY_ASSERT(m_Count > 0);
-
+ 5070 VMA_HEAVY_ASSERT(index < m_Count);
+ 5071 return m_pArray[index];
-
-
- 5075 VMA_HEAVY_ASSERT(m_Count > 0);
- 5076 return m_pArray[m_Count - 1];
-
- 5078 const T& back()
const
-
- 5080 VMA_HEAVY_ASSERT(m_Count > 0);
- 5081 return m_pArray[m_Count - 1];
-
-
- 5084 void reserve(
size_t newCapacity,
bool freeMemory =
false)
+
+
+
+ 5076 VMA_HEAVY_ASSERT(m_Count > 0);
+
+
+ 5079 const T& front()
const
+
+ 5081 VMA_HEAVY_ASSERT(m_Count > 0);
+
+
+
- 5086 newCapacity = VMA_MAX(newCapacity, m_Count);
-
- 5088 if((newCapacity < m_Capacity) && !freeMemory)
-
- 5090 newCapacity = m_Capacity;
-
-
- 5093 if(newCapacity != m_Capacity)
-
- 5095 T*
const newArray = newCapacity ? VmaAllocateArray<T>(m_Allocator, newCapacity) : VMA_NULL;
-
-
- 5098 memcpy(newArray, m_pArray, m_Count *
sizeof(T));
-
- 5100 VmaFree(m_Allocator.m_pCallbacks, m_pArray);
- 5101 m_Capacity = newCapacity;
- 5102 m_pArray = newArray;
-
-
-
- 5106 void resize(
size_t newCount)
-
- 5108 size_t newCapacity = m_Capacity;
- 5109 if(newCount > m_Capacity)
-
- 5111 newCapacity = VMA_MAX(newCount, VMA_MAX(m_Capacity * 3 / 2, (
size_t)8));
-
-
- 5114 if(newCapacity != m_Capacity)
-
- 5116 T*
const newArray = newCapacity ? VmaAllocateArray<T>(m_Allocator.m_pCallbacks, newCapacity) : VMA_NULL;
- 5117 const size_t elementsToCopy = VMA_MIN(m_Count, newCount);
- 5118 if(elementsToCopy != 0)
-
- 5120 memcpy(newArray, m_pArray, elementsToCopy *
sizeof(T));
-
- 5122 VmaFree(m_Allocator.m_pCallbacks, m_pArray);
- 5123 m_Capacity = newCapacity;
- 5124 m_pArray = newArray;
-
-
-
-
-
-
-
-
-
-
- 5135 void shrink_to_fit()
-
- 5137 if(m_Capacity > m_Count)
-
- 5139 T* newArray = VMA_NULL;
-
-
- 5142 newArray = VmaAllocateArray<T>(m_Allocator.m_pCallbacks, m_Count);
- 5143 memcpy(newArray, m_pArray, m_Count *
sizeof(T));
-
- 5145 VmaFree(m_Allocator.m_pCallbacks, m_pArray);
- 5146 m_Capacity = m_Count;
- 5147 m_pArray = newArray;
-
-
-
- 5151 void insert(
size_t index,
const T& src)
-
- 5153 VMA_HEAVY_ASSERT(index <= m_Count);
- 5154 const size_t oldCount = size();
- 5155 resize(oldCount + 1);
- 5156 if(index < oldCount)
-
- 5158 memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) *
sizeof(T));
+ 5086 VMA_HEAVY_ASSERT(m_Count > 0);
+ 5087 return m_pArray[m_Count - 1];
+
+ 5089 const T& back()
const
+
+ 5091 VMA_HEAVY_ASSERT(m_Count > 0);
+ 5092 return m_pArray[m_Count - 1];
+
+
+ 5095 void reserve(
size_t newCapacity,
bool freeMemory =
false)
+
+ 5097 newCapacity = VMA_MAX(newCapacity, m_Count);
+
+ 5099 if((newCapacity < m_Capacity) && !freeMemory)
+
+ 5101 newCapacity = m_Capacity;
+
+
+ 5104 if(newCapacity != m_Capacity)
+
+ 5106 T*
const newArray = newCapacity ? VmaAllocateArray<T>(m_Allocator, newCapacity) : VMA_NULL;
+
+
+ 5109 memcpy(newArray, m_pArray, m_Count *
sizeof(T));
+
+ 5111 VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+ 5112 m_Capacity = newCapacity;
+ 5113 m_pArray = newArray;
+
+
+
+ 5117 void resize(
size_t newCount)
+
+ 5119 size_t newCapacity = m_Capacity;
+ 5120 if(newCount > m_Capacity)
+
+ 5122 newCapacity = VMA_MAX(newCount, VMA_MAX(m_Capacity * 3 / 2, (
size_t)8));
+
+
+ 5125 if(newCapacity != m_Capacity)
+
+ 5127 T*
const newArray = newCapacity ? VmaAllocateArray<T>(m_Allocator.m_pCallbacks, newCapacity) : VMA_NULL;
+ 5128 const size_t elementsToCopy = VMA_MIN(m_Count, newCount);
+ 5129 if(elementsToCopy != 0)
+
+ 5131 memcpy(newArray, m_pArray, elementsToCopy *
sizeof(T));
+
+ 5133 VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+ 5134 m_Capacity = newCapacity;
+ 5135 m_pArray = newArray;
+
+
+
+
+
+
+
+
+
+
+ 5146 void shrink_to_fit()
+
+ 5148 if(m_Capacity > m_Count)
+
+ 5150 T* newArray = VMA_NULL;
+
+
+ 5153 newArray = VmaAllocateArray<T>(m_Allocator.m_pCallbacks, m_Count);
+ 5154 memcpy(newArray, m_pArray, m_Count *
sizeof(T));
+
+ 5156 VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+ 5157 m_Capacity = m_Count;
+ 5158 m_pArray = newArray;
- 5160 m_pArray[index] = src;
-
-
- 5163 void remove(
size_t index)
-
- 5165 VMA_HEAVY_ASSERT(index < m_Count);
- 5166 const size_t oldCount = size();
- 5167 if(index < oldCount - 1)
+
+
+ 5162 void insert(
size_t index,
const T& src)
+
+ 5164 VMA_HEAVY_ASSERT(index <= m_Count);
+ 5165 const size_t oldCount = size();
+ 5166 resize(oldCount + 1);
+ 5167 if(index < oldCount)
- 5169 memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) *
sizeof(T));
+ 5169 memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) *
sizeof(T));
- 5171 resize(oldCount - 1);
+ 5171 m_pArray[index] = src;
- 5174 void push_back(
const T& src)
+ 5174 void remove(
size_t index)
- 5176 const size_t newIndex = size();
- 5177 resize(newIndex + 1);
- 5178 m_pArray[newIndex] = src;
-
-
-
-
- 5183 VMA_HEAVY_ASSERT(m_Count > 0);
-
-
-
- 5187 void push_front(
const T& src)
-
-
+ 5176 VMA_HEAVY_ASSERT(index < m_Count);
+ 5177 const size_t oldCount = size();
+ 5178 if(index < oldCount - 1)
+
+ 5180 memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) *
sizeof(T));
+
+ 5182 resize(oldCount - 1);
+
+
+ 5185 void push_back(
const T& src)
+
+ 5187 const size_t newIndex = size();
+ 5188 resize(newIndex + 1);
+ 5189 m_pArray[newIndex] = src;
-
+
5194 VMA_HEAVY_ASSERT(m_Count > 0);
-
+
- 5198 typedef T* iterator;
-
- 5200 iterator begin() {
return m_pArray; }
- 5201 iterator end() {
return m_pArray + m_Count; }
+ 5198 void push_front(
const T& src)
+
+
+
-
- 5204 AllocatorT m_Allocator;
-
-
-
-
-
- 5210 template<
typename T,
typename allocatorT>
- 5211 static void VmaVectorInsert(VmaVector<T, allocatorT>& vec,
size_t index,
const T& item)
-
- 5213 vec.insert(index, item);
-
-
- 5216 template<
typename T,
typename allocatorT>
- 5217 static void VmaVectorRemove(VmaVector<T, allocatorT>& vec,
size_t index)
-
-
-
-
-
-
- 5224 template<
typename CmpLess,
typename VectorT>
- 5225 size_t VmaVectorInsertSorted(VectorT& vector,
const typename VectorT::value_type& value)
-
- 5227 const size_t indexToInsert = VmaBinaryFindFirstNotLess(
-
- 5229 vector.data() + vector.size(),
-
- 5231 CmpLess()) - vector.data();
- 5232 VmaVectorInsert(vector, indexToInsert, value);
- 5233 return indexToInsert;
-
-
- 5236 template<
typename CmpLess,
typename VectorT>
- 5237 bool VmaVectorRemoveSorted(VectorT& vector,
const typename VectorT::value_type& value)
-
-
- 5240 typename VectorT::iterator it = VmaBinaryFindFirstNotLess(
-
-
-
-
- 5245 if((it != vector.end()) && !comparator(*it, value) && !comparator(value, *it))
-
- 5247 size_t indexToRemove = it - vector.begin();
- 5248 VmaVectorRemove(vector, indexToRemove);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ 5205 VMA_HEAVY_ASSERT(m_Count > 0);
+
+
+
+ 5209 typedef T* iterator;
+
+ 5211 iterator begin() {
return m_pArray; }
+ 5212 iterator end() {
return m_pArray + m_Count; }
+
+
+ 5215 AllocatorT m_Allocator;
+
+
+
+
+
+ 5221 template<
typename T,
typename allocatorT>
+ 5222 static void VmaVectorInsert(VmaVector<T, allocatorT>& vec,
size_t index,
const T& item)
+
+ 5224 vec.insert(index, item);
+
+
+ 5227 template<
typename T,
typename allocatorT>
+ 5228 static void VmaVectorRemove(VmaVector<T, allocatorT>& vec,
size_t index)
+
+
+
+
+
+
+ 5235 template<
typename CmpLess,
typename VectorT>
+ 5236 size_t VmaVectorInsertSorted(VectorT& vector,
const typename VectorT::value_type& value)
+
+ 5238 const size_t indexToInsert = VmaBinaryFindFirstNotLess(
+
+ 5240 vector.data() + vector.size(),
+
+ 5242 CmpLess()) - vector.data();
+ 5243 VmaVectorInsert(vector, indexToInsert, value);
+ 5244 return indexToInsert;
+
+
+ 5247 template<
typename CmpLess,
typename VectorT>
+ 5248 bool VmaVectorRemoveSorted(VectorT& vector,
const typename VectorT::value_type& value)
+
+
+ 5251 typename VectorT::iterator it = VmaBinaryFindFirstNotLess(
+
+
+
+
+ 5256 if((it != vector.end()) && !comparator(*it, value) && !comparator(value, *it))
+
+ 5258 size_t indexToRemove = it - vector.begin();
+ 5259 VmaVectorRemove(vector, indexToRemove);
+
+
+
+
- 5265 template<
typename T,
typename AllocatorT,
size_t N>
- 5266 class VmaSmallVector
-
-
- 5269 typedef T value_type;
-
- 5271 VmaSmallVector(
const AllocatorT& allocator) :
-
- 5273 m_DynamicArray(allocator)
-
-
- 5276 VmaSmallVector(
size_t count,
const AllocatorT& allocator) :
-
- 5278 m_DynamicArray(count > N ? count : 0, allocator)
-
-
- 5281 template<
typename SrcT,
typename SrcAllocatorT,
size_t SrcN>
- 5282 VmaSmallVector(
const VmaSmallVector<SrcT, SrcAllocatorT, SrcN>& src) =
delete;
- 5283 template<
typename SrcT,
typename SrcAllocatorT,
size_t SrcN>
- 5284 VmaSmallVector<T, AllocatorT, N>& operator=(
const VmaSmallVector<SrcT, SrcAllocatorT, SrcN>& rhs) =
delete;
-
- 5286 bool empty()
const {
return m_Count == 0; }
- 5287 size_t size()
const {
return m_Count; }
- 5288 T* data() {
return m_Count > N ? m_DynamicArray.data() : m_StaticArray; }
- 5289 const T* data()
const {
return m_Count > N ? m_DynamicArray.data() : m_StaticArray; }
-
- 5291 T& operator[](
size_t index)
-
- 5293 VMA_HEAVY_ASSERT(index < m_Count);
- 5294 return data()[index];
-
- 5296 const T& operator[](
size_t index)
const
-
- 5298 VMA_HEAVY_ASSERT(index < m_Count);
- 5299 return data()[index];
-
+
+
+
+
+
+
+
+
+
+
+ 5276 template<
typename T,
typename AllocatorT,
size_t N>
+ 5277 class VmaSmallVector
+
+
+ 5280 typedef T value_type;
+
+ 5282 VmaSmallVector(
const AllocatorT& allocator) :
+
+ 5284 m_DynamicArray(allocator)
+
+
+ 5287 VmaSmallVector(
size_t count,
const AllocatorT& allocator) :
+
+ 5289 m_DynamicArray(count > N ? count : 0, allocator)
+
+
+ 5292 template<
typename SrcT,
typename SrcAllocatorT,
size_t SrcN>
+ 5293 VmaSmallVector(
const VmaSmallVector<SrcT, SrcAllocatorT, SrcN>& src) =
delete;
+ 5294 template<
typename SrcT,
typename SrcAllocatorT,
size_t SrcN>
+ 5295 VmaSmallVector<T, AllocatorT, N>& operator=(
const VmaSmallVector<SrcT, SrcAllocatorT, SrcN>& rhs) =
delete;
+
+ 5297 bool empty()
const {
return m_Count == 0; }
+ 5298 size_t size()
const {
return m_Count; }
+ 5299 T* data() {
return m_Count > N ? m_DynamicArray.data() : m_StaticArray; }
+ 5300 const T* data()
const {
return m_Count > N ? m_DynamicArray.data() : m_StaticArray; }
-
+ 5302 T& operator[](
size_t index)
- 5304 VMA_HEAVY_ASSERT(m_Count > 0);
-
+ 5304 VMA_HEAVY_ASSERT(index < m_Count);
+ 5305 return data()[index];
- 5307 const T& front()
const
+ 5307 const T& operator[](
size_t index)
const
- 5309 VMA_HEAVY_ASSERT(m_Count > 0);
-
+ 5309 VMA_HEAVY_ASSERT(index < m_Count);
+ 5310 return data()[index];
-
-
- 5314 VMA_HEAVY_ASSERT(m_Count > 0);
- 5315 return data()[m_Count - 1];
-
- 5317 const T& back()
const
-
- 5319 VMA_HEAVY_ASSERT(m_Count > 0);
- 5320 return data()[m_Count - 1];
-
-
- 5323 void resize(
size_t newCount,
bool freeMemory =
false)
+
+
+
+ 5315 VMA_HEAVY_ASSERT(m_Count > 0);
+
+
+ 5318 const T& front()
const
+
+ 5320 VMA_HEAVY_ASSERT(m_Count > 0);
+
+
+
- 5325 if(newCount > N && m_Count > N)
-
-
- 5328 m_DynamicArray.resize(newCount);
-
-
- 5331 m_DynamicArray.shrink_to_fit();
-
-
- 5334 else if(newCount > N && m_Count <= N)
-
-
- 5337 m_DynamicArray.resize(newCount);
-
-
- 5340 memcpy(m_DynamicArray.data(), m_StaticArray, m_Count *
sizeof(T));
-
-
- 5343 else if(newCount <= N && m_Count > N)
-
-
-
-
- 5348 memcpy(m_StaticArray, m_DynamicArray.data(), newCount *
sizeof(T));
-
- 5350 m_DynamicArray.resize(0);
-
-
- 5353 m_DynamicArray.shrink_to_fit();
-
-
-
-
-
-
-
-
-
- 5363 void clear(
bool freeMemory =
false)
-
- 5365 m_DynamicArray.clear();
-
-
- 5368 m_DynamicArray.shrink_to_fit();
-
-
-
-
- 5373 void insert(
size_t index,
const T& src)
-
- 5375 VMA_HEAVY_ASSERT(index <= m_Count);
- 5376 const size_t oldCount = size();
- 5377 resize(oldCount + 1);
- 5378 T*
const dataPtr = data();
- 5379 if(index < oldCount)
-
-
- 5382 memmove(dataPtr + (index + 1), dataPtr + index, (oldCount - index) *
sizeof(T));
-
- 5384 dataPtr[index] = src;
-
-
- 5387 void remove(
size_t index)
-
- 5389 VMA_HEAVY_ASSERT(index < m_Count);
- 5390 const size_t oldCount = size();
- 5391 if(index < oldCount - 1)
-
-
- 5394 T*
const dataPtr = data();
- 5395 memmove(dataPtr + index, dataPtr + (index + 1), (oldCount - index - 1) *
sizeof(T));
-
- 5397 resize(oldCount - 1);
-
-
- 5400 void push_back(
const T& src)
-
- 5402 const size_t newIndex = size();
- 5403 resize(newIndex + 1);
- 5404 data()[newIndex] = src;
-
-
-
-
- 5409 VMA_HEAVY_ASSERT(m_Count > 0);
-
-
-
- 5413 void push_front(
const T& src)
-
-
+ 5325 VMA_HEAVY_ASSERT(m_Count > 0);
+ 5326 return data()[m_Count - 1];
+
+ 5328 const T& back()
const
+
+ 5330 VMA_HEAVY_ASSERT(m_Count > 0);
+ 5331 return data()[m_Count - 1];
+
+
+ 5334 void resize(
size_t newCount,
bool freeMemory =
false)
+
+ 5336 if(newCount > N && m_Count > N)
+
+
+ 5339 m_DynamicArray.resize(newCount);
+
+
+ 5342 m_DynamicArray.shrink_to_fit();
+
+
+ 5345 else if(newCount > N && m_Count <= N)
+
+
+ 5348 m_DynamicArray.resize(newCount);
+
+
+ 5351 memcpy(m_DynamicArray.data(), m_StaticArray, m_Count *
sizeof(T));
+
+
+ 5354 else if(newCount <= N && m_Count > N)
+
+
+
+
+ 5359 memcpy(m_StaticArray, m_DynamicArray.data(), newCount *
sizeof(T));
+
+ 5361 m_DynamicArray.resize(0);
+
+
+ 5364 m_DynamicArray.shrink_to_fit();
+
+
+
+
+
+
+
+
+
+ 5374 void clear(
bool freeMemory =
false)
+
+ 5376 m_DynamicArray.clear();
+
+
+ 5379 m_DynamicArray.shrink_to_fit();
+
+
+
+
+ 5384 void insert(
size_t index,
const T& src)
+
+ 5386 VMA_HEAVY_ASSERT(index <= m_Count);
+ 5387 const size_t oldCount = size();
+ 5388 resize(oldCount + 1);
+ 5389 T*
const dataPtr = data();
+ 5390 if(index < oldCount)
+
+
+ 5393 memmove(dataPtr + (index + 1), dataPtr + index, (oldCount - index) *
sizeof(T));
+
+ 5395 dataPtr[index] = src;
+
+
+ 5398 void remove(
size_t index)
+
+ 5400 VMA_HEAVY_ASSERT(index < m_Count);
+ 5401 const size_t oldCount = size();
+ 5402 if(index < oldCount - 1)
+
+
+ 5405 T*
const dataPtr = data();
+ 5406 memmove(dataPtr + index, dataPtr + (index + 1), (oldCount - index - 1) *
sizeof(T));
+
+ 5408 resize(oldCount - 1);
+
+
+ 5411 void push_back(
const T& src)
+
+ 5413 const size_t newIndex = size();
+ 5414 resize(newIndex + 1);
+ 5415 data()[newIndex] = src;
-
+
5420 VMA_HEAVY_ASSERT(m_Count > 0);
-
+
- 5424 typedef T* iterator;
-
- 5426 iterator begin() {
return data(); }
- 5427 iterator end() {
return data() + m_Count; }
+ 5424 void push_front(
const T& src)
+
+
+
-
-
-
- 5432 VmaVector<T, AllocatorT> m_DynamicArray;
-
+
+
+ 5431 VMA_HEAVY_ASSERT(m_Count > 0);
+
+
-
-
-
-
-
-
-
- 5443 template<
typename T>
- 5444 class VmaPoolAllocator
-
- 5446 VMA_CLASS_NO_COPY(VmaPoolAllocator)
-
- 5448 VmaPoolAllocator(
const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity);
- 5449 ~VmaPoolAllocator();
- 5450 template<
typename... Types> T* Alloc(Types... args);
-
-
-
-
-
- 5456 uint32_t NextFreeIndex;
- 5457 alignas(T)
char Value[
sizeof(T)];
-
-
-
-
-
-
- 5464 uint32_t FirstFreeIndex;
-
-
- 5467 const VkAllocationCallbacks* m_pAllocationCallbacks;
- 5468 const uint32_t m_FirstBlockCapacity;
- 5469 VmaVector< ItemBlock, VmaStlAllocator<ItemBlock> > m_ItemBlocks;
+ 5435 typedef T* iterator;
+
+ 5437 iterator begin() {
return data(); }
+ 5438 iterator end() {
return data() + m_Count; }
+
+
+
+
+ 5443 VmaVector<T, AllocatorT> m_DynamicArray;
+
+
+
+
+
+
+
+
+
+ 5454 template<
typename T>
+ 5455 class VmaPoolAllocator
+
+ 5457 VMA_CLASS_NO_COPY(VmaPoolAllocator)
+
+ 5459 VmaPoolAllocator(
const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity);
+ 5460 ~VmaPoolAllocator();
+ 5461 template<
typename... Types> T* Alloc(Types... args);
+
+
+
+
+
+ 5467 uint32_t NextFreeIndex;
+ 5468 alignas(T)
char Value[
sizeof(T)];
+
- 5471 ItemBlock& CreateNewBlock();
-
-
- 5474 template<
typename T>
- 5475 VmaPoolAllocator<T>::VmaPoolAllocator(
const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity) :
- 5476 m_pAllocationCallbacks(pAllocationCallbacks),
- 5477 m_FirstBlockCapacity(firstBlockCapacity),
- 5478 m_ItemBlocks(VmaStlAllocator<ItemBlock>(pAllocationCallbacks))
-
- 5480 VMA_ASSERT(m_FirstBlockCapacity > 1);
-
-
- 5483 template<
typename T>
- 5484 VmaPoolAllocator<T>::~VmaPoolAllocator()
-
- 5486 for(
size_t i = m_ItemBlocks.size(); i--; )
- 5487 vma_delete_array(m_pAllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemBlocks[i].Capacity);
- 5488 m_ItemBlocks.clear();
-
-
- 5491 template<
typename T>
- 5492 template<
typename... Types> T* VmaPoolAllocator<T>::Alloc(Types... args)
-
- 5494 for(
size_t i = m_ItemBlocks.size(); i--; )
-
- 5496 ItemBlock& block = m_ItemBlocks[i];
-
- 5498 if(block.FirstFreeIndex != UINT32_MAX)
-
- 5500 Item*
const pItem = &block.pItems[block.FirstFreeIndex];
- 5501 block.FirstFreeIndex = pItem->NextFreeIndex;
- 5502 T* result = (T*)&pItem->Value;
- 5503 new(result)T(std::forward<Types>(args)...);
-
-
-
-
-
- 5509 ItemBlock& newBlock = CreateNewBlock();
- 5510 Item*
const pItem = &newBlock.pItems[0];
- 5511 newBlock.FirstFreeIndex = pItem->NextFreeIndex;
- 5512 T* result = (T*)&pItem->Value;
- 5513 new(result)T(std::forward<Types>(args)...);
-
-
-
- 5517 template<
typename T>
- 5518 void VmaPoolAllocator<T>::Free(T* ptr)
-
-
- 5521 for(
size_t i = m_ItemBlocks.size(); i--; )
-
- 5523 ItemBlock& block = m_ItemBlocks[i];
-
-
-
- 5527 memcpy(&pItemPtr, &ptr,
sizeof(pItemPtr));
-
-
- 5530 if((pItemPtr >= block.pItems) && (pItemPtr < block.pItems + block.Capacity))
-
-
- 5533 const uint32_t index =
static_cast<uint32_t
>(pItemPtr - block.pItems);
- 5534 pItemPtr->NextFreeIndex = block.FirstFreeIndex;
- 5535 block.FirstFreeIndex = index;
-
-
-
- 5539 VMA_ASSERT(0 &&
"Pointer doesn't belong to this memory pool.");
-
-
- 5542 template<
typename T>
- 5543 typename VmaPoolAllocator<T>::ItemBlock& VmaPoolAllocator<T>::CreateNewBlock()
-
- 5545 const uint32_t newBlockCapacity = m_ItemBlocks.empty() ?
- 5546 m_FirstBlockCapacity : m_ItemBlocks.back().Capacity * 3 / 2;
-
- 5548 const ItemBlock newBlock = {
- 5549 vma_new_array(m_pAllocationCallbacks, Item, newBlockCapacity),
-
-
+
+
+
+
+ 5475 uint32_t FirstFreeIndex;
+
+
+ 5478 const VkAllocationCallbacks* m_pAllocationCallbacks;
+ 5479 const uint32_t m_FirstBlockCapacity;
+ 5480 VmaVector< ItemBlock, VmaStlAllocator<ItemBlock> > m_ItemBlocks;
+
+ 5482 ItemBlock& CreateNewBlock();
+
+
+ 5485 template<
typename T>
+ 5486 VmaPoolAllocator<T>::VmaPoolAllocator(
const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity) :
+ 5487 m_pAllocationCallbacks(pAllocationCallbacks),
+ 5488 m_FirstBlockCapacity(firstBlockCapacity),
+ 5489 m_ItemBlocks(VmaStlAllocator<ItemBlock>(pAllocationCallbacks))
+
+ 5491 VMA_ASSERT(m_FirstBlockCapacity > 1);
+
+
+ 5494 template<
typename T>
+ 5495 VmaPoolAllocator<T>::~VmaPoolAllocator()
+
+ 5497 for(
size_t i = m_ItemBlocks.size(); i--; )
+ 5498 vma_delete_array(m_pAllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemBlocks[i].Capacity);
+ 5499 m_ItemBlocks.clear();
+
+
+ 5502 template<
typename T>
+ 5503 template<
typename... Types> T* VmaPoolAllocator<T>::Alloc(Types... args)
+
+ 5505 for(
size_t i = m_ItemBlocks.size(); i--; )
+
+ 5507 ItemBlock& block = m_ItemBlocks[i];
+
+ 5509 if(block.FirstFreeIndex != UINT32_MAX)
+
+ 5511 Item*
const pItem = &block.pItems[block.FirstFreeIndex];
+ 5512 block.FirstFreeIndex = pItem->NextFreeIndex;
+ 5513 T* result = (T*)&pItem->Value;
+ 5514 new(result)T(std::forward<Types>(args)...);
+
+
+
+
+
+ 5520 ItemBlock& newBlock = CreateNewBlock();
+ 5521 Item*
const pItem = &newBlock.pItems[0];
+ 5522 newBlock.FirstFreeIndex = pItem->NextFreeIndex;
+ 5523 T* result = (T*)&pItem->Value;
+ 5524 new(result)T(std::forward<Types>(args)...);
+
+
+
+ 5528 template<
typename T>
+ 5529 void VmaPoolAllocator<T>::Free(T* ptr)
+
+
+ 5532 for(
size_t i = m_ItemBlocks.size(); i--; )
+
+ 5534 ItemBlock& block = m_ItemBlocks[i];
+
+
+
+ 5538 memcpy(&pItemPtr, &ptr,
sizeof(pItemPtr));
+
+
+ 5541 if((pItemPtr >= block.pItems) && (pItemPtr < block.pItems + block.Capacity))
+
+
+ 5544 const uint32_t index =
static_cast<uint32_t
>(pItemPtr - block.pItems);
+ 5545 pItemPtr->NextFreeIndex = block.FirstFreeIndex;
+ 5546 block.FirstFreeIndex = index;
+
+
+
+ 5550 VMA_ASSERT(0 &&
"Pointer doesn't belong to this memory pool.");
+
- 5553 m_ItemBlocks.push_back(newBlock);
-
-
- 5556 for(uint32_t i = 0; i < newBlockCapacity - 1; ++i)
- 5557 newBlock.pItems[i].NextFreeIndex = i + 1;
- 5558 newBlock.pItems[newBlockCapacity - 1].NextFreeIndex = UINT32_MAX;
- 5559 return m_ItemBlocks.back();
-
-
-
-
- 5565 #if VMA_USE_STL_LIST
-
- 5567 #define VmaList std::list
-
-
-
- 5571 template<
typename T>
-
-
-
-
-
-
-
-
- 5580 template<
typename T>
-
-
- 5583 VMA_CLASS_NO_COPY(VmaRawList)
-
- 5585 typedef VmaListItem<T> ItemType;
-
- 5587 VmaRawList(
const VkAllocationCallbacks* pAllocationCallbacks);
-
-
-
- 5591 size_t GetCount()
const {
return m_Count; }
- 5592 bool IsEmpty()
const {
return m_Count == 0; }
-
- 5594 ItemType* Front() {
return m_pFront; }
- 5595 const ItemType* Front()
const {
return m_pFront; }
- 5596 ItemType* Back() {
return m_pBack; }
- 5597 const ItemType* Back()
const {
return m_pBack; }
-
- 5599 ItemType* PushBack();
- 5600 ItemType* PushFront();
- 5601 ItemType* PushBack(
const T& value);
- 5602 ItemType* PushFront(
const T& value);
-
-
-
-
- 5607 ItemType* InsertBefore(ItemType* pItem);
-
- 5609 ItemType* InsertAfter(ItemType* pItem);
-
- 5611 ItemType* InsertBefore(ItemType* pItem,
const T& value);
- 5612 ItemType* InsertAfter(ItemType* pItem,
const T& value);
-
- 5614 void Remove(ItemType* pItem);
-
-
- 5617 const VkAllocationCallbacks*
const m_pAllocationCallbacks;
- 5618 VmaPoolAllocator<ItemType> m_ItemAllocator;
-
-
-
-
-
- 5624 template<
typename T>
- 5625 VmaRawList<T>::VmaRawList(
const VkAllocationCallbacks* pAllocationCallbacks) :
- 5626 m_pAllocationCallbacks(pAllocationCallbacks),
- 5627 m_ItemAllocator(pAllocationCallbacks, 128),
-
-
-
-
-
-
- 5634 template<
typename T>
- 5635 VmaRawList<T>::~VmaRawList()
-
-
-
-
-
- 5641 template<
typename T>
- 5642 void VmaRawList<T>::Clear()
-
- 5644 if(IsEmpty() ==
false)
-
- 5646 ItemType* pItem = m_pBack;
- 5647 while(pItem != VMA_NULL)
-
- 5649 ItemType*
const pPrevItem = pItem->pPrev;
- 5650 m_ItemAllocator.Free(pItem);
-
-
- 5653 m_pFront = VMA_NULL;
-
-
-
-
-
- 5659 template<
typename T>
- 5660 VmaListItem<T>* VmaRawList<T>::PushBack()
-
- 5662 ItemType*
const pNewItem = m_ItemAllocator.Alloc();
- 5663 pNewItem->pNext = VMA_NULL;
-
-
- 5666 pNewItem->pPrev = VMA_NULL;
- 5667 m_pFront = pNewItem;
-
-
-
-
-
- 5673 pNewItem->pPrev = m_pBack;
- 5674 m_pBack->pNext = pNewItem;
-
-
-
-
-
-
- 5681 template<
typename T>
- 5682 VmaListItem<T>* VmaRawList<T>::PushFront()
-
- 5684 ItemType*
const pNewItem = m_ItemAllocator.Alloc();
- 5685 pNewItem->pPrev = VMA_NULL;
-
-
- 5688 pNewItem->pNext = VMA_NULL;
- 5689 m_pFront = pNewItem;
-
-
-
-
-
- 5695 pNewItem->pNext = m_pFront;
- 5696 m_pFront->pPrev = pNewItem;
- 5697 m_pFront = pNewItem;
-
-
-
-
-
- 5703 template<
typename T>
- 5704 VmaListItem<T>* VmaRawList<T>::PushBack(
const T& value)
-
- 5706 ItemType*
const pNewItem = PushBack();
- 5707 pNewItem->Value = value;
-
-
-
- 5711 template<
typename T>
- 5712 VmaListItem<T>* VmaRawList<T>::PushFront(
const T& value)
-
- 5714 ItemType*
const pNewItem = PushFront();
- 5715 pNewItem->Value = value;
-
-
-
- 5719 template<
typename T>
- 5720 void VmaRawList<T>::PopBack()
-
- 5722 VMA_HEAVY_ASSERT(m_Count > 0);
- 5723 ItemType*
const pBackItem = m_pBack;
- 5724 ItemType*
const pPrevItem = pBackItem->pPrev;
- 5725 if(pPrevItem != VMA_NULL)
-
- 5727 pPrevItem->pNext = VMA_NULL;
-
- 5729 m_pBack = pPrevItem;
- 5730 m_ItemAllocator.Free(pBackItem);
-
-
-
- 5734 template<
typename T>
- 5735 void VmaRawList<T>::PopFront()
-
- 5737 VMA_HEAVY_ASSERT(m_Count > 0);
- 5738 ItemType*
const pFrontItem = m_pFront;
- 5739 ItemType*
const pNextItem = pFrontItem->pNext;
- 5740 if(pNextItem != VMA_NULL)
-
- 5742 pNextItem->pPrev = VMA_NULL;
-
- 5744 m_pFront = pNextItem;
- 5745 m_ItemAllocator.Free(pFrontItem);
-
-
-
- 5749 template<
typename T>
- 5750 void VmaRawList<T>::Remove(ItemType* pItem)
-
- 5752 VMA_HEAVY_ASSERT(pItem != VMA_NULL);
- 5753 VMA_HEAVY_ASSERT(m_Count > 0);
-
- 5755 if(pItem->pPrev != VMA_NULL)
-
- 5757 pItem->pPrev->pNext = pItem->pNext;
-
-
-
- 5761 VMA_HEAVY_ASSERT(m_pFront == pItem);
- 5762 m_pFront = pItem->pNext;
-
-
- 5765 if(pItem->pNext != VMA_NULL)
-
- 5767 pItem->pNext->pPrev = pItem->pPrev;
-
-
-
- 5771 VMA_HEAVY_ASSERT(m_pBack == pItem);
- 5772 m_pBack = pItem->pPrev;
-
-
- 5775 m_ItemAllocator.Free(pItem);
-
-
-
- 5779 template<
typename T>
- 5780 VmaListItem<T>* VmaRawList<T>::InsertBefore(ItemType* pItem)
-
- 5782 if(pItem != VMA_NULL)
-
- 5784 ItemType*
const prevItem = pItem->pPrev;
- 5785 ItemType*
const newItem = m_ItemAllocator.Alloc();
- 5786 newItem->pPrev = prevItem;
- 5787 newItem->pNext = pItem;
- 5788 pItem->pPrev = newItem;
- 5789 if(prevItem != VMA_NULL)
-
- 5791 prevItem->pNext = newItem;
-
-
-
- 5795 VMA_HEAVY_ASSERT(m_pFront == pItem);
-
-
-
-
-
-
-
-
-
- 5805 template<
typename T>
- 5806 VmaListItem<T>* VmaRawList<T>::InsertAfter(ItemType* pItem)
-
- 5808 if(pItem != VMA_NULL)
-
- 5810 ItemType*
const nextItem = pItem->pNext;
- 5811 ItemType*
const newItem = m_ItemAllocator.Alloc();
- 5812 newItem->pNext = nextItem;
- 5813 newItem->pPrev = pItem;
- 5814 pItem->pNext = newItem;
- 5815 if(nextItem != VMA_NULL)
-
- 5817 nextItem->pPrev = newItem;
-
-
-
- 5821 VMA_HEAVY_ASSERT(m_pBack == pItem);
-
-
-
-
-
-
-
-
-
- 5831 template<
typename T>
- 5832 VmaListItem<T>* VmaRawList<T>::InsertBefore(ItemType* pItem,
const T& value)
-
- 5834 ItemType*
const newItem = InsertBefore(pItem);
- 5835 newItem->Value = value;
-
-
-
- 5839 template<
typename T>
- 5840 VmaListItem<T>* VmaRawList<T>::InsertAfter(ItemType* pItem,
const T& value)
-
- 5842 ItemType*
const newItem = InsertAfter(pItem);
- 5843 newItem->Value = value;
-
-
-
- 5847 template<
typename T,
typename AllocatorT>
-
-
- 5850 VMA_CLASS_NO_COPY(VmaList)
-
-
-
-
-
-
-
-
-
-
- 5861 T& operator*()
const
-
- 5863 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- 5864 return m_pItem->Value;
-
- 5866 T* operator->()
const
-
- 5868 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- 5869 return &m_pItem->Value;
+ 5553 template<
typename T>
+ 5554 typename VmaPoolAllocator<T>::ItemBlock& VmaPoolAllocator<T>::CreateNewBlock()
+
+ 5556 const uint32_t newBlockCapacity = m_ItemBlocks.empty() ?
+ 5557 m_FirstBlockCapacity : m_ItemBlocks.back().Capacity * 3 / 2;
+
+ 5559 const ItemBlock newBlock = {
+ 5560 vma_new_array(m_pAllocationCallbacks, Item, newBlockCapacity),
+
+
+
+ 5564 m_ItemBlocks.push_back(newBlock);
+
+
+ 5567 for(uint32_t i = 0; i < newBlockCapacity - 1; ++i)
+ 5568 newBlock.pItems[i].NextFreeIndex = i + 1;
+ 5569 newBlock.pItems[newBlockCapacity - 1].NextFreeIndex = UINT32_MAX;
+ 5570 return m_ItemBlocks.back();
+
+
+
+
+ 5576 #if VMA_USE_STL_LIST
+
+ 5578 #define VmaList std::list
+
+
+
+ 5582 template<
typename T>
+
+
+
+
+
+
+
+
+ 5591 template<
typename T>
+
+
+ 5594 VMA_CLASS_NO_COPY(VmaRawList)
+
+ 5596 typedef VmaListItem<T> ItemType;
+
+ 5598 VmaRawList(
const VkAllocationCallbacks* pAllocationCallbacks);
+
+
+
+ 5602 size_t GetCount()
const {
return m_Count; }
+ 5603 bool IsEmpty()
const {
return m_Count == 0; }
+
+ 5605 ItemType* Front() {
return m_pFront; }
+ 5606 const ItemType* Front()
const {
return m_pFront; }
+ 5607 ItemType* Back() {
return m_pBack; }
+ 5608 const ItemType* Back()
const {
return m_pBack; }
+
+ 5610 ItemType* PushBack();
+ 5611 ItemType* PushFront();
+ 5612 ItemType* PushBack(
const T& value);
+ 5613 ItemType* PushFront(
const T& value);
+
+
+
+
+ 5618 ItemType* InsertBefore(ItemType* pItem);
+
+ 5620 ItemType* InsertAfter(ItemType* pItem);
+
+ 5622 ItemType* InsertBefore(ItemType* pItem,
const T& value);
+ 5623 ItemType* InsertAfter(ItemType* pItem,
const T& value);
+
+ 5625 void Remove(ItemType* pItem);
+
+
+ 5628 const VkAllocationCallbacks*
const m_pAllocationCallbacks;
+ 5629 VmaPoolAllocator<ItemType> m_ItemAllocator;
+
+
+
+
+
+ 5635 template<
typename T>
+ 5636 VmaRawList<T>::VmaRawList(
const VkAllocationCallbacks* pAllocationCallbacks) :
+ 5637 m_pAllocationCallbacks(pAllocationCallbacks),
+ 5638 m_ItemAllocator(pAllocationCallbacks, 128),
+
+
+
+
+
+
+ 5645 template<
typename T>
+ 5646 VmaRawList<T>::~VmaRawList()
+
+
+
+
+
+ 5652 template<
typename T>
+ 5653 void VmaRawList<T>::Clear()
+
+ 5655 if(IsEmpty() ==
false)
+
+ 5657 ItemType* pItem = m_pBack;
+ 5658 while(pItem != VMA_NULL)
+
+ 5660 ItemType*
const pPrevItem = pItem->pPrev;
+ 5661 m_ItemAllocator.Free(pItem);
+
+
+ 5664 m_pFront = VMA_NULL;
+
+
+
+
+
+ 5670 template<
typename T>
+ 5671 VmaListItem<T>* VmaRawList<T>::PushBack()
+
+ 5673 ItemType*
const pNewItem = m_ItemAllocator.Alloc();
+ 5674 pNewItem->pNext = VMA_NULL;
+
+
+ 5677 pNewItem->pPrev = VMA_NULL;
+ 5678 m_pFront = pNewItem;
+
+
+
+
+
+ 5684 pNewItem->pPrev = m_pBack;
+ 5685 m_pBack->pNext = pNewItem;
+
+
+
+
+
+
+ 5692 template<
typename T>
+ 5693 VmaListItem<T>* VmaRawList<T>::PushFront()
+
+ 5695 ItemType*
const pNewItem = m_ItemAllocator.Alloc();
+ 5696 pNewItem->pPrev = VMA_NULL;
+
+
+ 5699 pNewItem->pNext = VMA_NULL;
+ 5700 m_pFront = pNewItem;
+
+
+
+
+
+ 5706 pNewItem->pNext = m_pFront;
+ 5707 m_pFront->pPrev = pNewItem;
+ 5708 m_pFront = pNewItem;
+
+
+
+
+
+ 5714 template<
typename T>
+ 5715 VmaListItem<T>* VmaRawList<T>::PushBack(
const T& value)
+
+ 5717 ItemType*
const pNewItem = PushBack();
+ 5718 pNewItem->Value = value;
+
+
+
+ 5722 template<
typename T>
+ 5723 VmaListItem<T>* VmaRawList<T>::PushFront(
const T& value)
+
+ 5725 ItemType*
const pNewItem = PushFront();
+ 5726 pNewItem->Value = value;
+
+
+
+ 5730 template<
typename T>
+ 5731 void VmaRawList<T>::PopBack()
+
+ 5733 VMA_HEAVY_ASSERT(m_Count > 0);
+ 5734 ItemType*
const pBackItem = m_pBack;
+ 5735 ItemType*
const pPrevItem = pBackItem->pPrev;
+ 5736 if(pPrevItem != VMA_NULL)
+
+ 5738 pPrevItem->pNext = VMA_NULL;
+
+ 5740 m_pBack = pPrevItem;
+ 5741 m_ItemAllocator.Free(pBackItem);
+
+
+
+ 5745 template<
typename T>
+ 5746 void VmaRawList<T>::PopFront()
+
+ 5748 VMA_HEAVY_ASSERT(m_Count > 0);
+ 5749 ItemType*
const pFrontItem = m_pFront;
+ 5750 ItemType*
const pNextItem = pFrontItem->pNext;
+ 5751 if(pNextItem != VMA_NULL)
+
+ 5753 pNextItem->pPrev = VMA_NULL;
+
+ 5755 m_pFront = pNextItem;
+ 5756 m_ItemAllocator.Free(pFrontItem);
+
+
+
+ 5760 template<
typename T>
+ 5761 void VmaRawList<T>::Remove(ItemType* pItem)
+
+ 5763 VMA_HEAVY_ASSERT(pItem != VMA_NULL);
+ 5764 VMA_HEAVY_ASSERT(m_Count > 0);
+
+ 5766 if(pItem->pPrev != VMA_NULL)
+
+ 5768 pItem->pPrev->pNext = pItem->pNext;
+
+
+
+ 5772 VMA_HEAVY_ASSERT(m_pFront == pItem);
+ 5773 m_pFront = pItem->pNext;
+
+
+ 5776 if(pItem->pNext != VMA_NULL)
+
+ 5778 pItem->pNext->pPrev = pItem->pPrev;
+
+
+
+ 5782 VMA_HEAVY_ASSERT(m_pBack == pItem);
+ 5783 m_pBack = pItem->pPrev;
+
+
+ 5786 m_ItemAllocator.Free(pItem);
+
+
+
+ 5790 template<
typename T>
+ 5791 VmaListItem<T>* VmaRawList<T>::InsertBefore(ItemType* pItem)
+
+ 5793 if(pItem != VMA_NULL)
+
+ 5795 ItemType*
const prevItem = pItem->pPrev;
+ 5796 ItemType*
const newItem = m_ItemAllocator.Alloc();
+ 5797 newItem->pPrev = prevItem;
+ 5798 newItem->pNext = pItem;
+ 5799 pItem->pPrev = newItem;
+ 5800 if(prevItem != VMA_NULL)
+
+ 5802 prevItem->pNext = newItem;
+
+
+
+ 5806 VMA_HEAVY_ASSERT(m_pFront == pItem);
+
+
+
+
+
+
+
+
+
+ 5816 template<
typename T>
+ 5817 VmaListItem<T>* VmaRawList<T>::InsertAfter(ItemType* pItem)
+
+ 5819 if(pItem != VMA_NULL)
+
+ 5821 ItemType*
const nextItem = pItem->pNext;
+ 5822 ItemType*
const newItem = m_ItemAllocator.Alloc();
+ 5823 newItem->pNext = nextItem;
+ 5824 newItem->pPrev = pItem;
+ 5825 pItem->pNext = newItem;
+ 5826 if(nextItem != VMA_NULL)
+
+ 5828 nextItem->pPrev = newItem;
+
+
+
+ 5832 VMA_HEAVY_ASSERT(m_pBack == pItem);
+
+
+
+
+
+
+
+
+
+ 5842 template<
typename T>
+ 5843 VmaListItem<T>* VmaRawList<T>::InsertBefore(ItemType* pItem,
const T& value)
+
+ 5845 ItemType*
const newItem = InsertBefore(pItem);
+ 5846 newItem->Value = value;
+
+
+
+ 5850 template<
typename T>
+ 5851 VmaListItem<T>* VmaRawList<T>::InsertAfter(ItemType* pItem,
const T& value)
+
+ 5853 ItemType*
const newItem = InsertAfter(pItem);
+ 5854 newItem->Value = value;
+
+
+
+ 5858 template<
typename T,
typename AllocatorT>
+
+
+ 5861 VMA_CLASS_NO_COPY(VmaList)
+
+
+
+
+
+
+
+
- 5872 iterator& operator++()
-
+ 5872 T& operator*()
const
+
5874 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- 5875 m_pItem = m_pItem->pNext;
-
-
- 5878 iterator& operator--()
-
- 5880 if(m_pItem != VMA_NULL)
-
- 5882 m_pItem = m_pItem->pPrev;
-
-
-
- 5886 VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
- 5887 m_pItem = m_pList->Back();
-
-
-
-
- 5892 iterator operator++(
int)
-
- 5894 iterator result = *
this;
-
-
-
- 5898 iterator operator--(
int)
-
- 5900 iterator result = *
this;
-
-
-
-
- 5905 bool operator==(
const iterator& rhs)
const
-
- 5907 VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- 5908 return m_pItem == rhs.m_pItem;
-
- 5910 bool operator!=(
const iterator& rhs)
const
-
- 5912 VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- 5913 return m_pItem != rhs.m_pItem;
+ 5875 return m_pItem->Value;
+
+ 5877 T* operator->()
const
+
+ 5879 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ 5880 return &m_pItem->Value;
+
+
+ 5883 iterator& operator++()
+
+ 5885 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ 5886 m_pItem = m_pItem->pNext;
+
+
+ 5889 iterator& operator--()
+
+ 5891 if(m_pItem != VMA_NULL)
+
+ 5893 m_pItem = m_pItem->pPrev;
+
+
+
+ 5897 VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
+ 5898 m_pItem = m_pList->Back();
+
+
+
+
+ 5903 iterator operator++(
int)
+
+ 5905 iterator result = *
this;
+
+
+
+ 5909 iterator operator--(
int)
+
+ 5911 iterator result = *
this;
+
+
-
- 5917 VmaRawList<T>* m_pList;
- 5918 VmaListItem<T>* m_pItem;
-
- 5920 iterator(VmaRawList<T>* pList, VmaListItem<T>* pItem) :
-
-
-
-
-
- 5926 friend class VmaList<T, AllocatorT>;
-
-
- 5929 class const_iterator
-
-
-
-
-
-
-
-
- 5938 const_iterator(
const iterator& src) :
- 5939 m_pList(src.m_pList),
- 5940 m_pItem(src.m_pItem)
-
-
-
- 5944 const T& operator*()
const
-
- 5946 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- 5947 return m_pItem->Value;
-
- 5949 const T* operator->()
const
-
- 5951 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- 5952 return &m_pItem->Value;
+ 5916 bool operator==(
const iterator& rhs)
const
+
+ 5918 VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
+ 5919 return m_pItem == rhs.m_pItem;
+
+ 5921 bool operator!=(
const iterator& rhs)
const
+
+ 5923 VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
+ 5924 return m_pItem != rhs.m_pItem;
+
+
+
+ 5928 VmaRawList<T>* m_pList;
+ 5929 VmaListItem<T>* m_pItem;
+
+ 5931 iterator(VmaRawList<T>* pList, VmaListItem<T>* pItem) :
+
+
+
+
+
+ 5937 friend class VmaList<T, AllocatorT>;
+
+
+ 5940 class const_iterator
+
+
+
+
+
+
+
+
+ 5949 const_iterator(
const iterator& src) :
+ 5950 m_pList(src.m_pList),
+ 5951 m_pItem(src.m_pItem)
+
- 5955 const_iterator& operator++()
-
+ 5955 const T& operator*()
const
+
5957 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
- 5958 m_pItem = m_pItem->pNext;
-
-
- 5961 const_iterator& operator--()
-
- 5963 if(m_pItem != VMA_NULL)
-
- 5965 m_pItem = m_pItem->pPrev;
-
-
-
- 5969 VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
- 5970 m_pItem = m_pList->Back();
-
-
-
-
- 5975 const_iterator operator++(
int)
-
- 5977 const_iterator result = *
this;
-
-
-
- 5981 const_iterator operator--(
int)
-
- 5983 const_iterator result = *
this;
-
-
-
-
- 5988 bool operator==(
const const_iterator& rhs)
const
-
- 5990 VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- 5991 return m_pItem == rhs.m_pItem;
-
- 5993 bool operator!=(
const const_iterator& rhs)
const
-
- 5995 VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
- 5996 return m_pItem != rhs.m_pItem;
+ 5958 return m_pItem->Value;
+
+ 5960 const T* operator->()
const
+
+ 5962 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ 5963 return &m_pItem->Value;
+
+
+ 5966 const_iterator& operator++()
+
+ 5968 VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ 5969 m_pItem = m_pItem->pNext;
+
+
+ 5972 const_iterator& operator--()
+
+ 5974 if(m_pItem != VMA_NULL)
+
+ 5976 m_pItem = m_pItem->pPrev;
+
+
+
+ 5980 VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
+ 5981 m_pItem = m_pList->Back();
+
+
+
+
+ 5986 const_iterator operator++(
int)
+
+ 5988 const_iterator result = *
this;
+
+
+
+ 5992 const_iterator operator--(
int)
+
+ 5994 const_iterator result = *
this;
+
+
-
- 6000 const_iterator(
const VmaRawList<T>* pList,
const VmaListItem<T>* pItem) :
-
-
-
-
-
- 6006 const VmaRawList<T>* m_pList;
- 6007 const VmaListItem<T>* m_pItem;
-
- 6009 friend class VmaList<T, AllocatorT>;
-
-
- 6012 VmaList(
const AllocatorT& allocator) : m_RawList(allocator.m_pCallbacks) { }
-
- 6014 bool empty()
const {
return m_RawList.IsEmpty(); }
- 6015 size_t size()
const {
return m_RawList.GetCount(); }
+ 5999 bool operator==(
const const_iterator& rhs)
const
+
+ 6001 VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
+ 6002 return m_pItem == rhs.m_pItem;
+
+ 6004 bool operator!=(
const const_iterator& rhs)
const
+
+ 6006 VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
+ 6007 return m_pItem != rhs.m_pItem;
+
+
+
+ 6011 const_iterator(
const VmaRawList<T>* pList,
const VmaListItem<T>* pItem) :
+
+
+
+
- 6017 iterator begin() {
return iterator(&m_RawList, m_RawList.Front()); }
- 6018 iterator end() {
return iterator(&m_RawList, VMA_NULL); }
+ 6017 const VmaRawList<T>* m_pList;
+ 6018 const VmaListItem<T>* m_pItem;
- 6020 const_iterator cbegin()
const {
return const_iterator(&m_RawList, m_RawList.Front()); }
- 6021 const_iterator cend()
const {
return const_iterator(&m_RawList, VMA_NULL); }
+ 6020 friend class VmaList<T, AllocatorT>;
+
- 6023 void clear() { m_RawList.Clear(); }
- 6024 void push_back(
const T& value) { m_RawList.PushBack(value); }
- 6025 void erase(iterator it) { m_RawList.Remove(it.m_pItem); }
- 6026 iterator insert(iterator it,
const T& value) {
return iterator(&m_RawList, m_RawList.InsertBefore(it.m_pItem, value)); }
+ 6023 VmaList(
const AllocatorT& allocator) : m_RawList(allocator.m_pCallbacks) { }
+
+ 6025 bool empty()
const {
return m_RawList.IsEmpty(); }
+ 6026 size_t size()
const {
return m_RawList.GetCount(); }
-
- 6029 VmaRawList<T> m_RawList;
-
-
-
+ 6028 iterator begin() {
return iterator(&m_RawList, m_RawList.Front()); }
+ 6029 iterator end() {
return iterator(&m_RawList, VMA_NULL); }
+
+ 6031 const_iterator cbegin()
const {
return const_iterator(&m_RawList, m_RawList.Front()); }
+ 6032 const_iterator cend()
const {
return const_iterator(&m_RawList, VMA_NULL); }
-
-
-
-
-
-
-
-
-
-
-
-
-
- 6048 template<
typename ItemTypeTraits>
- 6049 class VmaIntrusiveLinkedList
-
-
- 6052 typedef typename ItemTypeTraits::ItemType ItemType;
- 6053 static ItemType* GetPrev(
const ItemType* item) {
return ItemTypeTraits::GetPrev(item); }
- 6054 static ItemType* GetNext(
const ItemType* item) {
return ItemTypeTraits::GetNext(item); }
-
- 6056 VmaIntrusiveLinkedList() { }
- 6057 VmaIntrusiveLinkedList(
const VmaIntrusiveLinkedList<ItemTypeTraits>& src) =
delete;
- 6058 VmaIntrusiveLinkedList(VmaIntrusiveLinkedList<ItemTypeTraits>&& src) :
- 6059 m_Front(src.m_Front), m_Back(src.m_Back), m_Count(src.m_Count)
-
- 6061 src.m_Front = src.m_Back = VMA_NULL;
-
-
- 6064 ~VmaIntrusiveLinkedList()
-
- 6066 VMA_HEAVY_ASSERT(IsEmpty());
-
- 6068 VmaIntrusiveLinkedList<ItemTypeTraits>& operator=(
const VmaIntrusiveLinkedList<ItemTypeTraits>& src) =
delete;
- 6069 VmaIntrusiveLinkedList<ItemTypeTraits>& operator=(VmaIntrusiveLinkedList<ItemTypeTraits>&& src)
-
-
-
- 6073 VMA_HEAVY_ASSERT(IsEmpty());
- 6074 m_Front = src.m_Front;
- 6075 m_Back = src.m_Back;
- 6076 m_Count = src.m_Count;
- 6077 src.m_Front = src.m_Back = VMA_NULL;
-
-
-
-
-
-
-
-
- 6086 ItemType* item = m_Back;
- 6087 while(item != VMA_NULL)
-
- 6089 ItemType*
const prevItem = ItemTypeTraits::AccessPrev(item);
- 6090 ItemTypeTraits::AccessPrev(item) = VMA_NULL;
- 6091 ItemTypeTraits::AccessNext(item) = VMA_NULL;
-
-
-
-
-
-
-
- 6099 size_t GetCount()
const {
return m_Count; }
- 6100 bool IsEmpty()
const {
return m_Count == 0; }
- 6101 ItemType* Front() {
return m_Front; }
- 6102 const ItemType* Front()
const {
return m_Front; }
- 6103 ItemType* Back() {
return m_Back; }
- 6104 const ItemType* Back()
const {
return m_Back; }
- 6105 void PushBack(ItemType* item)
-
- 6107 VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
-
-
-
-
-
-
-
-
- 6116 ItemTypeTraits::AccessPrev(item) = m_Back;
- 6117 ItemTypeTraits::AccessNext(m_Back) = item;
-
-
-
-
- 6122 void PushFront(ItemType* item)
-
- 6124 VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
-
+ 6034 void clear() { m_RawList.Clear(); }
+ 6035 void push_back(
const T& value) { m_RawList.PushBack(value); }
+ 6036 void erase(iterator it) { m_RawList.Remove(it.m_pItem); }
+ 6037 iterator insert(iterator it,
const T& value) {
return iterator(&m_RawList, m_RawList.InsertBefore(it.m_pItem, value)); }
+
+
+ 6040 VmaRawList<T> m_RawList;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 6059 template<
typename ItemTypeTraits>
+ 6060 class VmaIntrusiveLinkedList
+
+
+ 6063 typedef typename ItemTypeTraits::ItemType ItemType;
+ 6064 static ItemType* GetPrev(
const ItemType* item) {
return ItemTypeTraits::GetPrev(item); }
+ 6065 static ItemType* GetNext(
const ItemType* item) {
return ItemTypeTraits::GetNext(item); }
+
+ 6067 VmaIntrusiveLinkedList() { }
+ 6068 VmaIntrusiveLinkedList(
const VmaIntrusiveLinkedList<ItemTypeTraits>& src) =
delete;
+ 6069 VmaIntrusiveLinkedList(VmaIntrusiveLinkedList<ItemTypeTraits>&& src) :
+ 6070 m_Front(src.m_Front), m_Back(src.m_Back), m_Count(src.m_Count)
+
+ 6072 src.m_Front = src.m_Back = VMA_NULL;
+
+
+ 6075 ~VmaIntrusiveLinkedList()
+
+ 6077 VMA_HEAVY_ASSERT(IsEmpty());
+
+ 6079 VmaIntrusiveLinkedList<ItemTypeTraits>& operator=(
const VmaIntrusiveLinkedList<ItemTypeTraits>& src) =
delete;
+ 6080 VmaIntrusiveLinkedList<ItemTypeTraits>& operator=(VmaIntrusiveLinkedList<ItemTypeTraits>&& src)
+
+
+
+ 6084 VMA_HEAVY_ASSERT(IsEmpty());
+ 6085 m_Front = src.m_Front;
+ 6086 m_Back = src.m_Back;
+ 6087 m_Count = src.m_Count;
+ 6088 src.m_Front = src.m_Back = VMA_NULL;
+
+
+
+
+
+
+
+
+ 6097 ItemType* item = m_Back;
+ 6098 while(item != VMA_NULL)
+
+ 6100 ItemType*
const prevItem = ItemTypeTraits::AccessPrev(item);
+ 6101 ItemTypeTraits::AccessPrev(item) = VMA_NULL;
+ 6102 ItemTypeTraits::AccessNext(item) = VMA_NULL;
+
+
+
+
+
+
+
+ 6110 size_t GetCount()
const {
return m_Count; }
+ 6111 bool IsEmpty()
const {
return m_Count == 0; }
+ 6112 ItemType* Front() {
return m_Front; }
+ 6113 const ItemType* Front()
const {
return m_Front; }
+ 6114 ItemType* Back() {
return m_Back; }
+ 6115 const ItemType* Back()
const {
return m_Back; }
+ 6116 void PushBack(ItemType* item)
+
+ 6118 VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
+
+
+
+
+
+
+
-
-
-
-
-
-
- 6133 ItemTypeTraits::AccessNext(item) = m_Front;
- 6134 ItemTypeTraits::AccessPrev(m_Front) = item;
-
-
-
-
-
-
- 6141 VMA_HEAVY_ASSERT(m_Count > 0);
- 6142 ItemType*
const backItem = m_Back;
- 6143 ItemType*
const prevItem = ItemTypeTraits::GetPrev(backItem);
- 6144 if(prevItem != VMA_NULL)
-
- 6146 ItemTypeTraits::AccessNext(prevItem) = VMA_NULL;
-
-
-
- 6150 ItemTypeTraits::AccessPrev(backItem) = VMA_NULL;
- 6151 ItemTypeTraits::AccessNext(backItem) = VMA_NULL;
-
-
- 6154 ItemType* PopFront()
-
- 6156 VMA_HEAVY_ASSERT(m_Count > 0);
- 6157 ItemType*
const frontItem = m_Front;
- 6158 ItemType*
const nextItem = ItemTypeTraits::GetNext(frontItem);
- 6159 if(nextItem != VMA_NULL)
-
- 6161 ItemTypeTraits::AccessPrev(nextItem) = VMA_NULL;
-
-
-
- 6165 ItemTypeTraits::AccessPrev(frontItem) = VMA_NULL;
- 6166 ItemTypeTraits::AccessNext(frontItem) = VMA_NULL;
-
-
-
-
- 6171 void InsertBefore(ItemType* existingItem, ItemType* newItem)
-
- 6173 VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
- 6174 if(existingItem != VMA_NULL)
-
- 6176 ItemType*
const prevItem = ItemTypeTraits::GetPrev(existingItem);
- 6177 ItemTypeTraits::AccessPrev(newItem) = prevItem;
- 6178 ItemTypeTraits::AccessNext(newItem) = existingItem;
- 6179 ItemTypeTraits::AccessPrev(existingItem) = newItem;
- 6180 if(prevItem != VMA_NULL)
-
- 6182 ItemTypeTraits::AccessNext(prevItem) = newItem;
-
-
-
- 6186 VMA_HEAVY_ASSERT(m_Front == existingItem);
-
-
-
-
-
-
-
-
- 6195 void InsertAfter(ItemType* existingItem, ItemType* newItem)
-
- 6197 VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
- 6198 if(existingItem != VMA_NULL)
-
- 6200 ItemType*
const nextItem = ItemTypeTraits::GetNext(existingItem);
- 6201 ItemTypeTraits::AccessNext(newItem) = nextItem;
- 6202 ItemTypeTraits::AccessPrev(newItem) = existingItem;
- 6203 ItemTypeTraits::AccessNext(existingItem) = newItem;
- 6204 if(nextItem != VMA_NULL)
-
- 6206 ItemTypeTraits::AccessPrev(nextItem) = newItem;
-
-
-
- 6210 VMA_HEAVY_ASSERT(m_Back == existingItem);
-
-
-
-
-
- 6216 return PushFront(newItem);
-
- 6218 void Remove(ItemType* item)
-
- 6220 VMA_HEAVY_ASSERT(item != VMA_NULL && m_Count > 0);
- 6221 if(ItemTypeTraits::GetPrev(item) != VMA_NULL)
-
- 6223 ItemTypeTraits::AccessNext(ItemTypeTraits::AccessPrev(item)) = ItemTypeTraits::GetNext(item);
-
-
-
- 6227 VMA_HEAVY_ASSERT(m_Front == item);
- 6228 m_Front = ItemTypeTraits::GetNext(item);
-
-
- 6231 if(ItemTypeTraits::GetNext(item) != VMA_NULL)
-
- 6233 ItemTypeTraits::AccessPrev(ItemTypeTraits::AccessNext(item)) = ItemTypeTraits::GetPrev(item);
-
-
-
- 6237 VMA_HEAVY_ASSERT(m_Back == item);
- 6238 m_Back = ItemTypeTraits::GetPrev(item);
-
- 6240 ItemTypeTraits::AccessPrev(item) = VMA_NULL;
- 6241 ItemTypeTraits::AccessNext(item) = VMA_NULL;
-
-
-
- 6245 ItemType* m_Front = VMA_NULL;
- 6246 ItemType* m_Back = VMA_NULL;
-
-
-
-
-
-
-
-
- 6256 #if VMA_USE_STL_UNORDERED_MAP
-
- 6258 #define VmaPair std::pair
-
- 6260 #define VMA_MAP_TYPE(KeyT, ValueT) \
- 6261 std::unordered_map< KeyT, ValueT, std::hash<KeyT>, std::equal_to<KeyT>, VmaStlAllocator< std::pair<KeyT, ValueT> > >
-
-
-
- 6265 template<
typename T1,
typename T2>
-
-
-
-
+ 6127 ItemTypeTraits::AccessPrev(item) = m_Back;
+ 6128 ItemTypeTraits::AccessNext(m_Back) = item;
+
+
+
+
+ 6133 void PushFront(ItemType* item)
+
+ 6135 VMA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == VMA_NULL && ItemTypeTraits::GetNext(item) == VMA_NULL);
+
+
+
+
+
+
+
+
+ 6144 ItemTypeTraits::AccessNext(item) = m_Front;
+ 6145 ItemTypeTraits::AccessPrev(m_Front) = item;
+
+
+
+
+
+
+ 6152 VMA_HEAVY_ASSERT(m_Count > 0);
+ 6153 ItemType*
const backItem = m_Back;
+ 6154 ItemType*
const prevItem = ItemTypeTraits::GetPrev(backItem);
+ 6155 if(prevItem != VMA_NULL)
+
+ 6157 ItemTypeTraits::AccessNext(prevItem) = VMA_NULL;
+
+
+
+ 6161 ItemTypeTraits::AccessPrev(backItem) = VMA_NULL;
+ 6162 ItemTypeTraits::AccessNext(backItem) = VMA_NULL;
+
+
+ 6165 ItemType* PopFront()
+
+ 6167 VMA_HEAVY_ASSERT(m_Count > 0);
+ 6168 ItemType*
const frontItem = m_Front;
+ 6169 ItemType*
const nextItem = ItemTypeTraits::GetNext(frontItem);
+ 6170 if(nextItem != VMA_NULL)
+
+ 6172 ItemTypeTraits::AccessPrev(nextItem) = VMA_NULL;
+
+
+
+ 6176 ItemTypeTraits::AccessPrev(frontItem) = VMA_NULL;
+ 6177 ItemTypeTraits::AccessNext(frontItem) = VMA_NULL;
+
+
+
+
+ 6182 void InsertBefore(ItemType* existingItem, ItemType* newItem)
+
+ 6184 VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
+ 6185 if(existingItem != VMA_NULL)
+
+ 6187 ItemType*
const prevItem = ItemTypeTraits::GetPrev(existingItem);
+ 6188 ItemTypeTraits::AccessPrev(newItem) = prevItem;
+ 6189 ItemTypeTraits::AccessNext(newItem) = existingItem;
+ 6190 ItemTypeTraits::AccessPrev(existingItem) = newItem;
+ 6191 if(prevItem != VMA_NULL)
+
+ 6193 ItemTypeTraits::AccessNext(prevItem) = newItem;
+
+
+
+ 6197 VMA_HEAVY_ASSERT(m_Front == existingItem);
+
+
+
+
+
+
+
+
+ 6206 void InsertAfter(ItemType* existingItem, ItemType* newItem)
+
+ 6208 VMA_HEAVY_ASSERT(newItem != VMA_NULL && ItemTypeTraits::GetPrev(newItem) == VMA_NULL && ItemTypeTraits::GetNext(newItem) == VMA_NULL);
+ 6209 if(existingItem != VMA_NULL)
+
+ 6211 ItemType*
const nextItem = ItemTypeTraits::GetNext(existingItem);
+ 6212 ItemTypeTraits::AccessNext(newItem) = nextItem;
+ 6213 ItemTypeTraits::AccessPrev(newItem) = existingItem;
+ 6214 ItemTypeTraits::AccessNext(existingItem) = newItem;
+ 6215 if(nextItem != VMA_NULL)
+
+ 6217 ItemTypeTraits::AccessPrev(nextItem) = newItem;
+
+
+
+ 6221 VMA_HEAVY_ASSERT(m_Back == existingItem);
+
+
+
+
+
+ 6227 return PushFront(newItem);
+
+ 6229 void Remove(ItemType* item)
+
+ 6231 VMA_HEAVY_ASSERT(item != VMA_NULL && m_Count > 0);
+ 6232 if(ItemTypeTraits::GetPrev(item) != VMA_NULL)
+
+ 6234 ItemTypeTraits::AccessNext(ItemTypeTraits::AccessPrev(item)) = ItemTypeTraits::GetNext(item);
+
+
+
+ 6238 VMA_HEAVY_ASSERT(m_Front == item);
+ 6239 m_Front = ItemTypeTraits::GetNext(item);
+
+
+ 6242 if(ItemTypeTraits::GetNext(item) != VMA_NULL)
+
+ 6244 ItemTypeTraits::AccessPrev(ItemTypeTraits::AccessNext(item)) = ItemTypeTraits::GetPrev(item);
+
+
+
+ 6248 VMA_HEAVY_ASSERT(m_Back == item);
+ 6249 m_Back = ItemTypeTraits::GetPrev(item);
+
+ 6251 ItemTypeTraits::AccessPrev(item) = VMA_NULL;
+ 6252 ItemTypeTraits::AccessNext(item) = VMA_NULL;
+
+
+
+ 6256 ItemType* m_Front = VMA_NULL;
+ 6257 ItemType* m_Back = VMA_NULL;
+
+
+
+
+
+
+
+
+ 6267 #if VMA_USE_STL_UNORDERED_MAP
+
+ 6269 #define VmaPair std::pair
- 6271 VmaPair() : first(), second() { }
- 6272 VmaPair(
const T1& firstSrc,
const T2& secondSrc) : first(firstSrc), second(secondSrc) { }
-
-
-
-
-
- 6278 template<
typename KeyT,
typename ValueT>
-
-
-
- 6282 typedef VmaPair<KeyT, ValueT> PairType;
- 6283 typedef PairType* iterator;
-
- 6285 VmaMap(
const VmaStlAllocator<PairType>& allocator) : m_Vector(allocator) { }
-
- 6287 iterator begin() {
return m_Vector.begin(); }
- 6288 iterator end() {
return m_Vector.end(); }
-
- 6290 void insert(
const PairType& pair);
- 6291 iterator find(
const KeyT& key);
- 6292 void erase(iterator it);
-
-
- 6295 VmaVector< PairType, VmaStlAllocator<PairType> > m_Vector;
-
+ 6271 #define VMA_MAP_TYPE(KeyT, ValueT) \
+ 6272 std::unordered_map< KeyT, ValueT, std::hash<KeyT>, std::equal_to<KeyT>, VmaStlAllocator< std::pair<KeyT, ValueT> > >
+
+
+
+ 6276 template<
typename T1,
typename T2>
+
+
+
+
+
+ 6282 VmaPair() : first(), second() { }
+ 6283 VmaPair(
const T1& firstSrc,
const T2& secondSrc) : first(firstSrc), second(secondSrc) { }
+
+
+
+
+
+ 6289 template<
typename KeyT,
typename ValueT>
+
+
+
+ 6293 typedef VmaPair<KeyT, ValueT> PairType;
+ 6294 typedef PairType* iterator;
+
+ 6296 VmaMap(
const VmaStlAllocator<PairType>& allocator) : m_Vector(allocator) { }
- 6298 #define VMA_MAP_TYPE(KeyT, ValueT) VmaMap<KeyT, ValueT>
-
- 6300 template<
typename FirstT,
typename SecondT>
- 6301 struct VmaPairFirstLess
-
- 6303 bool operator()(
const VmaPair<FirstT, SecondT>& lhs,
const VmaPair<FirstT, SecondT>& rhs)
const
-
- 6305 return lhs.first < rhs.first;
-
- 6307 bool operator()(
const VmaPair<FirstT, SecondT>& lhs,
const FirstT& rhsFirst)
const
-
- 6309 return lhs.first < rhsFirst;
-
-
-
- 6313 template<
typename KeyT,
typename ValueT>
- 6314 void VmaMap<KeyT, ValueT>::insert(
const PairType& pair)
-
- 6316 const size_t indexToInsert = VmaBinaryFindFirstNotLess(
-
- 6318 m_Vector.data() + m_Vector.size(),
-
- 6320 VmaPairFirstLess<KeyT, ValueT>()) - m_Vector.data();
- 6321 VmaVectorInsert(m_Vector, indexToInsert, pair);
-
+ 6298 iterator begin() {
return m_Vector.begin(); }
+ 6299 iterator end() {
return m_Vector.end(); }
+
+ 6301 void insert(
const PairType& pair);
+ 6302 iterator find(
const KeyT& key);
+ 6303 void erase(iterator it);
+
+
+ 6306 VmaVector< PairType, VmaStlAllocator<PairType> > m_Vector;
+
+
+ 6309 #define VMA_MAP_TYPE(KeyT, ValueT) VmaMap<KeyT, ValueT>
+
+ 6311 template<
typename FirstT,
typename SecondT>
+ 6312 struct VmaPairFirstLess
+
+ 6314 bool operator()(
const VmaPair<FirstT, SecondT>& lhs,
const VmaPair<FirstT, SecondT>& rhs)
const
+
+ 6316 return lhs.first < rhs.first;
+
+ 6318 bool operator()(
const VmaPair<FirstT, SecondT>& lhs,
const FirstT& rhsFirst)
const
+
+ 6320 return lhs.first < rhsFirst;
+
+
6324 template<
typename KeyT,
typename ValueT>
- 6325 VmaPair<KeyT, ValueT>* VmaMap<KeyT, ValueT>::find(
const KeyT& key)
+ 6325 void VmaMap<KeyT, ValueT>::insert(
const PairType& pair)
- 6327 PairType* it = VmaBinaryFindFirstNotLess(
+ 6327 const size_t indexToInsert = VmaBinaryFindFirstNotLess(
6329 m_Vector.data() + m_Vector.size(),
-
- 6331 VmaPairFirstLess<KeyT, ValueT>());
- 6332 if((it != m_Vector.end()) && (it->first == key))
-
-
-
-
-
- 6338 return m_Vector.end();
-
-
-
- 6342 template<
typename KeyT,
typename ValueT>
- 6343 void VmaMap<KeyT, ValueT>::erase(iterator it)
-
- 6345 VmaVectorRemove(m_Vector, it - m_Vector.begin());
-
-
-
-
-
-
-
- 6354 class VmaDeviceMemoryBlock;
-
- 6356 enum VMA_CACHE_OPERATION { VMA_CACHE_FLUSH, VMA_CACHE_INVALIDATE };
-
- 6358 struct VmaAllocation_T
-
-
- 6361 static const uint8_t MAP_COUNT_FLAG_PERSISTENT_MAP = 0x80;
+
+ 6331 VmaPairFirstLess<KeyT, ValueT>()) - m_Vector.data();
+ 6332 VmaVectorInsert(m_Vector, indexToInsert, pair);
+
+
+ 6335 template<
typename KeyT,
typename ValueT>
+ 6336 VmaPair<KeyT, ValueT>* VmaMap<KeyT, ValueT>::find(
const KeyT& key)
+
+ 6338 PairType* it = VmaBinaryFindFirstNotLess(
+
+ 6340 m_Vector.data() + m_Vector.size(),
+
+ 6342 VmaPairFirstLess<KeyT, ValueT>());
+ 6343 if((it != m_Vector.end()) && (it->first == key))
+
+
+
+
+
+ 6349 return m_Vector.end();
+
+
+
+ 6353 template<
typename KeyT,
typename ValueT>
+ 6354 void VmaMap<KeyT, ValueT>::erase(iterator it)
+
+ 6356 VmaVectorRemove(m_Vector, it - m_Vector.begin());
+
+
+
+
+
-
-
- 6365 FLAG_USER_DATA_STRING = 0x01,
-
-
-
- 6369 enum ALLOCATION_TYPE
-
- 6371 ALLOCATION_TYPE_NONE,
- 6372 ALLOCATION_TYPE_BLOCK,
- 6373 ALLOCATION_TYPE_DEDICATED,
-
-
-
-
-
-
- 6380 VmaAllocation_T(uint32_t currentFrameIndex,
bool userDataString) :
-
-
- 6383 m_pUserData{VMA_NULL},
- 6384 m_LastUseFrameIndex{currentFrameIndex},
- 6385 m_MemoryTypeIndex{0},
- 6386 m_Type{(uint8_t)ALLOCATION_TYPE_NONE},
- 6387 m_SuballocationType{(uint8_t)VMA_SUBALLOCATION_TYPE_UNKNOWN},
-
- 6389 m_Flags{userDataString ? (uint8_t)FLAG_USER_DATA_STRING : (uint8_t)0}
-
- 6391 #if VMA_STATS_STRING_ENABLED
- 6392 m_CreationFrameIndex = currentFrameIndex;
- 6393 m_BufferImageUsage = 0;
-
-
-
-
-
- 6399 VMA_ASSERT((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) == 0 &&
"Allocation was not unmapped before destruction.");
-
-
- 6402 VMA_ASSERT(m_pUserData == VMA_NULL);
-
-
- 6405 void InitBlockAllocation(
- 6406 VmaDeviceMemoryBlock* block,
- 6407 VkDeviceSize offset,
- 6408 VkDeviceSize alignment,
-
- 6410 uint32_t memoryTypeIndex,
- 6411 VmaSuballocationType suballocationType,
-
-
-
- 6415 VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
- 6416 VMA_ASSERT(block != VMA_NULL);
- 6417 m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;
- 6418 m_Alignment = alignment;
-
- 6420 m_MemoryTypeIndex = memoryTypeIndex;
- 6421 m_MapCount = mapped ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;
- 6422 m_SuballocationType = (uint8_t)suballocationType;
- 6423 m_BlockAllocation.m_Block = block;
- 6424 m_BlockAllocation.m_Offset = offset;
- 6425 m_BlockAllocation.m_CanBecomeLost = canBecomeLost;
-
-
-
-
- 6430 VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
- 6431 VMA_ASSERT(m_LastUseFrameIndex.load() == VMA_FRAME_INDEX_LOST);
- 6432 m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;
- 6433 m_MemoryTypeIndex = 0;
- 6434 m_BlockAllocation.m_Block = VMA_NULL;
- 6435 m_BlockAllocation.m_Offset = 0;
- 6436 m_BlockAllocation.m_CanBecomeLost =
true;
+
+ 6365 class VmaDeviceMemoryBlock;
+
+ 6367 enum VMA_CACHE_OPERATION { VMA_CACHE_FLUSH, VMA_CACHE_INVALIDATE };
+
+ 6369 struct VmaAllocation_T
+
+
+ 6372 static const uint8_t MAP_COUNT_FLAG_PERSISTENT_MAP = 0x80;
+
+
+
+ 6376 FLAG_USER_DATA_STRING = 0x01,
+
+
+
+ 6380 enum ALLOCATION_TYPE
+
+ 6382 ALLOCATION_TYPE_NONE,
+ 6383 ALLOCATION_TYPE_BLOCK,
+ 6384 ALLOCATION_TYPE_DEDICATED,
+
+
+
+
+
+
+ 6391 VmaAllocation_T(uint32_t currentFrameIndex,
bool userDataString) :
+
+
+ 6394 m_pUserData{VMA_NULL},
+ 6395 m_LastUseFrameIndex{currentFrameIndex},
+ 6396 m_MemoryTypeIndex{0},
+ 6397 m_Type{(uint8_t)ALLOCATION_TYPE_NONE},
+ 6398 m_SuballocationType{(uint8_t)VMA_SUBALLOCATION_TYPE_UNKNOWN},
+
+ 6400 m_Flags{userDataString ? (uint8_t)FLAG_USER_DATA_STRING : (uint8_t)0}
+
+ 6402 #if VMA_STATS_STRING_ENABLED
+ 6403 m_CreationFrameIndex = currentFrameIndex;
+ 6404 m_BufferImageUsage = 0;
+
+
+
+
+
+ 6410 VMA_ASSERT((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) == 0 &&
"Allocation was not unmapped before destruction.");
+
+
+ 6413 VMA_ASSERT(m_pUserData == VMA_NULL);
+
+
+ 6416 void InitBlockAllocation(
+ 6417 VmaDeviceMemoryBlock* block,
+ 6418 VkDeviceSize offset,
+ 6419 VkDeviceSize alignment,
+
+ 6421 uint32_t memoryTypeIndex,
+ 6422 VmaSuballocationType suballocationType,
+
+
+
+ 6426 VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
+ 6427 VMA_ASSERT(block != VMA_NULL);
+ 6428 m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;
+ 6429 m_Alignment = alignment;
+
+ 6431 m_MemoryTypeIndex = memoryTypeIndex;
+ 6432 m_MapCount = mapped ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;
+ 6433 m_SuballocationType = (uint8_t)suballocationType;
+ 6434 m_BlockAllocation.m_Block = block;
+ 6435 m_BlockAllocation.m_Offset = offset;
+ 6436 m_BlockAllocation.m_CanBecomeLost = canBecomeLost;
- 6439 void ChangeBlockAllocation(
-
- 6441 VmaDeviceMemoryBlock* block,
- 6442 VkDeviceSize offset);
-
- 6444 void ChangeOffset(VkDeviceSize newOffset);
-
-
- 6447 void InitDedicatedAllocation(
- 6448 uint32_t memoryTypeIndex,
- 6449 VkDeviceMemory hMemory,
- 6450 VmaSuballocationType suballocationType,
-
-
-
- 6454 VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
- 6455 VMA_ASSERT(hMemory != VK_NULL_HANDLE);
- 6456 m_Type = (uint8_t)ALLOCATION_TYPE_DEDICATED;
-
-
- 6459 m_MemoryTypeIndex = memoryTypeIndex;
- 6460 m_SuballocationType = (uint8_t)suballocationType;
- 6461 m_MapCount = (pMappedData != VMA_NULL) ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;
- 6462 m_DedicatedAllocation.m_hMemory = hMemory;
- 6463 m_DedicatedAllocation.m_pMappedData = pMappedData;
- 6464 m_DedicatedAllocation.m_Prev = VMA_NULL;
- 6465 m_DedicatedAllocation.m_Next = VMA_NULL;
-
-
- 6468 ALLOCATION_TYPE GetType()
const {
return (ALLOCATION_TYPE)m_Type; }
- 6469 VkDeviceSize GetAlignment()
const {
return m_Alignment; }
- 6470 VkDeviceSize GetSize()
const {
return m_Size; }
- 6471 bool IsUserDataString()
const {
return (m_Flags & FLAG_USER_DATA_STRING) != 0; }
- 6472 void* GetUserData()
const {
return m_pUserData; }
- 6473 void SetUserData(
VmaAllocator hAllocator,
void* pUserData);
- 6474 VmaSuballocationType GetSuballocationType()
const {
return (VmaSuballocationType)m_SuballocationType; }
-
- 6476 VmaDeviceMemoryBlock* GetBlock()
const
-
- 6478 VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
- 6479 return m_BlockAllocation.m_Block;
-
- 6481 VkDeviceSize GetOffset()
const;
- 6482 VkDeviceMemory GetMemory()
const;
- 6483 uint32_t GetMemoryTypeIndex()
const {
return m_MemoryTypeIndex; }
- 6484 bool IsPersistentMap()
const {
return (m_MapCount & MAP_COUNT_FLAG_PERSISTENT_MAP) != 0; }
- 6485 void* GetMappedData()
const;
- 6486 bool CanBecomeLost()
const;
-
- 6488 uint32_t GetLastUseFrameIndex()
const
-
- 6490 return m_LastUseFrameIndex.load();
+
+
+ 6441 VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
+ 6442 VMA_ASSERT(m_LastUseFrameIndex.load() == VMA_FRAME_INDEX_LOST);
+ 6443 m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;
+ 6444 m_MemoryTypeIndex = 0;
+ 6445 m_BlockAllocation.m_Block = VMA_NULL;
+ 6446 m_BlockAllocation.m_Offset = 0;
+ 6447 m_BlockAllocation.m_CanBecomeLost =
true;
+
+
+ 6450 void ChangeBlockAllocation(
+
+ 6452 VmaDeviceMemoryBlock* block,
+ 6453 VkDeviceSize offset);
+
+ 6455 void ChangeOffset(VkDeviceSize newOffset);
+
+
+ 6458 void InitDedicatedAllocation(
+ 6459 uint32_t memoryTypeIndex,
+ 6460 VkDeviceMemory hMemory,
+ 6461 VmaSuballocationType suballocationType,
+
+
+
+ 6465 VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
+ 6466 VMA_ASSERT(hMemory != VK_NULL_HANDLE);
+ 6467 m_Type = (uint8_t)ALLOCATION_TYPE_DEDICATED;
+
+
+ 6470 m_MemoryTypeIndex = memoryTypeIndex;
+ 6471 m_SuballocationType = (uint8_t)suballocationType;
+ 6472 m_MapCount = (pMappedData != VMA_NULL) ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;
+ 6473 m_DedicatedAllocation.m_hMemory = hMemory;
+ 6474 m_DedicatedAllocation.m_pMappedData = pMappedData;
+ 6475 m_DedicatedAllocation.m_Prev = VMA_NULL;
+ 6476 m_DedicatedAllocation.m_Next = VMA_NULL;
+
+
+ 6479 ALLOCATION_TYPE GetType()
const {
return (ALLOCATION_TYPE)m_Type; }
+ 6480 VkDeviceSize GetAlignment()
const {
return m_Alignment; }
+ 6481 VkDeviceSize GetSize()
const {
return m_Size; }
+ 6482 bool IsUserDataString()
const {
return (m_Flags & FLAG_USER_DATA_STRING) != 0; }
+ 6483 void* GetUserData()
const {
return m_pUserData; }
+ 6484 void SetUserData(
VmaAllocator hAllocator,
void* pUserData);
+ 6485 VmaSuballocationType GetSuballocationType()
const {
return (VmaSuballocationType)m_SuballocationType; }
+
+ 6487 VmaDeviceMemoryBlock* GetBlock()
const
+
+ 6489 VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
+ 6490 return m_BlockAllocation.m_Block;
- 6492 bool CompareExchangeLastUseFrameIndex(uint32_t& expected, uint32_t desired)
-
- 6494 return m_LastUseFrameIndex.compare_exchange_weak(expected, desired);
-
-
-
-
-
-
-
-
-
- 6504 bool MakeLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
-
- 6506 void DedicatedAllocCalcStatsInfo(
VmaStatInfo& outInfo)
-
- 6508 VMA_ASSERT(m_Type == ALLOCATION_TYPE_DEDICATED);
-
-
-
-
-
-
-
-
-
-
- 6519 void BlockAllocMap();
- 6520 void BlockAllocUnmap();
- 6521 VkResult DedicatedAllocMap(
VmaAllocator hAllocator,
void** ppData);
-
-
- 6524 #if VMA_STATS_STRING_ENABLED
- 6525 uint32_t GetCreationFrameIndex()
const {
return m_CreationFrameIndex; }
- 6526 uint32_t GetBufferImageUsage()
const {
return m_BufferImageUsage; }
-
- 6528 void InitBufferImageUsage(uint32_t bufferImageUsage)
-
- 6530 VMA_ASSERT(m_BufferImageUsage == 0);
- 6531 m_BufferImageUsage = bufferImageUsage;
-
-
- 6534 void PrintParameters(
class VmaJsonWriter& json)
const;
-
-
-
- 6538 VkDeviceSize m_Alignment;
- 6539 VkDeviceSize m_Size;
-
- 6541 VMA_ATOMIC_UINT32 m_LastUseFrameIndex;
- 6542 uint32_t m_MemoryTypeIndex;
-
- 6544 uint8_t m_SuballocationType;
-
-
-
-
-
-
- 6551 struct BlockAllocation
-
- 6553 VmaDeviceMemoryBlock* m_Block;
- 6554 VkDeviceSize m_Offset;
- 6555 bool m_CanBecomeLost;
-
-
-
- 6559 struct DedicatedAllocation
-
- 6561 VkDeviceMemory m_hMemory;
- 6562 void* m_pMappedData;
- 6563 VmaAllocation_T* m_Prev;
- 6564 VmaAllocation_T* m_Next;
-
-
-
-
-
- 6570 BlockAllocation m_BlockAllocation;
-
- 6572 DedicatedAllocation m_DedicatedAllocation;
-
-
- 6575 #if VMA_STATS_STRING_ENABLED
- 6576 uint32_t m_CreationFrameIndex;
- 6577 uint32_t m_BufferImageUsage;
-
-
-
-
- 6582 friend struct VmaDedicatedAllocationListItemTraits;
-
-
- 6585 struct VmaDedicatedAllocationListItemTraits
-
- 6587 typedef VmaAllocation_T ItemType;
- 6588 static ItemType* GetPrev(
const ItemType* item)
-
- 6590 VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
- 6591 return item->m_DedicatedAllocation.m_Prev;
-
- 6593 static ItemType* GetNext(
const ItemType* item)
-
- 6595 VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
- 6596 return item->m_DedicatedAllocation.m_Next;
-
- 6598 static ItemType*& AccessPrev(ItemType* item)
-
- 6600 VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
- 6601 return item->m_DedicatedAllocation.m_Prev;
-
- 6603 static ItemType*& AccessNext(ItemType* item){
- 6604 VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
- 6605 return item->m_DedicatedAllocation.m_Next;
-
-
-
-
-
-
-
- 6613 struct VmaSuballocation
-
- 6615 VkDeviceSize offset;
-
-
- 6618 VmaSuballocationType type;
-
-
-
- 6622 struct VmaSuballocationOffsetLess
-
- 6624 bool operator()(
const VmaSuballocation& lhs,
const VmaSuballocation& rhs)
const
-
- 6626 return lhs.offset < rhs.offset;
-
-
- 6629 struct VmaSuballocationOffsetGreater
-
- 6631 bool operator()(
const VmaSuballocation& lhs,
const VmaSuballocation& rhs)
const
-
- 6633 return lhs.offset > rhs.offset;
-
-
-
- 6637 typedef VmaList< VmaSuballocation, VmaStlAllocator<VmaSuballocation> > VmaSuballocationList;
-
-
- 6640 static const VkDeviceSize VMA_LOST_ALLOCATION_COST = 1048576;
-
- 6642 enum class VmaAllocationRequestType
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 6664 struct VmaAllocationRequest
-
- 6666 VkDeviceSize offset;
- 6667 VkDeviceSize sumFreeSize;
- 6668 VkDeviceSize sumItemSize;
- 6669 VmaSuballocationList::iterator item;
- 6670 size_t itemsToMakeLostCount;
-
- 6672 VmaAllocationRequestType type;
-
- 6674 VkDeviceSize CalcCost()
const
-
- 6676 return sumItemSize + itemsToMakeLostCount * VMA_LOST_ALLOCATION_COST;
-
-
-
-
-
-
-
- 6684 class VmaBlockMetadata
-
-
-
- 6688 virtual ~VmaBlockMetadata() { }
- 6689 virtual void Init(VkDeviceSize size) { m_Size = size; }
+ 6492 VkDeviceSize GetOffset()
const;
+ 6493 VkDeviceMemory GetMemory()
const;
+ 6494 uint32_t GetMemoryTypeIndex()
const {
return m_MemoryTypeIndex; }
+ 6495 bool IsPersistentMap()
const {
return (m_MapCount & MAP_COUNT_FLAG_PERSISTENT_MAP) != 0; }
+ 6496 void* GetMappedData()
const;
+ 6497 bool CanBecomeLost()
const;
+
+ 6499 uint32_t GetLastUseFrameIndex()
const
+
+ 6501 return m_LastUseFrameIndex.load();
+
+ 6503 bool CompareExchangeLastUseFrameIndex(uint32_t& expected, uint32_t desired)
+
+ 6505 return m_LastUseFrameIndex.compare_exchange_weak(expected, desired);
+
+
+
+
+
+
+
+
+
+ 6515 bool MakeLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
+
+ 6517 void DedicatedAllocCalcStatsInfo(
VmaStatInfo& outInfo)
+
+ 6519 VMA_ASSERT(m_Type == ALLOCATION_TYPE_DEDICATED);
+
+
+
+
+
+
+
+
+
+
+ 6530 void BlockAllocMap();
+ 6531 void BlockAllocUnmap();
+ 6532 VkResult DedicatedAllocMap(
VmaAllocator hAllocator,
void** ppData);
+
+
+ 6535 #if VMA_STATS_STRING_ENABLED
+ 6536 uint32_t GetCreationFrameIndex()
const {
return m_CreationFrameIndex; }
+ 6537 uint32_t GetBufferImageUsage()
const {
return m_BufferImageUsage; }
+
+ 6539 void InitBufferImageUsage(uint32_t bufferImageUsage)
+
+ 6541 VMA_ASSERT(m_BufferImageUsage == 0);
+ 6542 m_BufferImageUsage = bufferImageUsage;
+
+
+ 6545 void PrintParameters(
class VmaJsonWriter& json)
const;
+
+
+
+ 6549 VkDeviceSize m_Alignment;
+ 6550 VkDeviceSize m_Size;
+
+ 6552 VMA_ATOMIC_UINT32 m_LastUseFrameIndex;
+ 6553 uint32_t m_MemoryTypeIndex;
+
+ 6555 uint8_t m_SuballocationType;
+
+
+
+
+
+
+ 6562 struct BlockAllocation
+
+ 6564 VmaDeviceMemoryBlock* m_Block;
+ 6565 VkDeviceSize m_Offset;
+ 6566 bool m_CanBecomeLost;
+
+
+
+ 6570 struct DedicatedAllocation
+
+ 6572 VkDeviceMemory m_hMemory;
+ 6573 void* m_pMappedData;
+ 6574 VmaAllocation_T* m_Prev;
+ 6575 VmaAllocation_T* m_Next;
+
+
+
+
+
+ 6581 BlockAllocation m_BlockAllocation;
+
+ 6583 DedicatedAllocation m_DedicatedAllocation;
+
+
+ 6586 #if VMA_STATS_STRING_ENABLED
+ 6587 uint32_t m_CreationFrameIndex;
+ 6588 uint32_t m_BufferImageUsage;
+
+
+
+
+ 6593 friend struct VmaDedicatedAllocationListItemTraits;
+
+
+ 6596 struct VmaDedicatedAllocationListItemTraits
+
+ 6598 typedef VmaAllocation_T ItemType;
+ 6599 static ItemType* GetPrev(
const ItemType* item)
+
+ 6601 VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
+ 6602 return item->m_DedicatedAllocation.m_Prev;
+
+ 6604 static ItemType* GetNext(
const ItemType* item)
+
+ 6606 VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
+ 6607 return item->m_DedicatedAllocation.m_Next;
+
+ 6609 static ItemType*& AccessPrev(ItemType* item)
+
+ 6611 VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
+ 6612 return item->m_DedicatedAllocation.m_Prev;
+
+ 6614 static ItemType*& AccessNext(ItemType* item){
+ 6615 VMA_HEAVY_ASSERT(item->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
+ 6616 return item->m_DedicatedAllocation.m_Next;
+
+
+
+
+
+
+
+ 6624 struct VmaSuballocation
+
+ 6626 VkDeviceSize offset;
+
+
+ 6629 VmaSuballocationType type;
+
+
+
+ 6633 struct VmaSuballocationOffsetLess
+
+ 6635 bool operator()(
const VmaSuballocation& lhs,
const VmaSuballocation& rhs)
const
+
+ 6637 return lhs.offset < rhs.offset;
+
+
+ 6640 struct VmaSuballocationOffsetGreater
+
+ 6642 bool operator()(
const VmaSuballocation& lhs,
const VmaSuballocation& rhs)
const
+
+ 6644 return lhs.offset > rhs.offset;
+
+
+
+ 6648 typedef VmaList< VmaSuballocation, VmaStlAllocator<VmaSuballocation> > VmaSuballocationList;
+
+
+ 6651 static const VkDeviceSize VMA_LOST_ALLOCATION_COST = 1048576;
+
+ 6653 enum class VmaAllocationRequestType
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 6675 struct VmaAllocationRequest
+
+ 6677 VkDeviceSize offset;
+ 6678 VkDeviceSize sumFreeSize;
+ 6679 VkDeviceSize sumItemSize;
+ 6680 VmaSuballocationList::iterator item;
+ 6681 size_t itemsToMakeLostCount;
+
+ 6683 VmaAllocationRequestType type;
+
+ 6685 VkDeviceSize CalcCost()
const
+
+ 6687 return sumItemSize + itemsToMakeLostCount * VMA_LOST_ALLOCATION_COST;
+
+
-
- 6692 virtual bool Validate()
const = 0;
- 6693 VkDeviceSize GetSize()
const {
return m_Size; }
- 6694 virtual size_t GetAllocationCount()
const = 0;
- 6695 virtual VkDeviceSize GetSumFreeSize()
const = 0;
- 6696 virtual VkDeviceSize GetUnusedRangeSizeMax()
const = 0;
-
- 6698 virtual bool IsEmpty()
const = 0;
-
- 6700 virtual void CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const = 0;
-
- 6702 virtual void AddPoolStats(
VmaPoolStats& inoutStats)
const = 0;
-
- 6704 #if VMA_STATS_STRING_ENABLED
- 6705 virtual void PrintDetailedMap(
class VmaJsonWriter& json)
const = 0;
-
-
-
-
-
- 6711 virtual bool CreateAllocationRequest(
- 6712 uint32_t currentFrameIndex,
- 6713 uint32_t frameInUseCount,
- 6714 VkDeviceSize bufferImageGranularity,
- 6715 VkDeviceSize allocSize,
- 6716 VkDeviceSize allocAlignment,
-
- 6718 VmaSuballocationType allocType,
- 6719 bool canMakeOtherLost,
-
-
- 6722 VmaAllocationRequest* pAllocationRequest) = 0;
-
- 6724 virtual bool MakeRequestedAllocationsLost(
- 6725 uint32_t currentFrameIndex,
- 6726 uint32_t frameInUseCount,
- 6727 VmaAllocationRequest* pAllocationRequest) = 0;
-
- 6729 virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount) = 0;
-
- 6731 virtual VkResult CheckCorruption(
const void* pBlockData) = 0;
-
-
-
- 6735 const VmaAllocationRequest& request,
- 6736 VmaSuballocationType type,
- 6737 VkDeviceSize allocSize,
-
+
+
+
+
+ 6695 class VmaBlockMetadata
+
+
+
+ 6699 virtual ~VmaBlockMetadata() { }
+ 6700 virtual void Init(VkDeviceSize size) { m_Size = size; }
+
+
+ 6703 virtual bool Validate()
const = 0;
+ 6704 VkDeviceSize GetSize()
const {
return m_Size; }
+ 6705 virtual size_t GetAllocationCount()
const = 0;
+ 6706 virtual VkDeviceSize GetSumFreeSize()
const = 0;
+ 6707 virtual VkDeviceSize GetUnusedRangeSizeMax()
const = 0;
+
+ 6709 virtual bool IsEmpty()
const = 0;
+
+ 6711 virtual void CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const = 0;
+
+ 6713 virtual void AddPoolStats(
VmaPoolStats& inoutStats)
const = 0;
+
+ 6715 #if VMA_STATS_STRING_ENABLED
+ 6716 virtual void PrintDetailedMap(
class VmaJsonWriter& json)
const = 0;
+
+
+
+
+
+ 6722 virtual bool CreateAllocationRequest(
+ 6723 uint32_t currentFrameIndex,
+ 6724 uint32_t frameInUseCount,
+ 6725 VkDeviceSize bufferImageGranularity,
+ 6726 VkDeviceSize allocSize,
+ 6727 VkDeviceSize allocAlignment,
+
+ 6729 VmaSuballocationType allocType,
+ 6730 bool canMakeOtherLost,
+
+
+ 6733 VmaAllocationRequest* pAllocationRequest) = 0;
+
+ 6735 virtual bool MakeRequestedAllocationsLost(
+ 6736 uint32_t currentFrameIndex,
+ 6737 uint32_t frameInUseCount,
+ 6738 VmaAllocationRequest* pAllocationRequest) = 0;
-
-
- 6742 virtual void FreeAtOffset(VkDeviceSize offset) = 0;
+ 6740 virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount) = 0;
+
+ 6742 virtual VkResult CheckCorruption(
const void* pBlockData) = 0;
-
- 6745 const VkAllocationCallbacks* GetAllocationCallbacks()
const {
return m_pAllocationCallbacks; }
-
- 6747 #if VMA_STATS_STRING_ENABLED
- 6748 void PrintDetailedMap_Begin(
class VmaJsonWriter& json,
- 6749 VkDeviceSize unusedBytes,
- 6750 size_t allocationCount,
- 6751 size_t unusedRangeCount)
const;
- 6752 void PrintDetailedMap_Allocation(
class VmaJsonWriter& json,
- 6753 VkDeviceSize offset,
-
- 6755 void PrintDetailedMap_UnusedRange(
class VmaJsonWriter& json,
- 6756 VkDeviceSize offset,
- 6757 VkDeviceSize size)
const;
- 6758 void PrintDetailedMap_End(
class VmaJsonWriter& json)
const;
-
-
-
- 6762 VkDeviceSize m_Size;
- 6763 const VkAllocationCallbacks* m_pAllocationCallbacks;
-
-
- 6766 #define VMA_VALIDATE(cond) do { if(!(cond)) { \
- 6767 VMA_ASSERT(0 && "Validation failed: " #cond); \
-
-
-
- 6771 class VmaBlockMetadata_Generic :
public VmaBlockMetadata
-
- 6773 VMA_CLASS_NO_COPY(VmaBlockMetadata_Generic)
-
-
- 6776 virtual ~VmaBlockMetadata_Generic();
- 6777 virtual void Init(VkDeviceSize size);
-
- 6779 virtual bool Validate()
const;
- 6780 virtual size_t GetAllocationCount()
const {
return m_Suballocations.size() - m_FreeCount; }
- 6781 virtual VkDeviceSize GetSumFreeSize()
const {
return m_SumFreeSize; }
- 6782 virtual VkDeviceSize GetUnusedRangeSizeMax()
const;
- 6783 virtual bool IsEmpty()
const;
-
- 6785 virtual void CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const;
- 6786 virtual void AddPoolStats(
VmaPoolStats& inoutStats)
const;
-
- 6788 #if VMA_STATS_STRING_ENABLED
- 6789 virtual void PrintDetailedMap(
class VmaJsonWriter& json)
const;
-
-
- 6792 virtual bool CreateAllocationRequest(
- 6793 uint32_t currentFrameIndex,
- 6794 uint32_t frameInUseCount,
- 6795 VkDeviceSize bufferImageGranularity,
- 6796 VkDeviceSize allocSize,
- 6797 VkDeviceSize allocAlignment,
-
- 6799 VmaSuballocationType allocType,
- 6800 bool canMakeOtherLost,
-
- 6802 VmaAllocationRequest* pAllocationRequest);
-
- 6804 virtual bool MakeRequestedAllocationsLost(
- 6805 uint32_t currentFrameIndex,
- 6806 uint32_t frameInUseCount,
- 6807 VmaAllocationRequest* pAllocationRequest);
-
- 6809 virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
-
- 6811 virtual VkResult CheckCorruption(
const void* pBlockData);
-
-
- 6814 const VmaAllocationRequest& request,
- 6815 VmaSuballocationType type,
- 6816 VkDeviceSize allocSize,
-
-
-
- 6820 virtual void FreeAtOffset(VkDeviceSize offset);
+
+
+ 6746 const VmaAllocationRequest& request,
+ 6747 VmaSuballocationType type,
+ 6748 VkDeviceSize allocSize,
+
+
+
+
+ 6753 virtual void FreeAtOffset(VkDeviceSize offset) = 0;
+
+
+ 6756 const VkAllocationCallbacks* GetAllocationCallbacks()
const {
return m_pAllocationCallbacks; }
+
+ 6758 #if VMA_STATS_STRING_ENABLED
+ 6759 void PrintDetailedMap_Begin(
class VmaJsonWriter& json,
+ 6760 VkDeviceSize unusedBytes,
+ 6761 size_t allocationCount,
+ 6762 size_t unusedRangeCount)
const;
+ 6763 void PrintDetailedMap_Allocation(
class VmaJsonWriter& json,
+ 6764 VkDeviceSize offset,
+
+ 6766 void PrintDetailedMap_UnusedRange(
class VmaJsonWriter& json,
+ 6767 VkDeviceSize offset,
+ 6768 VkDeviceSize size)
const;
+ 6769 void PrintDetailedMap_End(
class VmaJsonWriter& json)
const;
+
+
+
+ 6773 VkDeviceSize m_Size;
+ 6774 const VkAllocationCallbacks* m_pAllocationCallbacks;
+
+
+ 6777 #define VMA_VALIDATE(cond) do { if(!(cond)) { \
+ 6778 VMA_ASSERT(0 && "Validation failed: " #cond); \
+
+
+
+ 6782 class VmaBlockMetadata_Generic :
public VmaBlockMetadata
+
+ 6784 VMA_CLASS_NO_COPY(VmaBlockMetadata_Generic)
+
+
+ 6787 virtual ~VmaBlockMetadata_Generic();
+ 6788 virtual void Init(VkDeviceSize size);
+
+ 6790 virtual bool Validate()
const;
+ 6791 virtual size_t GetAllocationCount()
const {
return m_Suballocations.size() - m_FreeCount; }
+ 6792 virtual VkDeviceSize GetSumFreeSize()
const {
return m_SumFreeSize; }
+ 6793 virtual VkDeviceSize GetUnusedRangeSizeMax()
const;
+ 6794 virtual bool IsEmpty()
const;
+
+ 6796 virtual void CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const;
+ 6797 virtual void AddPoolStats(
VmaPoolStats& inoutStats)
const;
+
+ 6799 #if VMA_STATS_STRING_ENABLED
+ 6800 virtual void PrintDetailedMap(
class VmaJsonWriter& json)
const;
+
+
+ 6803 virtual bool CreateAllocationRequest(
+ 6804 uint32_t currentFrameIndex,
+ 6805 uint32_t frameInUseCount,
+ 6806 VkDeviceSize bufferImageGranularity,
+ 6807 VkDeviceSize allocSize,
+ 6808 VkDeviceSize allocAlignment,
+
+ 6810 VmaSuballocationType allocType,
+ 6811 bool canMakeOtherLost,
+
+ 6813 VmaAllocationRequest* pAllocationRequest);
+
+ 6815 virtual bool MakeRequestedAllocationsLost(
+ 6816 uint32_t currentFrameIndex,
+ 6817 uint32_t frameInUseCount,
+ 6818 VmaAllocationRequest* pAllocationRequest);
+
+ 6820 virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
-
-
- 6825 bool IsBufferImageGranularityConflictPossible(
- 6826 VkDeviceSize bufferImageGranularity,
- 6827 VmaSuballocationType& inOutPrevSuballocType)
const;
-
-
- 6830 friend class VmaDefragmentationAlgorithm_Generic;
- 6831 friend class VmaDefragmentationAlgorithm_Fast;
+ 6822 virtual VkResult CheckCorruption(
const void* pBlockData);
+
+
+ 6825 const VmaAllocationRequest& request,
+ 6826 VmaSuballocationType type,
+ 6827 VkDeviceSize allocSize,
+
+
+
+ 6831 virtual void FreeAtOffset(VkDeviceSize offset);
- 6833 uint32_t m_FreeCount;
- 6834 VkDeviceSize m_SumFreeSize;
- 6835 VmaSuballocationList m_Suballocations;
-
-
- 6838 VmaVector< VmaSuballocationList::iterator, VmaStlAllocator< VmaSuballocationList::iterator > > m_FreeSuballocationsBySize;
+
+
+ 6836 bool IsBufferImageGranularityConflictPossible(
+ 6837 VkDeviceSize bufferImageGranularity,
+ 6838 VmaSuballocationType& inOutPrevSuballocType)
const;
- 6840 bool ValidateFreeSuballocationList()
const;
-
-
-
- 6844 bool CheckAllocation(
- 6845 uint32_t currentFrameIndex,
- 6846 uint32_t frameInUseCount,
- 6847 VkDeviceSize bufferImageGranularity,
- 6848 VkDeviceSize allocSize,
- 6849 VkDeviceSize allocAlignment,
- 6850 VmaSuballocationType allocType,
- 6851 VmaSuballocationList::const_iterator suballocItem,
- 6852 bool canMakeOtherLost,
- 6853 VkDeviceSize* pOffset,
- 6854 size_t* itemsToMakeLostCount,
- 6855 VkDeviceSize* pSumFreeSize,
- 6856 VkDeviceSize* pSumItemSize)
const;
-
- 6858 void MergeFreeWithNext(VmaSuballocationList::iterator item);
-
-
-
- 6862 VmaSuballocationList::iterator FreeSuballocation(VmaSuballocationList::iterator suballocItem);
-
-
- 6865 void RegisterFreeSuballocation(VmaSuballocationList::iterator item);
-
-
- 6868 void UnregisterFreeSuballocation(VmaSuballocationList::iterator item);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 6841 friend class VmaDefragmentationAlgorithm_Generic;
+ 6842 friend class VmaDefragmentationAlgorithm_Fast;
+
+ 6844 uint32_t m_FreeCount;
+ 6845 VkDeviceSize m_SumFreeSize;
+ 6846 VmaSuballocationList m_Suballocations;
+
+
+ 6849 VmaVector< VmaSuballocationList::iterator, VmaStlAllocator< VmaSuballocationList::iterator > > m_FreeSuballocationsBySize;
+
+ 6851 bool ValidateFreeSuballocationList()
const;
+
+
+
+ 6855 bool CheckAllocation(
+ 6856 uint32_t currentFrameIndex,
+ 6857 uint32_t frameInUseCount,
+ 6858 VkDeviceSize bufferImageGranularity,
+ 6859 VkDeviceSize allocSize,
+ 6860 VkDeviceSize allocAlignment,
+ 6861 VmaSuballocationType allocType,
+ 6862 VmaSuballocationList::const_iterator suballocItem,
+ 6863 bool canMakeOtherLost,
+ 6864 VkDeviceSize* pOffset,
+ 6865 size_t* itemsToMakeLostCount,
+ 6866 VkDeviceSize* pSumFreeSize,
+ 6867 VkDeviceSize* pSumItemSize)
const;
+
+ 6869 void MergeFreeWithNext(VmaSuballocationList::iterator item);
+
+
+
+ 6873 VmaSuballocationList::iterator FreeSuballocation(VmaSuballocationList::iterator suballocItem);
+
+
+ 6876 void RegisterFreeSuballocation(VmaSuballocationList::iterator item);
+
+
+ 6879 void UnregisterFreeSuballocation(VmaSuballocationList::iterator item);
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
- 6949 class VmaBlockMetadata_Linear :
public VmaBlockMetadata
-
- 6951 VMA_CLASS_NO_COPY(VmaBlockMetadata_Linear)
-
-
- 6954 virtual ~VmaBlockMetadata_Linear();
- 6955 virtual void Init(VkDeviceSize size);
-
- 6957 virtual bool Validate()
const;
- 6958 virtual size_t GetAllocationCount()
const;
- 6959 virtual VkDeviceSize GetSumFreeSize()
const {
return m_SumFreeSize; }
- 6960 virtual VkDeviceSize GetUnusedRangeSizeMax()
const;
- 6961 virtual bool IsEmpty()
const {
return GetAllocationCount() == 0; }
-
- 6963 virtual void CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const;
- 6964 virtual void AddPoolStats(
VmaPoolStats& inoutStats)
const;
-
- 6966 #if VMA_STATS_STRING_ENABLED
- 6967 virtual void PrintDetailedMap(
class VmaJsonWriter& json)
const;
-
-
- 6970 virtual bool CreateAllocationRequest(
- 6971 uint32_t currentFrameIndex,
- 6972 uint32_t frameInUseCount,
- 6973 VkDeviceSize bufferImageGranularity,
- 6974 VkDeviceSize allocSize,
- 6975 VkDeviceSize allocAlignment,
-
- 6977 VmaSuballocationType allocType,
- 6978 bool canMakeOtherLost,
-
- 6980 VmaAllocationRequest* pAllocationRequest);
-
- 6982 virtual bool MakeRequestedAllocationsLost(
- 6983 uint32_t currentFrameIndex,
- 6984 uint32_t frameInUseCount,
- 6985 VmaAllocationRequest* pAllocationRequest);
-
- 6987 virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
-
- 6989 virtual VkResult CheckCorruption(
const void* pBlockData);
-
-
- 6992 const VmaAllocationRequest& request,
- 6993 VmaSuballocationType type,
- 6994 VkDeviceSize allocSize,
-
-
-
- 6998 virtual void FreeAtOffset(VkDeviceSize offset);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 6960 class VmaBlockMetadata_Linear :
public VmaBlockMetadata
+
+ 6962 VMA_CLASS_NO_COPY(VmaBlockMetadata_Linear)
+
+
+ 6965 virtual ~VmaBlockMetadata_Linear();
+ 6966 virtual void Init(VkDeviceSize size);
+
+ 6968 virtual bool Validate()
const;
+ 6969 virtual size_t GetAllocationCount()
const;
+ 6970 virtual VkDeviceSize GetSumFreeSize()
const {
return m_SumFreeSize; }
+ 6971 virtual VkDeviceSize GetUnusedRangeSizeMax()
const;
+ 6972 virtual bool IsEmpty()
const {
return GetAllocationCount() == 0; }
+
+ 6974 virtual void CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const;
+ 6975 virtual void AddPoolStats(
VmaPoolStats& inoutStats)
const;
+
+ 6977 #if VMA_STATS_STRING_ENABLED
+ 6978 virtual void PrintDetailedMap(
class VmaJsonWriter& json)
const;
+
+
+ 6981 virtual bool CreateAllocationRequest(
+ 6982 uint32_t currentFrameIndex,
+ 6983 uint32_t frameInUseCount,
+ 6984 VkDeviceSize bufferImageGranularity,
+ 6985 VkDeviceSize allocSize,
+ 6986 VkDeviceSize allocAlignment,
+
+ 6988 VmaSuballocationType allocType,
+ 6989 bool canMakeOtherLost,
+
+ 6991 VmaAllocationRequest* pAllocationRequest);
+
+ 6993 virtual bool MakeRequestedAllocationsLost(
+ 6994 uint32_t currentFrameIndex,
+ 6995 uint32_t frameInUseCount,
+ 6996 VmaAllocationRequest* pAllocationRequest);
+
+ 6998 virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
-
-
-
-
-
-
-
-
- 7008 typedef VmaVector< VmaSuballocation, VmaStlAllocator<VmaSuballocation> > SuballocationVectorType;
-
- 7010 enum SECOND_VECTOR_MODE
-
- 7012 SECOND_VECTOR_EMPTY,
-
-
-
-
- 7017 SECOND_VECTOR_RING_BUFFER,
-
-
-
-
-
- 7023 SECOND_VECTOR_DOUBLE_STACK,
-
-
- 7026 VkDeviceSize m_SumFreeSize;
- 7027 SuballocationVectorType m_Suballocations0, m_Suballocations1;
- 7028 uint32_t m_1stVectorIndex;
- 7029 SECOND_VECTOR_MODE m_2ndVectorMode;
-
- 7031 SuballocationVectorType& AccessSuballocations1st() {
return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; }
- 7032 SuballocationVectorType& AccessSuballocations2nd() {
return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; }
- 7033 const SuballocationVectorType& AccessSuballocations1st()
const {
return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; }
- 7034 const SuballocationVectorType& AccessSuballocations2nd()
const {
return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; }
-
-
- 7037 size_t m_1stNullItemsBeginCount;
-
- 7039 size_t m_1stNullItemsMiddleCount;
-
- 7041 size_t m_2ndNullItemsCount;
-
- 7043 bool ShouldCompact1st()
const;
- 7044 void CleanupAfterFree();
-
- 7046 bool CreateAllocationRequest_LowerAddress(
- 7047 uint32_t currentFrameIndex,
- 7048 uint32_t frameInUseCount,
- 7049 VkDeviceSize bufferImageGranularity,
- 7050 VkDeviceSize allocSize,
- 7051 VkDeviceSize allocAlignment,
- 7052 VmaSuballocationType allocType,
- 7053 bool canMakeOtherLost,
-
- 7055 VmaAllocationRequest* pAllocationRequest);
- 7056 bool CreateAllocationRequest_UpperAddress(
- 7057 uint32_t currentFrameIndex,
- 7058 uint32_t frameInUseCount,
- 7059 VkDeviceSize bufferImageGranularity,
- 7060 VkDeviceSize allocSize,
- 7061 VkDeviceSize allocAlignment,
- 7062 VmaSuballocationType allocType,
- 7063 bool canMakeOtherLost,
-
- 7065 VmaAllocationRequest* pAllocationRequest);
-
-
-
-
-
-
-
-
-
-
-
-
-
- 7079 class VmaBlockMetadata_Buddy :
public VmaBlockMetadata
-
- 7081 VMA_CLASS_NO_COPY(VmaBlockMetadata_Buddy)
-
-
- 7084 virtual ~VmaBlockMetadata_Buddy();
- 7085 virtual void Init(VkDeviceSize size);
-
- 7087 virtual bool Validate()
const;
- 7088 virtual size_t GetAllocationCount()
const {
return m_AllocationCount; }
- 7089 virtual VkDeviceSize GetSumFreeSize()
const {
return m_SumFreeSize + GetUnusableSize(); }
- 7090 virtual VkDeviceSize GetUnusedRangeSizeMax()
const;
- 7091 virtual bool IsEmpty()
const {
return m_Root->type == Node::TYPE_FREE; }
-
- 7093 virtual void CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const;
- 7094 virtual void AddPoolStats(
VmaPoolStats& inoutStats)
const;
-
- 7096 #if VMA_STATS_STRING_ENABLED
- 7097 virtual void PrintDetailedMap(
class VmaJsonWriter& json)
const;
-
-
- 7100 virtual bool CreateAllocationRequest(
- 7101 uint32_t currentFrameIndex,
- 7102 uint32_t frameInUseCount,
- 7103 VkDeviceSize bufferImageGranularity,
- 7104 VkDeviceSize allocSize,
- 7105 VkDeviceSize allocAlignment,
-
- 7107 VmaSuballocationType allocType,
- 7108 bool canMakeOtherLost,
-
- 7110 VmaAllocationRequest* pAllocationRequest);
-
- 7112 virtual bool MakeRequestedAllocationsLost(
- 7113 uint32_t currentFrameIndex,
- 7114 uint32_t frameInUseCount,
- 7115 VmaAllocationRequest* pAllocationRequest);
-
- 7117 virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
-
- 7119 virtual VkResult CheckCorruption(
const void* pBlockData) {
return VK_ERROR_FEATURE_NOT_PRESENT; }
-
-
- 7122 const VmaAllocationRequest& request,
- 7123 VmaSuballocationType type,
- 7124 VkDeviceSize allocSize,
-
-
- 7127 virtual void Free(
const VmaAllocation allocation) { FreeAtOffset(allocation, allocation->GetOffset()); }
- 7128 virtual void FreeAtOffset(VkDeviceSize offset) { FreeAtOffset(VMA_NULL, offset); }
+ 7000 virtual VkResult CheckCorruption(
const void* pBlockData);
+
+
+ 7003 const VmaAllocationRequest& request,
+ 7004 VmaSuballocationType type,
+ 7005 VkDeviceSize allocSize,
+
+
+
+ 7009 virtual void FreeAtOffset(VkDeviceSize offset);
+
+
+
+
+
+
+
+
+
+ 7019 typedef VmaVector< VmaSuballocation, VmaStlAllocator<VmaSuballocation> > SuballocationVectorType;
+
+ 7021 enum SECOND_VECTOR_MODE
+
+ 7023 SECOND_VECTOR_EMPTY,
+
+
+
+
+ 7028 SECOND_VECTOR_RING_BUFFER,
+
+
+
+
+
+ 7034 SECOND_VECTOR_DOUBLE_STACK,
+
+
+ 7037 VkDeviceSize m_SumFreeSize;
+ 7038 SuballocationVectorType m_Suballocations0, m_Suballocations1;
+ 7039 uint32_t m_1stVectorIndex;
+ 7040 SECOND_VECTOR_MODE m_2ndVectorMode;
+
+ 7042 SuballocationVectorType& AccessSuballocations1st() {
return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; }
+ 7043 SuballocationVectorType& AccessSuballocations2nd() {
return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; }
+ 7044 const SuballocationVectorType& AccessSuballocations1st()
const {
return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; }
+ 7045 const SuballocationVectorType& AccessSuballocations2nd()
const {
return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; }
+
+
+ 7048 size_t m_1stNullItemsBeginCount;
+
+ 7050 size_t m_1stNullItemsMiddleCount;
+
+ 7052 size_t m_2ndNullItemsCount;
+
+ 7054 bool ShouldCompact1st()
const;
+ 7055 void CleanupAfterFree();
+
+ 7057 bool CreateAllocationRequest_LowerAddress(
+ 7058 uint32_t currentFrameIndex,
+ 7059 uint32_t frameInUseCount,
+ 7060 VkDeviceSize bufferImageGranularity,
+ 7061 VkDeviceSize allocSize,
+ 7062 VkDeviceSize allocAlignment,
+ 7063 VmaSuballocationType allocType,
+ 7064 bool canMakeOtherLost,
+
+ 7066 VmaAllocationRequest* pAllocationRequest);
+ 7067 bool CreateAllocationRequest_UpperAddress(
+ 7068 uint32_t currentFrameIndex,
+ 7069 uint32_t frameInUseCount,
+ 7070 VkDeviceSize bufferImageGranularity,
+ 7071 VkDeviceSize allocSize,
+ 7072 VkDeviceSize allocAlignment,
+ 7073 VmaSuballocationType allocType,
+ 7074 bool canMakeOtherLost,
+
+ 7076 VmaAllocationRequest* pAllocationRequest);
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 7090 class VmaBlockMetadata_Buddy :
public VmaBlockMetadata
+
+ 7092 VMA_CLASS_NO_COPY(VmaBlockMetadata_Buddy)
+
+
+ 7095 virtual ~VmaBlockMetadata_Buddy();
+ 7096 virtual void Init(VkDeviceSize size);
+
+ 7098 virtual bool Validate()
const;
+ 7099 virtual size_t GetAllocationCount()
const {
return m_AllocationCount; }
+ 7100 virtual VkDeviceSize GetSumFreeSize()
const {
return m_SumFreeSize + GetUnusableSize(); }
+ 7101 virtual VkDeviceSize GetUnusedRangeSizeMax()
const;
+ 7102 virtual bool IsEmpty()
const {
return m_Root->type == Node::TYPE_FREE; }
+
+ 7104 virtual void CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const;
+ 7105 virtual void AddPoolStats(
VmaPoolStats& inoutStats)
const;
+
+ 7107 #if VMA_STATS_STRING_ENABLED
+ 7108 virtual void PrintDetailedMap(
class VmaJsonWriter& json)
const;
+
+
+ 7111 virtual bool CreateAllocationRequest(
+ 7112 uint32_t currentFrameIndex,
+ 7113 uint32_t frameInUseCount,
+ 7114 VkDeviceSize bufferImageGranularity,
+ 7115 VkDeviceSize allocSize,
+ 7116 VkDeviceSize allocAlignment,
+
+ 7118 VmaSuballocationType allocType,
+ 7119 bool canMakeOtherLost,
+
+ 7121 VmaAllocationRequest* pAllocationRequest);
+
+ 7123 virtual bool MakeRequestedAllocationsLost(
+ 7124 uint32_t currentFrameIndex,
+ 7125 uint32_t frameInUseCount,
+ 7126 VmaAllocationRequest* pAllocationRequest);
+
+ 7128 virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
-
- 7131 static const VkDeviceSize MIN_NODE_SIZE = 32;
- 7132 static const size_t MAX_LEVELS = 30;
-
- 7134 struct ValidationContext
-
- 7136 size_t calculatedAllocationCount;
- 7137 size_t calculatedFreeCount;
- 7138 VkDeviceSize calculatedSumFreeSize;
-
- 7140 ValidationContext() :
- 7141 calculatedAllocationCount(0),
- 7142 calculatedFreeCount(0),
- 7143 calculatedSumFreeSize(0) { }
-
-
-
-
- 7148 VkDeviceSize offset;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 7178 VkDeviceSize m_UsableSize;
- 7179 uint32_t m_LevelCount;
-
-
-
-
-
- 7185 } m_FreeList[MAX_LEVELS];
-
- 7187 size_t m_AllocationCount;
-
-
-
- 7191 VkDeviceSize m_SumFreeSize;
-
- 7193 VkDeviceSize GetUnusableSize()
const {
return GetSize() - m_UsableSize; }
- 7194 void DeleteNode(Node* node);
- 7195 bool ValidateNode(ValidationContext& ctx,
const Node* parent,
const Node* curr, uint32_t level, VkDeviceSize levelNodeSize)
const;
- 7196 uint32_t AllocSizeToLevel(VkDeviceSize allocSize)
const;
- 7197 inline VkDeviceSize LevelToNodeSize(uint32_t level)
const {
return m_UsableSize >> level; }
-
- 7199 void FreeAtOffset(
VmaAllocation alloc, VkDeviceSize offset);
- 7200 void CalcAllocationStatInfoNode(
VmaStatInfo& outInfo,
const Node* node, VkDeviceSize levelNodeSize)
const;
-
-
-
- 7204 void AddToFreeListFront(uint32_t level, Node* node);
-
-
-
- 7208 void RemoveFromFreeList(uint32_t level, Node* node);
-
- 7210 #if VMA_STATS_STRING_ENABLED
- 7211 void PrintDetailedMapNode(
class VmaJsonWriter& json,
const Node* node, VkDeviceSize levelNodeSize)
const;
-
-
-
-
-
-
-
-
-
- 7221 class VmaDeviceMemoryBlock
-
- 7223 VMA_CLASS_NO_COPY(VmaDeviceMemoryBlock)
-
- 7225 VmaBlockMetadata* m_pMetadata;
-
-
-
- 7229 ~VmaDeviceMemoryBlock()
-
- 7231 VMA_ASSERT(m_MapCount == 0 &&
"VkDeviceMemory block is being destroyed while it is still mapped.");
- 7232 VMA_ASSERT(m_hMemory == VK_NULL_HANDLE);
-
-
-
-
-
-
- 7239 uint32_t newMemoryTypeIndex,
- 7240 VkDeviceMemory newMemory,
- 7241 VkDeviceSize newSize,
-
- 7243 uint32_t algorithm);
-
-
-
- 7247 VmaPool GetParentPool()
const {
return m_hParentPool; }
- 7248 VkDeviceMemory GetDeviceMemory()
const {
return m_hMemory; }
- 7249 uint32_t GetMemoryTypeIndex()
const {
return m_MemoryTypeIndex; }
- 7250 uint32_t GetId()
const {
return m_Id; }
- 7251 void* GetMappedData()
const {
return m_pMappedData; }
-
-
- 7254 bool Validate()
const;
-
-
+ 7130 virtual VkResult CheckCorruption(
const void* pBlockData) {
return VK_ERROR_FEATURE_NOT_PRESENT; }
+
+
+ 7133 const VmaAllocationRequest& request,
+ 7134 VmaSuballocationType type,
+ 7135 VkDeviceSize allocSize,
+
+
+ 7138 virtual void Free(
const VmaAllocation allocation) { FreeAtOffset(allocation, allocation->GetOffset()); }
+ 7139 virtual void FreeAtOffset(VkDeviceSize offset) { FreeAtOffset(VMA_NULL, offset); }
+
+
+ 7142 static const VkDeviceSize MIN_NODE_SIZE = 32;
+ 7143 static const size_t MAX_LEVELS = 30;
+
+ 7145 struct ValidationContext
+
+ 7147 size_t calculatedAllocationCount;
+ 7148 size_t calculatedFreeCount;
+ 7149 VkDeviceSize calculatedSumFreeSize;
+
+ 7151 ValidationContext() :
+ 7152 calculatedAllocationCount(0),
+ 7153 calculatedFreeCount(0),
+ 7154 calculatedSumFreeSize(0) { }
+
+
+
+
+ 7159 VkDeviceSize offset;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 7189 VkDeviceSize m_UsableSize;
+ 7190 uint32_t m_LevelCount;
+
+
+
+
+
+ 7196 } m_FreeList[MAX_LEVELS];
+
+ 7198 size_t m_AllocationCount;
+
+
+
+ 7202 VkDeviceSize m_SumFreeSize;
+
+ 7204 VkDeviceSize GetUnusableSize()
const {
return GetSize() - m_UsableSize; }
+ 7205 void DeleteNode(Node* node);
+ 7206 bool ValidateNode(ValidationContext& ctx,
const Node* parent,
const Node* curr, uint32_t level, VkDeviceSize levelNodeSize)
const;
+ 7207 uint32_t AllocSizeToLevel(VkDeviceSize allocSize)
const;
+ 7208 inline VkDeviceSize LevelToNodeSize(uint32_t level)
const {
return m_UsableSize >> level; }
+
+ 7210 void FreeAtOffset(
VmaAllocation alloc, VkDeviceSize offset);
+ 7211 void CalcAllocationStatInfoNode(
VmaStatInfo& outInfo,
const Node* node, VkDeviceSize levelNodeSize)
const;
+
+
+
+ 7215 void AddToFreeListFront(uint32_t level, Node* node);
+
+
+
+ 7219 void RemoveFromFreeList(uint32_t level, Node* node);
+
+ 7221 #if VMA_STATS_STRING_ENABLED
+ 7222 void PrintDetailedMapNode(
class VmaJsonWriter& json,
const Node* node, VkDeviceSize levelNodeSize)
const;
+
+
+
+
+
+
+
+
+
+ 7232 class VmaDeviceMemoryBlock
+
+ 7234 VMA_CLASS_NO_COPY(VmaDeviceMemoryBlock)
+
+ 7236 VmaBlockMetadata* m_pMetadata;
+
+
+
+ 7240 ~VmaDeviceMemoryBlock()
+
+ 7242 VMA_ASSERT(m_MapCount == 0 &&
"VkDeviceMemory block is being destroyed while it is still mapped.");
+ 7243 VMA_ASSERT(m_hMemory == VK_NULL_HANDLE);
+
+
+
+
+
+
+ 7250 uint32_t newMemoryTypeIndex,
+ 7251 VkDeviceMemory newMemory,
+ 7252 VkDeviceSize newSize,
+
+ 7254 uint32_t algorithm);
+
+
-
- 7259 VkResult Map(
VmaAllocator hAllocator, uint32_t count,
void** ppData);
-
-
- 7262 VkResult WriteMagicValueAroundAllocation(
VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize);
- 7263 VkResult ValidateMagicValueAroundAllocation(
VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize);
-
- 7265 VkResult BindBufferMemory(
-
-
- 7268 VkDeviceSize allocationLocalOffset,
-
-
- 7271 VkResult BindImageMemory(
-
-
- 7274 VkDeviceSize allocationLocalOffset,
-
-
-
-
-
- 7280 uint32_t m_MemoryTypeIndex;
-
- 7282 VkDeviceMemory m_hMemory;
-
-
-
-
-
-
-
- 7290 uint32_t m_MapCount;
- 7291 void* m_pMappedData;
-
-
- 7294 struct VmaDefragmentationMove
-
- 7296 size_t srcBlockIndex;
- 7297 size_t dstBlockIndex;
- 7298 VkDeviceSize srcOffset;
- 7299 VkDeviceSize dstOffset;
-
-
- 7302 VmaDeviceMemoryBlock* pSrcBlock;
- 7303 VmaDeviceMemoryBlock* pDstBlock;
-
-
- 7306 class VmaDefragmentationAlgorithm;
-
-
-
-
-
-
-
- 7314 struct VmaBlockVector
-
- 7316 VMA_CLASS_NO_COPY(VmaBlockVector)
-
-
-
-
- 7321 uint32_t memoryTypeIndex,
- 7322 VkDeviceSize preferredBlockSize,
- 7323 size_t minBlockCount,
- 7324 size_t maxBlockCount,
- 7325 VkDeviceSize bufferImageGranularity,
- 7326 uint32_t frameInUseCount,
- 7327 bool explicitBlockSize,
-
-
-
-
- 7332 VkResult CreateMinBlocks();
-
- 7334 VmaAllocator GetAllocator()
const {
return m_hAllocator; }
- 7335 VmaPool GetParentPool()
const {
return m_hParentPool; }
- 7336 bool IsCustomPool()
const {
return m_hParentPool != VMA_NULL; }
- 7337 uint32_t GetMemoryTypeIndex()
const {
return m_MemoryTypeIndex; }
- 7338 VkDeviceSize GetPreferredBlockSize()
const {
return m_PreferredBlockSize; }
- 7339 VkDeviceSize GetBufferImageGranularity()
const {
return m_BufferImageGranularity; }
- 7340 uint32_t GetFrameInUseCount()
const {
return m_FrameInUseCount; }
- 7341 uint32_t GetAlgorithm()
const {
return m_Algorithm; }
-
-
-
-
- 7346 bool IsCorruptionDetectionEnabled()
const;
-
-
- 7349 uint32_t currentFrameIndex,
-
- 7351 VkDeviceSize alignment,
-
- 7353 VmaSuballocationType suballocType,
- 7354 size_t allocationCount,
-
+ 7258 VmaPool GetParentPool()
const {
return m_hParentPool; }
+ 7259 VkDeviceMemory GetDeviceMemory()
const {
return m_hMemory; }
+ 7260 uint32_t GetMemoryTypeIndex()
const {
return m_MemoryTypeIndex; }
+ 7261 uint32_t GetId()
const {
return m_Id; }
+ 7262 void* GetMappedData()
const {
return m_pMappedData; }
+
+
+ 7265 bool Validate()
const;
+
+
+
+
+ 7270 VkResult Map(
VmaAllocator hAllocator, uint32_t count,
void** ppData);
+
+
+ 7273 VkResult WriteMagicValueAroundAllocation(
VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize);
+ 7274 VkResult ValidateMagicValueAroundAllocation(
VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize);
+
+ 7276 VkResult BindBufferMemory(
+
+
+ 7279 VkDeviceSize allocationLocalOffset,
+
+
+ 7282 VkResult BindImageMemory(
+
+
+ 7285 VkDeviceSize allocationLocalOffset,
+
+
+
+
+
+ 7291 uint32_t m_MemoryTypeIndex;
+
+ 7293 VkDeviceMemory m_hMemory;
+
+
+
+
+
+
+
+ 7301 uint32_t m_MapCount;
+ 7302 void* m_pMappedData;
+
+
+ 7305 struct VmaDefragmentationMove
+
+ 7307 size_t srcBlockIndex;
+ 7308 size_t dstBlockIndex;
+ 7309 VkDeviceSize srcOffset;
+ 7310 VkDeviceSize dstOffset;
+
+
+ 7313 VmaDeviceMemoryBlock* pSrcBlock;
+ 7314 VmaDeviceMemoryBlock* pDstBlock;
+
+
+ 7317 class VmaDefragmentationAlgorithm;
+
+
+
+
+
+
+
+ 7325 struct VmaBlockVector
+
+ 7327 VMA_CLASS_NO_COPY(VmaBlockVector)
+
+
+
+
+ 7332 uint32_t memoryTypeIndex,
+ 7333 VkDeviceSize preferredBlockSize,
+ 7334 size_t minBlockCount,
+ 7335 size_t maxBlockCount,
+ 7336 VkDeviceSize bufferImageGranularity,
+ 7337 uint32_t frameInUseCount,
+ 7338 bool explicitBlockSize,
+
+
+ 7341 VkDeviceSize minAllocationAlignment);
+
+
+ 7344 VkResult CreateMinBlocks();
+
+ 7346 VmaAllocator GetAllocator()
const {
return m_hAllocator; }
+ 7347 VmaPool GetParentPool()
const {
return m_hParentPool; }
+ 7348 bool IsCustomPool()
const {
return m_hParentPool != VMA_NULL; }
+ 7349 uint32_t GetMemoryTypeIndex()
const {
return m_MemoryTypeIndex; }
+ 7350 VkDeviceSize GetPreferredBlockSize()
const {
return m_PreferredBlockSize; }
+ 7351 VkDeviceSize GetBufferImageGranularity()
const {
return m_BufferImageGranularity; }
+ 7352 uint32_t GetFrameInUseCount()
const {
return m_FrameInUseCount; }
+ 7353 uint32_t GetAlgorithm()
const {
return m_Algorithm; }
+
+
-
-
-
-
-
- 7362 #if VMA_STATS_STRING_ENABLED
- 7363 void PrintDetailedMap(
class VmaJsonWriter& json);
-
-
- 7366 void MakePoolAllocationsLost(
- 7367 uint32_t currentFrameIndex,
- 7368 size_t* pLostAllocationCount);
- 7369 VkResult CheckCorruption();
+
+ 7358 bool IsCorruptionDetectionEnabled()
const;
+
+
+ 7361 uint32_t currentFrameIndex,
+
+ 7363 VkDeviceSize alignment,
+
+ 7365 VmaSuballocationType suballocType,
+ 7366 size_t allocationCount,
+
+
+
-
-
- 7373 class VmaBlockVectorDefragmentationContext* pCtx,
-
- 7375 VkDeviceSize& maxCpuBytesToMove, uint32_t& maxCpuAllocationsToMove,
- 7376 VkDeviceSize& maxGpuBytesToMove, uint32_t& maxGpuAllocationsToMove,
- 7377 VkCommandBuffer commandBuffer);
- 7378 void DefragmentationEnd(
- 7379 class VmaBlockVectorDefragmentationContext* pCtx,
-
-
+
+
+
+ 7374 #if VMA_STATS_STRING_ENABLED
+ 7375 void PrintDetailedMap(
class VmaJsonWriter& json);
+
+
+ 7378 void MakePoolAllocationsLost(
+ 7379 uint32_t currentFrameIndex,
+ 7380 size_t* pLostAllocationCount);
+ 7381 VkResult CheckCorruption();
- 7383 uint32_t ProcessDefragmentations(
- 7384 class VmaBlockVectorDefragmentationContext *pCtx,
-
-
- 7387 void CommitDefragmentations(
- 7388 class VmaBlockVectorDefragmentationContext *pCtx,
-
-
-
-
- 7394 size_t GetBlockCount()
const {
return m_Blocks.size(); }
- 7395 VmaDeviceMemoryBlock* GetBlock(
size_t index)
const {
return m_Blocks[index]; }
- 7396 size_t CalcAllocationCount()
const;
- 7397 bool IsBufferImageGranularityConflictPossible()
const;
+
+
+ 7385 class VmaBlockVectorDefragmentationContext* pCtx,
+
+ 7387 VkDeviceSize& maxCpuBytesToMove, uint32_t& maxCpuAllocationsToMove,
+ 7388 VkDeviceSize& maxGpuBytesToMove, uint32_t& maxGpuAllocationsToMove,
+ 7389 VkCommandBuffer commandBuffer);
+ 7390 void DefragmentationEnd(
+ 7391 class VmaBlockVectorDefragmentationContext* pCtx,
+
+
+
+ 7395 uint32_t ProcessDefragmentations(
+ 7396 class VmaBlockVectorDefragmentationContext *pCtx,
+
-
- 7400 friend class VmaDefragmentationAlgorithm_Generic;
-
-
-
- 7404 const uint32_t m_MemoryTypeIndex;
- 7405 const VkDeviceSize m_PreferredBlockSize;
- 7406 const size_t m_MinBlockCount;
- 7407 const size_t m_MaxBlockCount;
- 7408 const VkDeviceSize m_BufferImageGranularity;
- 7409 const uint32_t m_FrameInUseCount;
- 7410 const bool m_ExplicitBlockSize;
- 7411 const uint32_t m_Algorithm;
- 7412 const float m_Priority;
- 7413 VMA_RW_MUTEX m_Mutex;
-
-
-
- 7417 bool m_HasEmptyBlock;
-
- 7419 VmaVector< VmaDeviceMemoryBlock*, VmaStlAllocator<VmaDeviceMemoryBlock*> > m_Blocks;
- 7420 uint32_t m_NextBlockId;
-
- 7422 VkDeviceSize CalcMaxBlockSize()
const;
-
-
- 7425 void Remove(VmaDeviceMemoryBlock* pBlock);
-
-
-
- 7429 void IncrementallySortBlocks();
-
- 7431 VkResult AllocatePage(
- 7432 uint32_t currentFrameIndex,
-
- 7434 VkDeviceSize alignment,
-
- 7436 VmaSuballocationType suballocType,
-
-
-
- 7440 VkResult AllocateFromBlock(
- 7441 VmaDeviceMemoryBlock* pBlock,
- 7442 uint32_t currentFrameIndex,
-
- 7444 VkDeviceSize alignment,
-
-
- 7447 VmaSuballocationType suballocType,
-
-
-
- 7451 VkResult CreateBlock(VkDeviceSize blockSize,
size_t* pNewBlockIndex);
-
-
- 7454 void ApplyDefragmentationMovesCpu(
- 7455 class VmaBlockVectorDefragmentationContext* pDefragCtx,
- 7456 const VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves);
-
- 7458 void ApplyDefragmentationMovesGpu(
- 7459 class VmaBlockVectorDefragmentationContext* pDefragCtx,
- 7460 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
- 7461 VkCommandBuffer commandBuffer);
-
-
-
-
-
-
-
- 7469 void UpdateHasEmptyBlock();
-
-
-
-
- 7474 VMA_CLASS_NO_COPY(VmaPool_T)
-
- 7476 VmaBlockVector m_BlockVector;
-
-
-
-
- 7481 VkDeviceSize preferredBlockSize);
-
-
- 7484 uint32_t GetId()
const {
return m_Id; }
- 7485 void SetId(uint32_t
id) { VMA_ASSERT(m_Id == 0); m_Id = id; }
-
- 7487 const char* GetName()
const {
return m_Name; }
- 7488 void SetName(
const char* pName);
-
- 7490 #if VMA_STATS_STRING_ENABLED
-
-
-
-
-
-
- 7497 VmaPool_T* m_PrevPool = VMA_NULL;
- 7498 VmaPool_T* m_NextPool = VMA_NULL;
- 7499 friend struct VmaPoolListItemTraits;
-
-
- 7502 struct VmaPoolListItemTraits
-
- 7504 typedef VmaPool_T ItemType;
- 7505 static ItemType* GetPrev(
const ItemType* item) {
return item->m_PrevPool; }
- 7506 static ItemType* GetNext(
const ItemType* item) {
return item->m_NextPool; }
- 7507 static ItemType*& AccessPrev(ItemType* item) {
return item->m_PrevPool; }
- 7508 static ItemType*& AccessNext(ItemType* item) {
return item->m_NextPool; }
-
-
-
-
-
-
-
-
-
- 7518 class VmaDefragmentationAlgorithm
-
- 7520 VMA_CLASS_NO_COPY(VmaDefragmentationAlgorithm)
-
- 7522 VmaDefragmentationAlgorithm(
-
- 7524 VmaBlockVector* pBlockVector,
- 7525 uint32_t currentFrameIndex) :
- 7526 m_hAllocator(hAllocator),
- 7527 m_pBlockVector(pBlockVector),
- 7528 m_CurrentFrameIndex(currentFrameIndex)
-
-
- 7531 virtual ~VmaDefragmentationAlgorithm()
-
-
-
- 7535 virtual void AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged) = 0;
- 7536 virtual void AddAll() = 0;
-
- 7538 virtual VkResult Defragment(
- 7539 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
- 7540 VkDeviceSize maxBytesToMove,
- 7541 uint32_t maxAllocationsToMove,
-
-
- 7544 virtual VkDeviceSize GetBytesMoved()
const = 0;
- 7545 virtual uint32_t GetAllocationsMoved()
const = 0;
-
-
-
- 7549 VmaBlockVector*
const m_pBlockVector;
- 7550 const uint32_t m_CurrentFrameIndex;
-
- 7552 struct AllocationInfo
-
-
- 7555 VkBool32* m_pChanged;
+ 7399 void CommitDefragmentations(
+ 7400 class VmaBlockVectorDefragmentationContext *pCtx,
+
+
+
+
+ 7406 size_t GetBlockCount()
const {
return m_Blocks.size(); }
+ 7407 VmaDeviceMemoryBlock* GetBlock(
size_t index)
const {
return m_Blocks[index]; }
+ 7408 size_t CalcAllocationCount()
const;
+ 7409 bool IsBufferImageGranularityConflictPossible()
const;
+
+
+ 7412 friend class VmaDefragmentationAlgorithm_Generic;
+
+
+
+ 7416 const uint32_t m_MemoryTypeIndex;
+ 7417 const VkDeviceSize m_PreferredBlockSize;
+ 7418 const size_t m_MinBlockCount;
+ 7419 const size_t m_MaxBlockCount;
+ 7420 const VkDeviceSize m_BufferImageGranularity;
+ 7421 const uint32_t m_FrameInUseCount;
+ 7422 const bool m_ExplicitBlockSize;
+ 7423 const uint32_t m_Algorithm;
+ 7424 const float m_Priority;
+ 7425 const VkDeviceSize m_MinAllocationAlignment;
+ 7426 VMA_RW_MUTEX m_Mutex;
+
+
+
+ 7430 bool m_HasEmptyBlock;
+
+ 7432 VmaVector< VmaDeviceMemoryBlock*, VmaStlAllocator<VmaDeviceMemoryBlock*> > m_Blocks;
+ 7433 uint32_t m_NextBlockId;
+
+ 7435 VkDeviceSize CalcMaxBlockSize()
const;
+
+
+ 7438 void Remove(VmaDeviceMemoryBlock* pBlock);
+
+
+
+ 7442 void IncrementallySortBlocks();
+
+ 7444 VkResult AllocatePage(
+ 7445 uint32_t currentFrameIndex,
+
+ 7447 VkDeviceSize alignment,
+
+ 7449 VmaSuballocationType suballocType,
+
+
+
+ 7453 VkResult AllocateFromBlock(
+ 7454 VmaDeviceMemoryBlock* pBlock,
+ 7455 uint32_t currentFrameIndex,
+
+ 7457 VkDeviceSize alignment,
+
+
+ 7460 VmaSuballocationType suballocType,
+
+
+
+ 7464 VkResult CreateBlock(VkDeviceSize blockSize,
size_t* pNewBlockIndex);
+
+
+ 7467 void ApplyDefragmentationMovesCpu(
+ 7468 class VmaBlockVectorDefragmentationContext* pDefragCtx,
+ 7469 const VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves);
+
+ 7471 void ApplyDefragmentationMovesGpu(
+ 7472 class VmaBlockVectorDefragmentationContext* pDefragCtx,
+ 7473 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ 7474 VkCommandBuffer commandBuffer);
+
+
+
+
+
+
+
+ 7482 void UpdateHasEmptyBlock();
+
+
+
+
+ 7487 VMA_CLASS_NO_COPY(VmaPool_T)
+
+ 7489 VmaBlockVector m_BlockVector;
+
+
+
+
+ 7494 VkDeviceSize preferredBlockSize);
+
+
+ 7497 uint32_t GetId()
const {
return m_Id; }
+ 7498 void SetId(uint32_t
id) { VMA_ASSERT(m_Id == 0); m_Id = id; }
+
+ 7500 const char* GetName()
const {
return m_Name; }
+ 7501 void SetName(
const char* pName);
+
+ 7503 #if VMA_STATS_STRING_ENABLED
+
+
+
+
+
+
+ 7510 VmaPool_T* m_PrevPool = VMA_NULL;
+ 7511 VmaPool_T* m_NextPool = VMA_NULL;
+ 7512 friend struct VmaPoolListItemTraits;
+
+
+ 7515 struct VmaPoolListItemTraits
+
+ 7517 typedef VmaPool_T ItemType;
+ 7518 static ItemType* GetPrev(
const ItemType* item) {
return item->m_PrevPool; }
+ 7519 static ItemType* GetNext(
const ItemType* item) {
return item->m_NextPool; }
+ 7520 static ItemType*& AccessPrev(ItemType* item) {
return item->m_PrevPool; }
+ 7521 static ItemType*& AccessNext(ItemType* item) {
return item->m_NextPool; }
+
+
+
+
+
+
+
+
+
+ 7531 class VmaDefragmentationAlgorithm
+
+ 7533 VMA_CLASS_NO_COPY(VmaDefragmentationAlgorithm)
+
+ 7535 VmaDefragmentationAlgorithm(
+
+ 7537 VmaBlockVector* pBlockVector,
+ 7538 uint32_t currentFrameIndex) :
+ 7539 m_hAllocator(hAllocator),
+ 7540 m_pBlockVector(pBlockVector),
+ 7541 m_CurrentFrameIndex(currentFrameIndex)
+
+
+ 7544 virtual ~VmaDefragmentationAlgorithm()
+
+
+
+ 7548 virtual void AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged) = 0;
+ 7549 virtual void AddAll() = 0;
+
+ 7551 virtual VkResult Defragment(
+ 7552 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ 7553 VkDeviceSize maxBytesToMove,
+ 7554 uint32_t maxAllocationsToMove,
+
-
- 7558 m_hAllocation(VK_NULL_HANDLE),
- 7559 m_pChanged(VMA_NULL)
-
-
-
- 7563 m_hAllocation(hAlloc),
- 7564 m_pChanged(pChanged)
-
-
-
-
+ 7557 virtual VkDeviceSize GetBytesMoved()
const = 0;
+ 7558 virtual uint32_t GetAllocationsMoved()
const = 0;
+
+
+
+ 7562 VmaBlockVector*
const m_pBlockVector;
+ 7563 const uint32_t m_CurrentFrameIndex;
+
+ 7565 struct AllocationInfo
+
+
+ 7568 VkBool32* m_pChanged;
- 7570 class VmaDefragmentationAlgorithm_Generic :
public VmaDefragmentationAlgorithm
-
- 7572 VMA_CLASS_NO_COPY(VmaDefragmentationAlgorithm_Generic)
-
- 7574 VmaDefragmentationAlgorithm_Generic(
-
- 7576 VmaBlockVector* pBlockVector,
- 7577 uint32_t currentFrameIndex,
- 7578 bool overlappingMoveSupported);
- 7579 virtual ~VmaDefragmentationAlgorithm_Generic();
-
- 7581 virtual void AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged);
- 7582 virtual void AddAll() { m_AllAllocations =
true; }
-
- 7584 virtual VkResult Defragment(
- 7585 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
- 7586 VkDeviceSize maxBytesToMove,
- 7587 uint32_t maxAllocationsToMove,
-
-
- 7590 virtual VkDeviceSize GetBytesMoved()
const {
return m_BytesMoved; }
- 7591 virtual uint32_t GetAllocationsMoved()
const {
return m_AllocationsMoved; }
-
-
- 7594 uint32_t m_AllocationCount;
- 7595 bool m_AllAllocations;
+
+ 7571 m_hAllocation(VK_NULL_HANDLE),
+ 7572 m_pChanged(VMA_NULL)
+
+
+
+ 7576 m_hAllocation(hAlloc),
+ 7577 m_pChanged(pChanged)
+
+
+
+
+
+ 7583 class VmaDefragmentationAlgorithm_Generic :
public VmaDefragmentationAlgorithm
+
+ 7585 VMA_CLASS_NO_COPY(VmaDefragmentationAlgorithm_Generic)
+
+ 7587 VmaDefragmentationAlgorithm_Generic(
+
+ 7589 VmaBlockVector* pBlockVector,
+ 7590 uint32_t currentFrameIndex,
+ 7591 bool overlappingMoveSupported);
+ 7592 virtual ~VmaDefragmentationAlgorithm_Generic();
+
+ 7594 virtual void AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged);
+ 7595 virtual void AddAll() { m_AllAllocations =
true; }
- 7597 VkDeviceSize m_BytesMoved;
- 7598 uint32_t m_AllocationsMoved;
-
- 7600 struct AllocationInfoSizeGreater
-
- 7602 bool operator()(
const AllocationInfo& lhs,
const AllocationInfo& rhs)
const
-
- 7604 return lhs.m_hAllocation->GetSize() > rhs.m_hAllocation->GetSize();
-
-
-
- 7608 struct AllocationInfoOffsetGreater
-
- 7610 bool operator()(
const AllocationInfo& lhs,
const AllocationInfo& rhs)
const
-
- 7612 return lhs.m_hAllocation->GetOffset() > rhs.m_hAllocation->GetOffset();
-
-
-
-
-
- 7618 size_t m_OriginalBlockIndex;
- 7619 VmaDeviceMemoryBlock* m_pBlock;
- 7620 bool m_HasNonMovableAllocations;
- 7621 VmaVector< AllocationInfo, VmaStlAllocator<AllocationInfo> > m_Allocations;
-
- 7623 BlockInfo(
const VkAllocationCallbacks* pAllocationCallbacks) :
- 7624 m_OriginalBlockIndex(SIZE_MAX),
-
- 7626 m_HasNonMovableAllocations(true),
- 7627 m_Allocations(pAllocationCallbacks)
-
-
-
- 7631 void CalcHasNonMovableAllocations()
-
- 7633 const size_t blockAllocCount = m_pBlock->m_pMetadata->GetAllocationCount();
- 7634 const size_t defragmentAllocCount = m_Allocations.size();
- 7635 m_HasNonMovableAllocations = blockAllocCount != defragmentAllocCount;
-
-
- 7638 void SortAllocationsBySizeDescending()
-
- 7640 VMA_SORT(m_Allocations.begin(), m_Allocations.end(), AllocationInfoSizeGreater());
-
-
- 7643 void SortAllocationsByOffsetDescending()
-
- 7645 VMA_SORT(m_Allocations.begin(), m_Allocations.end(), AllocationInfoOffsetGreater());
-
-
-
- 7649 struct BlockPointerLess
-
- 7651 bool operator()(
const BlockInfo* pLhsBlockInfo,
const VmaDeviceMemoryBlock* pRhsBlock)
const
-
- 7653 return pLhsBlockInfo->m_pBlock < pRhsBlock;
+ 7597 virtual VkResult Defragment(
+ 7598 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ 7599 VkDeviceSize maxBytesToMove,
+ 7600 uint32_t maxAllocationsToMove,
+
+
+ 7603 virtual VkDeviceSize GetBytesMoved()
const {
return m_BytesMoved; }
+ 7604 virtual uint32_t GetAllocationsMoved()
const {
return m_AllocationsMoved; }
+
+
+ 7607 uint32_t m_AllocationCount;
+ 7608 bool m_AllAllocations;
+
+ 7610 VkDeviceSize m_BytesMoved;
+ 7611 uint32_t m_AllocationsMoved;
+
+ 7613 struct AllocationInfoSizeGreater
+
+ 7615 bool operator()(
const AllocationInfo& lhs,
const AllocationInfo& rhs)
const
+
+ 7617 return lhs.m_hAllocation->GetSize() > rhs.m_hAllocation->GetSize();
+
+
+
+ 7621 struct AllocationInfoOffsetGreater
+
+ 7623 bool operator()(
const AllocationInfo& lhs,
const AllocationInfo& rhs)
const
+
+ 7625 return lhs.m_hAllocation->GetOffset() > rhs.m_hAllocation->GetOffset();
+
+
+
+
+
+ 7631 size_t m_OriginalBlockIndex;
+ 7632 VmaDeviceMemoryBlock* m_pBlock;
+ 7633 bool m_HasNonMovableAllocations;
+ 7634 VmaVector< AllocationInfo, VmaStlAllocator<AllocationInfo> > m_Allocations;
+
+ 7636 BlockInfo(
const VkAllocationCallbacks* pAllocationCallbacks) :
+ 7637 m_OriginalBlockIndex(SIZE_MAX),
+
+ 7639 m_HasNonMovableAllocations(true),
+ 7640 m_Allocations(pAllocationCallbacks)
+
+
+
+ 7644 void CalcHasNonMovableAllocations()
+
+ 7646 const size_t blockAllocCount = m_pBlock->m_pMetadata->GetAllocationCount();
+ 7647 const size_t defragmentAllocCount = m_Allocations.size();
+ 7648 m_HasNonMovableAllocations = blockAllocCount != defragmentAllocCount;
+
+
+ 7651 void SortAllocationsBySizeDescending()
+
+ 7653 VMA_SORT(m_Allocations.begin(), m_Allocations.end(), AllocationInfoSizeGreater());
- 7655 bool operator()(
const BlockInfo* pLhsBlockInfo,
const BlockInfo* pRhsBlockInfo)
const
-
- 7657 return pLhsBlockInfo->m_pBlock < pRhsBlockInfo->m_pBlock;
-
-
-
-
-
- 7663 struct BlockInfoCompareMoveDestination
-
- 7665 bool operator()(
const BlockInfo* pLhsBlockInfo,
const BlockInfo* pRhsBlockInfo)
const
-
- 7667 if(pLhsBlockInfo->m_HasNonMovableAllocations && !pRhsBlockInfo->m_HasNonMovableAllocations)
-
-
-
- 7671 if(!pLhsBlockInfo->m_HasNonMovableAllocations && pRhsBlockInfo->m_HasNonMovableAllocations)
-
-
-
- 7675 if(pLhsBlockInfo->m_pBlock->m_pMetadata->GetSumFreeSize() < pRhsBlockInfo->m_pBlock->m_pMetadata->GetSumFreeSize())
-
-
-
-
-
-
-
- 7683 typedef VmaVector< BlockInfo*, VmaStlAllocator<BlockInfo*> > BlockInfoVector;
- 7684 BlockInfoVector m_Blocks;
-
- 7686 VkResult DefragmentRound(
- 7687 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
- 7688 VkDeviceSize maxBytesToMove,
- 7689 uint32_t maxAllocationsToMove,
- 7690 bool freeOldAllocations);
-
- 7692 size_t CalcBlocksWithNonMovableCount()
const;
-
- 7694 static bool MoveMakesSense(
- 7695 size_t dstBlockIndex, VkDeviceSize dstOffset,
- 7696 size_t srcBlockIndex, VkDeviceSize srcOffset);
-
+
+ 7656 void SortAllocationsByOffsetDescending()
+
+ 7658 VMA_SORT(m_Allocations.begin(), m_Allocations.end(), AllocationInfoOffsetGreater());
+
+
+
+ 7662 struct BlockPointerLess
+
+ 7664 bool operator()(
const BlockInfo* pLhsBlockInfo,
const VmaDeviceMemoryBlock* pRhsBlock)
const
+
+ 7666 return pLhsBlockInfo->m_pBlock < pRhsBlock;
+
+ 7668 bool operator()(
const BlockInfo* pLhsBlockInfo,
const BlockInfo* pRhsBlockInfo)
const
+
+ 7670 return pLhsBlockInfo->m_pBlock < pRhsBlockInfo->m_pBlock;
+
+
+
+
+
+ 7676 struct BlockInfoCompareMoveDestination
+
+ 7678 bool operator()(
const BlockInfo* pLhsBlockInfo,
const BlockInfo* pRhsBlockInfo)
const
+
+ 7680 if(pLhsBlockInfo->m_HasNonMovableAllocations && !pRhsBlockInfo->m_HasNonMovableAllocations)
+
+
+
+ 7684 if(!pLhsBlockInfo->m_HasNonMovableAllocations && pRhsBlockInfo->m_HasNonMovableAllocations)
+
+
+
+ 7688 if(pLhsBlockInfo->m_pBlock->m_pMetadata->GetSumFreeSize() < pRhsBlockInfo->m_pBlock->m_pMetadata->GetSumFreeSize())
+
+
+
+
+
+
+
+ 7696 typedef VmaVector< BlockInfo*, VmaStlAllocator<BlockInfo*> > BlockInfoVector;
+ 7697 BlockInfoVector m_Blocks;
- 7699 class VmaDefragmentationAlgorithm_Fast :
public VmaDefragmentationAlgorithm
-
- 7701 VMA_CLASS_NO_COPY(VmaDefragmentationAlgorithm_Fast)
-
- 7703 VmaDefragmentationAlgorithm_Fast(
-
- 7705 VmaBlockVector* pBlockVector,
- 7706 uint32_t currentFrameIndex,
- 7707 bool overlappingMoveSupported);
- 7708 virtual ~VmaDefragmentationAlgorithm_Fast();
-
- 7710 virtual void AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged) { ++m_AllocationCount; }
- 7711 virtual void AddAll() { m_AllAllocations =
true; }
-
- 7713 virtual VkResult Defragment(
- 7714 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
- 7715 VkDeviceSize maxBytesToMove,
- 7716 uint32_t maxAllocationsToMove,
-
-
- 7719 virtual VkDeviceSize GetBytesMoved()
const {
return m_BytesMoved; }
- 7720 virtual uint32_t GetAllocationsMoved()
const {
return m_AllocationsMoved; }
-
-
-
-
- 7725 size_t origBlockIndex;
-
-
- 7728 class FreeSpaceDatabase
-
-
-
-
-
- 7734 s.blockInfoIndex = SIZE_MAX;
- 7735 for(
size_t i = 0; i < MAX_COUNT; ++i)
-
- 7737 m_FreeSpaces[i] = s;
-
-
+ 7699 VkResult DefragmentRound(
+ 7700 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ 7701 VkDeviceSize maxBytesToMove,
+ 7702 uint32_t maxAllocationsToMove,
+ 7703 bool freeOldAllocations);
+
+ 7705 size_t CalcBlocksWithNonMovableCount()
const;
+
+ 7707 static bool MoveMakesSense(
+ 7708 size_t dstBlockIndex, VkDeviceSize dstOffset,
+ 7709 size_t srcBlockIndex, VkDeviceSize srcOffset);
+
+
+ 7712 class VmaDefragmentationAlgorithm_Fast :
public VmaDefragmentationAlgorithm
+
+ 7714 VMA_CLASS_NO_COPY(VmaDefragmentationAlgorithm_Fast)
+
+ 7716 VmaDefragmentationAlgorithm_Fast(
+
+ 7718 VmaBlockVector* pBlockVector,
+ 7719 uint32_t currentFrameIndex,
+ 7720 bool overlappingMoveSupported);
+ 7721 virtual ~VmaDefragmentationAlgorithm_Fast();
+
+ 7723 virtual void AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged) { ++m_AllocationCount; }
+ 7724 virtual void AddAll() { m_AllAllocations =
true; }
+
+ 7726 virtual VkResult Defragment(
+ 7727 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ 7728 VkDeviceSize maxBytesToMove,
+ 7729 uint32_t maxAllocationsToMove,
+
+
+ 7732 virtual VkDeviceSize GetBytesMoved()
const {
return m_BytesMoved; }
+ 7733 virtual uint32_t GetAllocationsMoved()
const {
return m_AllocationsMoved; }
+
+
+
+
+ 7738 size_t origBlockIndex;
+
- 7741 void Register(
size_t blockInfoIndex, VkDeviceSize offset, VkDeviceSize size)
-
- 7743 if(size < VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
-
-
-
-
-
- 7749 size_t bestIndex = SIZE_MAX;
- 7750 for(
size_t i = 0; i < MAX_COUNT; ++i)
-
-
- 7753 if(m_FreeSpaces[i].blockInfoIndex == SIZE_MAX)
-
-
-
-
- 7758 if(m_FreeSpaces[i].size < size &&
- 7759 (bestIndex == SIZE_MAX || m_FreeSpaces[bestIndex].size > m_FreeSpaces[i].size))
-
-
-
-
-
- 7765 if(bestIndex != SIZE_MAX)
-
- 7767 m_FreeSpaces[bestIndex].blockInfoIndex = blockInfoIndex;
- 7768 m_FreeSpaces[bestIndex].offset = offset;
- 7769 m_FreeSpaces[bestIndex].size = size;
-
-
-
- 7773 bool Fetch(VkDeviceSize alignment, VkDeviceSize size,
- 7774 size_t& outBlockInfoIndex, VkDeviceSize& outDstOffset)
-
- 7776 size_t bestIndex = SIZE_MAX;
- 7777 VkDeviceSize bestFreeSpaceAfter = 0;
- 7778 for(
size_t i = 0; i < MAX_COUNT; ++i)
+ 7741 class FreeSpaceDatabase
+
+
+
+
+
+ 7747 s.blockInfoIndex = SIZE_MAX;
+ 7748 for(
size_t i = 0; i < MAX_COUNT; ++i)
+
+ 7750 m_FreeSpaces[i] = s;
+
+
+
+ 7754 void Register(
size_t blockInfoIndex, VkDeviceSize offset, VkDeviceSize size)
+
+ 7756 if(size < VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+
+
+
+
+
+ 7762 size_t bestIndex = SIZE_MAX;
+ 7763 for(
size_t i = 0; i < MAX_COUNT; ++i)
+
+
+ 7766 if(m_FreeSpaces[i].blockInfoIndex == SIZE_MAX)
+
+
+
+
+ 7771 if(m_FreeSpaces[i].size < size &&
+ 7772 (bestIndex == SIZE_MAX || m_FreeSpaces[bestIndex].size > m_FreeSpaces[i].size))
+
+
+
+
+
+ 7778 if(bestIndex != SIZE_MAX)
-
- 7781 if(m_FreeSpaces[i].blockInfoIndex != SIZE_MAX)
-
- 7783 const VkDeviceSize dstOffset = VmaAlignUp(m_FreeSpaces[i].offset, alignment);
-
- 7785 if(dstOffset + size <= m_FreeSpaces[i].offset + m_FreeSpaces[i].size)
-
- 7787 const VkDeviceSize freeSpaceAfter = (m_FreeSpaces[i].offset + m_FreeSpaces[i].size) -
-
- 7789 if(bestIndex == SIZE_MAX || freeSpaceAfter > bestFreeSpaceAfter)
-
-
- 7792 bestFreeSpaceAfter = freeSpaceAfter;
-
-
-
-
-
- 7798 if(bestIndex != SIZE_MAX)
-
- 7800 outBlockInfoIndex = m_FreeSpaces[bestIndex].blockInfoIndex;
- 7801 outDstOffset = VmaAlignUp(m_FreeSpaces[bestIndex].offset, alignment);
-
- 7803 if(bestFreeSpaceAfter >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
-
-
- 7806 const VkDeviceSize alignmentPlusSize = (outDstOffset - m_FreeSpaces[bestIndex].offset) + size;
- 7807 m_FreeSpaces[bestIndex].offset += alignmentPlusSize;
- 7808 m_FreeSpaces[bestIndex].size -= alignmentPlusSize;
-
-
-
-
- 7813 m_FreeSpaces[bestIndex].blockInfoIndex = SIZE_MAX;
-
+ 7780 m_FreeSpaces[bestIndex].blockInfoIndex = blockInfoIndex;
+ 7781 m_FreeSpaces[bestIndex].offset = offset;
+ 7782 m_FreeSpaces[bestIndex].size = size;
+
+
+
+ 7786 bool Fetch(VkDeviceSize alignment, VkDeviceSize size,
+ 7787 size_t& outBlockInfoIndex, VkDeviceSize& outDstOffset)
+
+ 7789 size_t bestIndex = SIZE_MAX;
+ 7790 VkDeviceSize bestFreeSpaceAfter = 0;
+ 7791 for(
size_t i = 0; i < MAX_COUNT; ++i)
+
+
+ 7794 if(m_FreeSpaces[i].blockInfoIndex != SIZE_MAX)
+
+ 7796 const VkDeviceSize dstOffset = VmaAlignUp(m_FreeSpaces[i].offset, alignment);
+
+ 7798 if(dstOffset + size <= m_FreeSpaces[i].offset + m_FreeSpaces[i].size)
+
+ 7800 const VkDeviceSize freeSpaceAfter = (m_FreeSpaces[i].offset + m_FreeSpaces[i].size) -
+
+ 7802 if(bestIndex == SIZE_MAX || freeSpaceAfter > bestFreeSpaceAfter)
+
+
+ 7805 bestFreeSpaceAfter = freeSpaceAfter;
+
+
+
+
+
+ 7811 if(bestIndex != SIZE_MAX)
+
+ 7813 outBlockInfoIndex = m_FreeSpaces[bestIndex].blockInfoIndex;
+ 7814 outDstOffset = VmaAlignUp(m_FreeSpaces[bestIndex].offset, alignment);
-
-
-
-
-
-
-
- 7823 static const size_t MAX_COUNT = 4;
-
-
-
- 7827 size_t blockInfoIndex;
- 7828 VkDeviceSize offset;
-
- 7830 } m_FreeSpaces[MAX_COUNT];
-
-
- 7833 const bool m_OverlappingMoveSupported;
+ 7816 if(bestFreeSpaceAfter >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+
+
+ 7819 const VkDeviceSize alignmentPlusSize = (outDstOffset - m_FreeSpaces[bestIndex].offset) + size;
+ 7820 m_FreeSpaces[bestIndex].offset += alignmentPlusSize;
+ 7821 m_FreeSpaces[bestIndex].size -= alignmentPlusSize;
+
+
+
+
+ 7826 m_FreeSpaces[bestIndex].blockInfoIndex = SIZE_MAX;
+
+
+
+
+
+
+
- 7835 uint32_t m_AllocationCount;
- 7836 bool m_AllAllocations;
+
+ 7836 static const size_t MAX_COUNT = 4;
- 7838 VkDeviceSize m_BytesMoved;
- 7839 uint32_t m_AllocationsMoved;
-
- 7841 VmaVector< BlockInfo, VmaStlAllocator<BlockInfo> > m_BlockInfos;
-
- 7843 void PreprocessMetadata();
- 7844 void PostprocessMetadata();
- 7845 void InsertSuballoc(VmaBlockMetadata_Generic* pMetadata,
const VmaSuballocation& suballoc);
-
+
+
+ 7840 size_t blockInfoIndex;
+ 7841 VkDeviceSize offset;
+
+ 7843 } m_FreeSpaces[MAX_COUNT];
+
+
+ 7846 const bool m_OverlappingMoveSupported;
- 7848 struct VmaBlockDefragmentationContext
-
-
-
- 7852 BLOCK_FLAG_USED = 0x00000001,
-
-
-
-
-
- 7858 class VmaBlockVectorDefragmentationContext
-
- 7860 VMA_CLASS_NO_COPY(VmaBlockVectorDefragmentationContext)
-
-
-
- 7864 VmaVector< VmaBlockDefragmentationContext, VmaStlAllocator<VmaBlockDefragmentationContext> > blockContexts;
- 7865 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> > defragmentationMoves;
- 7866 uint32_t defragmentationMovesProcessed;
- 7867 uint32_t defragmentationMovesCommitted;
- 7868 bool hasDefragmentationPlan;
-
- 7870 VmaBlockVectorDefragmentationContext(
-
-
- 7873 VmaBlockVector* pBlockVector,
- 7874 uint32_t currFrameIndex);
- 7875 ~VmaBlockVectorDefragmentationContext();
-
- 7877 VmaPool GetCustomPool()
const {
return m_hCustomPool; }
- 7878 VmaBlockVector* GetBlockVector()
const {
return m_pBlockVector; }
- 7879 VmaDefragmentationAlgorithm* GetAlgorithm()
const {
return m_pAlgorithm; }
-
- 7881 void AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged);
- 7882 void AddAll() { m_AllAllocations =
true; }
-
-
-
-
-
-
-
-
- 7891 VmaBlockVector*
const m_pBlockVector;
- 7892 const uint32_t m_CurrFrameIndex;
-
- 7894 VmaDefragmentationAlgorithm* m_pAlgorithm;
-
-
-
-
-
-
-
- 7902 VmaVector< AllocInfo, VmaStlAllocator<AllocInfo> > m_Allocations;
- 7903 bool m_AllAllocations;
-
-
- 7906 struct VmaDefragmentationContext_T
-
-
- 7909 VMA_CLASS_NO_COPY(VmaDefragmentationContext_T)
-
- 7911 VmaDefragmentationContext_T(
-
- 7913 uint32_t currFrameIndex,
-
-
- 7916 ~VmaDefragmentationContext_T();
-
- 7918 void AddPools(uint32_t poolCount,
const VmaPool* pPools);
- 7919 void AddAllocations(
- 7920 uint32_t allocationCount,
-
- 7922 VkBool32* pAllocationsChanged);
-
-
-
-
-
-
-
- 7930 VkResult Defragment(
- 7931 VkDeviceSize maxCpuBytesToMove, uint32_t maxCpuAllocationsToMove,
- 7932 VkDeviceSize maxGpuBytesToMove, uint32_t maxGpuAllocationsToMove,
-
-
-
- 7936 VkResult DefragmentPassEnd();
-
-
-
- 7940 const uint32_t m_CurrFrameIndex;
- 7941 const uint32_t m_Flags;
-
-
- 7944 VkDeviceSize m_MaxCpuBytesToMove;
- 7945 uint32_t m_MaxCpuAllocationsToMove;
- 7946 VkDeviceSize m_MaxGpuBytesToMove;
- 7947 uint32_t m_MaxGpuAllocationsToMove;
-
-
- 7950 VmaBlockVectorDefragmentationContext* m_DefaultPoolContexts[VK_MAX_MEMORY_TYPES];
-
- 7952 VmaVector< VmaBlockVectorDefragmentationContext*, VmaStlAllocator<VmaBlockVectorDefragmentationContext*> > m_CustomPoolContexts;
-
-
- 7955 #if VMA_RECORDING_ENABLED
+ 7848 uint32_t m_AllocationCount;
+ 7849 bool m_AllAllocations;
+
+ 7851 VkDeviceSize m_BytesMoved;
+ 7852 uint32_t m_AllocationsMoved;
+
+ 7854 VmaVector< BlockInfo, VmaStlAllocator<BlockInfo> > m_BlockInfos;
+
+ 7856 void PreprocessMetadata();
+ 7857 void PostprocessMetadata();
+ 7858 void InsertSuballoc(VmaBlockMetadata_Generic* pMetadata,
const VmaSuballocation& suballoc);
+
+
+ 7861 struct VmaBlockDefragmentationContext
+
+
+
+ 7865 BLOCK_FLAG_USED = 0x00000001,
+
+
+
+
+
+ 7871 class VmaBlockVectorDefragmentationContext
+
+ 7873 VMA_CLASS_NO_COPY(VmaBlockVectorDefragmentationContext)
+
+
+
+ 7877 VmaVector< VmaBlockDefragmentationContext, VmaStlAllocator<VmaBlockDefragmentationContext> > blockContexts;
+ 7878 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> > defragmentationMoves;
+ 7879 uint32_t defragmentationMovesProcessed;
+ 7880 uint32_t defragmentationMovesCommitted;
+ 7881 bool hasDefragmentationPlan;
+
+ 7883 VmaBlockVectorDefragmentationContext(
+
+
+ 7886 VmaBlockVector* pBlockVector,
+ 7887 uint32_t currFrameIndex);
+ 7888 ~VmaBlockVectorDefragmentationContext();
+
+ 7890 VmaPool GetCustomPool()
const {
return m_hCustomPool; }
+ 7891 VmaBlockVector* GetBlockVector()
const {
return m_pBlockVector; }
+ 7892 VmaDefragmentationAlgorithm* GetAlgorithm()
const {
return m_pAlgorithm; }
+
+ 7894 void AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged);
+ 7895 void AddAll() { m_AllAllocations =
true; }
+
+
+
+
+
+
+
+
+ 7904 VmaBlockVector*
const m_pBlockVector;
+ 7905 const uint32_t m_CurrFrameIndex;
+
+ 7907 VmaDefragmentationAlgorithm* m_pAlgorithm;
+
+
+
+
+
+
+
+ 7915 VmaVector< AllocInfo, VmaStlAllocator<AllocInfo> > m_Allocations;
+ 7916 bool m_AllAllocations;
+
+
+ 7919 struct VmaDefragmentationContext_T
+
+
+ 7922 VMA_CLASS_NO_COPY(VmaDefragmentationContext_T)
+
+ 7924 VmaDefragmentationContext_T(
+
+ 7926 uint32_t currFrameIndex,
+
+
+ 7929 ~VmaDefragmentationContext_T();
+
+ 7931 void AddPools(uint32_t poolCount,
const VmaPool* pPools);
+ 7932 void AddAllocations(
+ 7933 uint32_t allocationCount,
+
+ 7935 VkBool32* pAllocationsChanged);
+
+
+
+
+
+
+
+ 7943 VkResult Defragment(
+ 7944 VkDeviceSize maxCpuBytesToMove, uint32_t maxCpuAllocationsToMove,
+ 7945 VkDeviceSize maxGpuBytesToMove, uint32_t maxGpuAllocationsToMove,
+
+
+
+ 7949 VkResult DefragmentPassEnd();
+
+
+
+ 7953 const uint32_t m_CurrFrameIndex;
+ 7954 const uint32_t m_Flags;
+
-
-
-
-
-
- 7962 void WriteConfiguration(
- 7963 const VkPhysicalDeviceProperties& devProps,
- 7964 const VkPhysicalDeviceMemoryProperties& memProps,
- 7965 uint32_t vulkanApiVersion,
- 7966 bool dedicatedAllocationExtensionEnabled,
- 7967 bool bindMemory2ExtensionEnabled,
- 7968 bool memoryBudgetExtensionEnabled,
- 7969 bool deviceCoherentMemoryExtensionEnabled);
-
-
- 7972 void RecordCreateAllocator(uint32_t frameIndex);
- 7973 void RecordDestroyAllocator(uint32_t frameIndex);
- 7974 void RecordCreatePool(uint32_t frameIndex,
-
-
- 7977 void RecordDestroyPool(uint32_t frameIndex,
VmaPool pool);
- 7978 void RecordAllocateMemory(uint32_t frameIndex,
- 7979 const VkMemoryRequirements& vkMemReq,
-
-
- 7982 void RecordAllocateMemoryPages(uint32_t frameIndex,
- 7983 const VkMemoryRequirements& vkMemReq,
-
- 7985 uint64_t allocationCount,
-
- 7987 void RecordAllocateMemoryForBuffer(uint32_t frameIndex,
- 7988 const VkMemoryRequirements& vkMemReq,
- 7989 bool requiresDedicatedAllocation,
- 7990 bool prefersDedicatedAllocation,
-
-
- 7993 void RecordAllocateMemoryForImage(uint32_t frameIndex,
- 7994 const VkMemoryRequirements& vkMemReq,
- 7995 bool requiresDedicatedAllocation,
- 7996 bool prefersDedicatedAllocation,
+ 7957 VkDeviceSize m_MaxCpuBytesToMove;
+ 7958 uint32_t m_MaxCpuAllocationsToMove;
+ 7959 VkDeviceSize m_MaxGpuBytesToMove;
+ 7960 uint32_t m_MaxGpuAllocationsToMove;
+
+
+ 7963 VmaBlockVectorDefragmentationContext* m_DefaultPoolContexts[VK_MAX_MEMORY_TYPES];
+
+ 7965 VmaVector< VmaBlockVectorDefragmentationContext*, VmaStlAllocator<VmaBlockVectorDefragmentationContext*> > m_CustomPoolContexts;
+
+
+ 7968 #if VMA_RECORDING_ENABLED
+
+
+
+
+
+
+ 7975 void WriteConfiguration(
+ 7976 const VkPhysicalDeviceProperties& devProps,
+ 7977 const VkPhysicalDeviceMemoryProperties& memProps,
+ 7978 uint32_t vulkanApiVersion,
+ 7979 bool dedicatedAllocationExtensionEnabled,
+ 7980 bool bindMemory2ExtensionEnabled,
+ 7981 bool memoryBudgetExtensionEnabled,
+ 7982 bool deviceCoherentMemoryExtensionEnabled);
+
+
+ 7985 void RecordCreateAllocator(uint32_t frameIndex);
+ 7986 void RecordDestroyAllocator(uint32_t frameIndex);
+ 7987 void RecordCreatePool(uint32_t frameIndex,
+
+
+ 7990 void RecordDestroyPool(uint32_t frameIndex,
VmaPool pool);
+ 7991 void RecordAllocateMemory(uint32_t frameIndex,
+ 7992 const VkMemoryRequirements& vkMemReq,
+
+
+ 7995 void RecordAllocateMemoryPages(uint32_t frameIndex,
+ 7996 const VkMemoryRequirements& vkMemReq,
-
- 7999 void RecordFreeMemory(uint32_t frameIndex,
-
- 8001 void RecordFreeMemoryPages(uint32_t frameIndex,
- 8002 uint64_t allocationCount,
-
- 8004 void RecordSetAllocationUserData(uint32_t frameIndex,
-
- 8006 const void* pUserData);
- 8007 void RecordCreateLostAllocation(uint32_t frameIndex,
-
- 8009 void RecordMapMemory(uint32_t frameIndex,
-
- 8011 void RecordUnmapMemory(uint32_t frameIndex,
-
- 8013 void RecordFlushAllocation(uint32_t frameIndex,
- 8014 VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
- 8015 void RecordInvalidateAllocation(uint32_t frameIndex,
- 8016 VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
- 8017 void RecordCreateBuffer(uint32_t frameIndex,
- 8018 const VkBufferCreateInfo& bufCreateInfo,
-
-
- 8021 void RecordCreateImage(uint32_t frameIndex,
- 8022 const VkImageCreateInfo& imageCreateInfo,
-
-
- 8025 void RecordDestroyBuffer(uint32_t frameIndex,
-
- 8027 void RecordDestroyImage(uint32_t frameIndex,
-
- 8029 void RecordTouchAllocation(uint32_t frameIndex,
-
- 8031 void RecordGetAllocationInfo(uint32_t frameIndex,
-
- 8033 void RecordMakePoolAllocationsLost(uint32_t frameIndex,
-
- 8035 void RecordDefragmentationBegin(uint32_t frameIndex,
-
-
- 8038 void RecordDefragmentationEnd(uint32_t frameIndex,
-
- 8040 void RecordSetPoolName(uint32_t frameIndex,
-
-
-
-
-
-
-
-
-
-
- 8051 class UserDataString
-
-
-
- 8055 const char* GetString()
const {
return m_Str; }
+ 7998 uint64_t allocationCount,
+
+ 8000 void RecordAllocateMemoryForBuffer(uint32_t frameIndex,
+ 8001 const VkMemoryRequirements& vkMemReq,
+ 8002 bool requiresDedicatedAllocation,
+ 8003 bool prefersDedicatedAllocation,
+
+
+ 8006 void RecordAllocateMemoryForImage(uint32_t frameIndex,
+ 8007 const VkMemoryRequirements& vkMemReq,
+ 8008 bool requiresDedicatedAllocation,
+ 8009 bool prefersDedicatedAllocation,
+
+
+ 8012 void RecordFreeMemory(uint32_t frameIndex,
+
+ 8014 void RecordFreeMemoryPages(uint32_t frameIndex,
+ 8015 uint64_t allocationCount,
+
+ 8017 void RecordSetAllocationUserData(uint32_t frameIndex,
+
+ 8019 const void* pUserData);
+ 8020 void RecordCreateLostAllocation(uint32_t frameIndex,
+
+ 8022 void RecordMapMemory(uint32_t frameIndex,
+
+ 8024 void RecordUnmapMemory(uint32_t frameIndex,
+
+ 8026 void RecordFlushAllocation(uint32_t frameIndex,
+ 8027 VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
+ 8028 void RecordInvalidateAllocation(uint32_t frameIndex,
+ 8029 VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
+ 8030 void RecordCreateBuffer(uint32_t frameIndex,
+ 8031 const VkBufferCreateInfo& bufCreateInfo,
+
+
+ 8034 void RecordCreateImage(uint32_t frameIndex,
+ 8035 const VkImageCreateInfo& imageCreateInfo,
+
+
+ 8038 void RecordDestroyBuffer(uint32_t frameIndex,
+
+ 8040 void RecordDestroyImage(uint32_t frameIndex,
+
+ 8042 void RecordTouchAllocation(uint32_t frameIndex,
+
+ 8044 void RecordGetAllocationInfo(uint32_t frameIndex,
+
+ 8046 void RecordMakePoolAllocationsLost(uint32_t frameIndex,
+
+ 8048 void RecordDefragmentationBegin(uint32_t frameIndex,
+
+
+ 8051 void RecordDefragmentationEnd(uint32_t frameIndex,
+
+ 8053 void RecordSetPoolName(uint32_t frameIndex,
+
+
-
-
-
-
-
-
-
-
- 8065 VMA_MUTEX m_FileMutex;
- 8066 std::chrono::time_point<std::chrono::high_resolution_clock> m_RecordingStartTime;
-
- 8068 void GetBasicParams(CallParams& outParams);
+
+
+
+
+
+
+
+ 8064 class UserDataString
+
+
+
+ 8068 const char* GetString()
const {
return m_Str; }
-
- 8071 template<
typename T>
- 8072 void PrintPointerList(uint64_t count,
const T* pItems)
-
-
-
- 8076 fprintf(m_File,
"%p", pItems[0]);
- 8077 for(uint64_t i = 1; i < count; ++i)
-
- 8079 fprintf(m_File,
" %p", pItems[i]);
-
-
-
-
- 8084 void PrintPointerList(uint64_t count,
const VmaAllocation* pItems);
-
-
-
-
-
-
-
-
- 8093 class VmaAllocationObjectAllocator
-
- 8095 VMA_CLASS_NO_COPY(VmaAllocationObjectAllocator)
-
- 8097 VmaAllocationObjectAllocator(
const VkAllocationCallbacks* pAllocationCallbacks);
-
- 8099 template<
typename... Types>
VmaAllocation Allocate(Types... args);
-
-
-
-
- 8104 VmaPoolAllocator<VmaAllocation_T> m_Allocator;
-
-
- 8107 struct VmaCurrentBudgetData
-
- 8109 VMA_ATOMIC_UINT64 m_BlockBytes[VK_MAX_MEMORY_HEAPS];
- 8110 VMA_ATOMIC_UINT64 m_AllocationBytes[VK_MAX_MEMORY_HEAPS];
+
+
+
+
+
+
+
+
+ 8078 VMA_MUTEX m_FileMutex;
+ 8079 std::chrono::time_point<std::chrono::high_resolution_clock> m_RecordingStartTime;
+
+ 8081 void GetBasicParams(CallParams& outParams);
+
+
+ 8084 template<
typename T>
+ 8085 void PrintPointerList(uint64_t count,
const T* pItems)
+
+
+
+ 8089 fprintf(m_File,
"%p", pItems[0]);
+ 8090 for(uint64_t i = 1; i < count; ++i)
+
+ 8092 fprintf(m_File,
" %p", pItems[i]);
+
+
+
+
+ 8097 void PrintPointerList(uint64_t count,
const VmaAllocation* pItems);
+
+
+
+
+
+
+
+
+ 8106 class VmaAllocationObjectAllocator
+
+ 8108 VMA_CLASS_NO_COPY(VmaAllocationObjectAllocator)
+
+ 8110 VmaAllocationObjectAllocator(
const VkAllocationCallbacks* pAllocationCallbacks);
- 8112 #if VMA_MEMORY_BUDGET
- 8113 VMA_ATOMIC_UINT32 m_OperationsSinceBudgetFetch;
- 8114 VMA_RW_MUTEX m_BudgetMutex;
- 8115 uint64_t m_VulkanUsage[VK_MAX_MEMORY_HEAPS];
- 8116 uint64_t m_VulkanBudget[VK_MAX_MEMORY_HEAPS];
- 8117 uint64_t m_BlockBytesAtBudgetFetch[VK_MAX_MEMORY_HEAPS];
-
+ 8112 template<
typename... Types>
VmaAllocation Allocate(Types... args);
+
+
+
+
+ 8117 VmaPoolAllocator<VmaAllocation_T> m_Allocator;
+
- 8120 VmaCurrentBudgetData()
-
- 8122 for(uint32_t heapIndex = 0; heapIndex < VK_MAX_MEMORY_HEAPS; ++heapIndex)
-
- 8124 m_BlockBytes[heapIndex] = 0;
- 8125 m_AllocationBytes[heapIndex] = 0;
- 8126 #if VMA_MEMORY_BUDGET
- 8127 m_VulkanUsage[heapIndex] = 0;
- 8128 m_VulkanBudget[heapIndex] = 0;
- 8129 m_BlockBytesAtBudgetFetch[heapIndex] = 0;
-
-
+ 8120 struct VmaCurrentBudgetData
+
+ 8122 VMA_ATOMIC_UINT64 m_BlockBytes[VK_MAX_MEMORY_HEAPS];
+ 8123 VMA_ATOMIC_UINT64 m_AllocationBytes[VK_MAX_MEMORY_HEAPS];
+
+ 8125 #if VMA_MEMORY_BUDGET
+ 8126 VMA_ATOMIC_UINT32 m_OperationsSinceBudgetFetch;
+ 8127 VMA_RW_MUTEX m_BudgetMutex;
+ 8128 uint64_t m_VulkanUsage[VK_MAX_MEMORY_HEAPS];
+ 8129 uint64_t m_VulkanBudget[VK_MAX_MEMORY_HEAPS];
+ 8130 uint64_t m_BlockBytesAtBudgetFetch[VK_MAX_MEMORY_HEAPS];
+
- 8133 #if VMA_MEMORY_BUDGET
- 8134 m_OperationsSinceBudgetFetch = 0;
-
-
-
- 8138 void AddAllocation(uint32_t heapIndex, VkDeviceSize allocationSize)
-
- 8140 m_AllocationBytes[heapIndex] += allocationSize;
- 8141 #if VMA_MEMORY_BUDGET
- 8142 ++m_OperationsSinceBudgetFetch;
+ 8133 VmaCurrentBudgetData()
+
+ 8135 for(uint32_t heapIndex = 0; heapIndex < VK_MAX_MEMORY_HEAPS; ++heapIndex)
+
+ 8137 m_BlockBytes[heapIndex] = 0;
+ 8138 m_AllocationBytes[heapIndex] = 0;
+ 8139 #if VMA_MEMORY_BUDGET
+ 8140 m_VulkanUsage[heapIndex] = 0;
+ 8141 m_VulkanBudget[heapIndex] = 0;
+ 8142 m_BlockBytesAtBudgetFetch[heapIndex] = 0;
-
+
- 8146 void RemoveAllocation(uint32_t heapIndex, VkDeviceSize allocationSize)
-
- 8148 VMA_ASSERT(m_AllocationBytes[heapIndex] >= allocationSize);
- 8149 m_AllocationBytes[heapIndex] -= allocationSize;
- 8150 #if VMA_MEMORY_BUDGET
- 8151 ++m_OperationsSinceBudgetFetch;
-
-
-
-
-
- 8157 struct VmaAllocator_T
-
- 8159 VMA_CLASS_NO_COPY(VmaAllocator_T)
-
-
- 8162 uint32_t m_VulkanApiVersion;
- 8163 bool m_UseKhrDedicatedAllocation;
- 8164 bool m_UseKhrBindMemory2;
- 8165 bool m_UseExtMemoryBudget;
- 8166 bool m_UseAmdDeviceCoherentMemory;
- 8167 bool m_UseKhrBufferDeviceAddress;
- 8168 bool m_UseExtMemoryPriority;
-
- 8170 VkInstance m_hInstance;
- 8171 bool m_AllocationCallbacksSpecified;
- 8172 VkAllocationCallbacks m_AllocationCallbacks;
-
- 8174 VmaAllocationObjectAllocator m_AllocationObjectAllocator;
-
-
- 8177 uint32_t m_HeapSizeLimitMask;
-
- 8179 VkPhysicalDeviceProperties m_PhysicalDeviceProperties;
- 8180 VkPhysicalDeviceMemoryProperties m_MemProps;
-
-
- 8183 VmaBlockVector* m_pBlockVectors[VK_MAX_MEMORY_TYPES];
-
- 8185 typedef VmaIntrusiveLinkedList<VmaDedicatedAllocationListItemTraits> DedicatedAllocationLinkedList;
- 8186 DedicatedAllocationLinkedList m_DedicatedAllocations[VK_MAX_MEMORY_TYPES];
- 8187 VMA_RW_MUTEX m_DedicatedAllocationsMutex[VK_MAX_MEMORY_TYPES];
+ 8146 #if VMA_MEMORY_BUDGET
+ 8147 m_OperationsSinceBudgetFetch = 0;
+
+
+
+ 8151 void AddAllocation(uint32_t heapIndex, VkDeviceSize allocationSize)
+
+ 8153 m_AllocationBytes[heapIndex] += allocationSize;
+ 8154 #if VMA_MEMORY_BUDGET
+ 8155 ++m_OperationsSinceBudgetFetch;
+
+
+
+ 8159 void RemoveAllocation(uint32_t heapIndex, VkDeviceSize allocationSize)
+
+ 8161 VMA_ASSERT(m_AllocationBytes[heapIndex] >= allocationSize);
+ 8162 m_AllocationBytes[heapIndex] -= allocationSize;
+ 8163 #if VMA_MEMORY_BUDGET
+ 8164 ++m_OperationsSinceBudgetFetch;
+
+
+
+
+
+ 8170 struct VmaAllocator_T
+
+ 8172 VMA_CLASS_NO_COPY(VmaAllocator_T)
+
+
+ 8175 uint32_t m_VulkanApiVersion;
+ 8176 bool m_UseKhrDedicatedAllocation;
+ 8177 bool m_UseKhrBindMemory2;
+ 8178 bool m_UseExtMemoryBudget;
+ 8179 bool m_UseAmdDeviceCoherentMemory;
+ 8180 bool m_UseKhrBufferDeviceAddress;
+ 8181 bool m_UseExtMemoryPriority;
+
+ 8183 VkInstance m_hInstance;
+ 8184 bool m_AllocationCallbacksSpecified;
+ 8185 VkAllocationCallbacks m_AllocationCallbacks;
+
+ 8187 VmaAllocationObjectAllocator m_AllocationObjectAllocator;
- 8189 VmaCurrentBudgetData m_Budget;
- 8190 VMA_ATOMIC_UINT32 m_DeviceMemoryCount;
+
+ 8190 uint32_t m_HeapSizeLimitMask;
-
-
-
-
- 8196 const VkAllocationCallbacks* GetAllocationCallbacks()
const
-
- 8198 return m_AllocationCallbacksSpecified ? &m_AllocationCallbacks : 0;
-
-
-
- 8202 return m_VulkanFunctions;
-
+ 8192 VkPhysicalDeviceProperties m_PhysicalDeviceProperties;
+ 8193 VkPhysicalDeviceMemoryProperties m_MemProps;
+
+
+ 8196 VmaBlockVector* m_pBlockVectors[VK_MAX_MEMORY_TYPES];
+
+ 8198 typedef VmaIntrusiveLinkedList<VmaDedicatedAllocationListItemTraits> DedicatedAllocationLinkedList;
+ 8199 DedicatedAllocationLinkedList m_DedicatedAllocations[VK_MAX_MEMORY_TYPES];
+ 8200 VMA_RW_MUTEX m_DedicatedAllocationsMutex[VK_MAX_MEMORY_TYPES];
+
+ 8202 VmaCurrentBudgetData m_Budget;
+ 8203 VMA_ATOMIC_UINT32 m_DeviceMemoryCount;
- 8205 VkPhysicalDevice GetPhysicalDevice()
const {
return m_PhysicalDevice; }
-
- 8207 VkDeviceSize GetBufferImageGranularity()
const
-
-
- 8210 static_cast<VkDeviceSize
>(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY),
- 8211 m_PhysicalDeviceProperties.limits.bufferImageGranularity);
+
+
+
+
+ 8209 const VkAllocationCallbacks* GetAllocationCallbacks()
const
+
+ 8211 return m_AllocationCallbacksSpecified ? &m_AllocationCallbacks : 0;
-
- 8214 uint32_t GetMemoryHeapCount()
const {
return m_MemProps.memoryHeapCount; }
- 8215 uint32_t GetMemoryTypeCount()
const {
return m_MemProps.memoryTypeCount; }
-
- 8217 uint32_t MemoryTypeIndexToHeapIndex(uint32_t memTypeIndex)
const
-
- 8219 VMA_ASSERT(memTypeIndex < m_MemProps.memoryTypeCount);
- 8220 return m_MemProps.memoryTypes[memTypeIndex].heapIndex;
-
-
- 8223 bool IsMemoryTypeNonCoherent(uint32_t memTypeIndex)
const
-
- 8225 return (m_MemProps.memoryTypes[memTypeIndex].propertyFlags & (VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) ==
- 8226 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
-
-
- 8229 VkDeviceSize GetMemoryTypeMinAlignment(uint32_t memTypeIndex)
const
-
- 8231 return IsMemoryTypeNonCoherent(memTypeIndex) ?
- 8232 VMA_MAX((VkDeviceSize)VMA_DEBUG_ALIGNMENT, m_PhysicalDeviceProperties.limits.nonCoherentAtomSize) :
- 8233 (VkDeviceSize)VMA_DEBUG_ALIGNMENT;
+
+
+ 8215 return m_VulkanFunctions;
+
+
+ 8218 VkPhysicalDevice GetPhysicalDevice()
const {
return m_PhysicalDevice; }
+
+ 8220 VkDeviceSize GetBufferImageGranularity()
const
+
+
+ 8223 static_cast<VkDeviceSize
>(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY),
+ 8224 m_PhysicalDeviceProperties.limits.bufferImageGranularity);
+
+
+ 8227 uint32_t GetMemoryHeapCount()
const {
return m_MemProps.memoryHeapCount; }
+ 8228 uint32_t GetMemoryTypeCount()
const {
return m_MemProps.memoryTypeCount; }
+
+ 8230 uint32_t MemoryTypeIndexToHeapIndex(uint32_t memTypeIndex)
const
+
+ 8232 VMA_ASSERT(memTypeIndex < m_MemProps.memoryTypeCount);
+ 8233 return m_MemProps.memoryTypes[memTypeIndex].heapIndex;
-
- 8236 bool IsIntegratedGpu()
const
+
+ 8236 bool IsMemoryTypeNonCoherent(uint32_t memTypeIndex)
const
- 8238 return m_PhysicalDeviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
-
-
- 8241 uint32_t GetGlobalMemoryTypeBits()
const {
return m_GlobalMemoryTypeBits; }
-
- 8243 #if VMA_RECORDING_ENABLED
- 8244 VmaRecorder* GetRecorder()
const {
return m_pRecorder; }
-
-
- 8247 void GetBufferMemoryRequirements(
-
- 8249 VkMemoryRequirements& memReq,
- 8250 bool& requiresDedicatedAllocation,
- 8251 bool& prefersDedicatedAllocation)
const;
- 8252 void GetImageMemoryRequirements(
-
- 8254 VkMemoryRequirements& memReq,
- 8255 bool& requiresDedicatedAllocation,
- 8256 bool& prefersDedicatedAllocation)
const;
-
-
- 8259 VkResult AllocateMemory(
- 8260 const VkMemoryRequirements& vkMemReq,
- 8261 bool requiresDedicatedAllocation,
- 8262 bool prefersDedicatedAllocation,
- 8263 VkBuffer dedicatedBuffer,
- 8264 VkBufferUsageFlags dedicatedBufferUsage,
- 8265 VkImage dedicatedImage,
-
- 8267 VmaSuballocationType suballocType,
- 8268 size_t allocationCount,
-
+ 8238 return (m_MemProps.memoryTypes[memTypeIndex].propertyFlags & (VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) ==
+ 8239 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+
+
+ 8242 VkDeviceSize GetMemoryTypeMinAlignment(uint32_t memTypeIndex)
const
+
+ 8244 return IsMemoryTypeNonCoherent(memTypeIndex) ?
+ 8245 VMA_MAX((VkDeviceSize)VMA_MIN_ALIGNMENT, m_PhysicalDeviceProperties.limits.nonCoherentAtomSize) :
+ 8246 (VkDeviceSize)VMA_MIN_ALIGNMENT;
+
+
+ 8249 bool IsIntegratedGpu()
const
+
+ 8251 return m_PhysicalDeviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
+
+
+ 8254 uint32_t GetGlobalMemoryTypeBits()
const {
return m_GlobalMemoryTypeBits; }
+
+ 8256 #if VMA_RECORDING_ENABLED
+ 8257 VmaRecorder* GetRecorder()
const {
return m_pRecorder; }
+
+
+ 8260 void GetBufferMemoryRequirements(
+
+ 8262 VkMemoryRequirements& memReq,
+ 8263 bool& requiresDedicatedAllocation,
+ 8264 bool& prefersDedicatedAllocation)
const;
+ 8265 void GetImageMemoryRequirements(
+
+ 8267 VkMemoryRequirements& memReq,
+ 8268 bool& requiresDedicatedAllocation,
+ 8269 bool& prefersDedicatedAllocation)
const;
-
-
- 8273 size_t allocationCount,
-
-
- 8276 void CalculateStats(
VmaStats* pStats);
-
-
- 8279 VmaBudget* outBudget, uint32_t firstHeap, uint32_t heapCount);
-
- 8281 #if VMA_STATS_STRING_ENABLED
- 8282 void PrintDetailedMap(
class VmaJsonWriter& json);
-
-
- 8285 VkResult DefragmentationBegin(
-
-
-
- 8289 VkResult DefragmentationEnd(
-
-
- 8292 VkResult DefragmentationPassBegin(
-
-
- 8295 VkResult DefragmentationPassEnd(
-
+
+ 8272 VkResult AllocateMemory(
+ 8273 const VkMemoryRequirements& vkMemReq,
+ 8274 bool requiresDedicatedAllocation,
+ 8275 bool prefersDedicatedAllocation,
+ 8276 VkBuffer dedicatedBuffer,
+ 8277 VkBufferUsageFlags dedicatedBufferUsage,
+ 8278 VkImage dedicatedImage,
+
+ 8280 VmaSuballocationType suballocType,
+ 8281 size_t allocationCount,
+
+
+
+
+ 8286 size_t allocationCount,
+
+
+ 8289 void CalculateStats(
VmaStats* pStats);
+
+
+ 8292 VmaBudget* outBudget, uint32_t firstHeap, uint32_t heapCount);
+
+ 8294 #if VMA_STATS_STRING_ENABLED
+ 8295 void PrintDetailedMap(
class VmaJsonWriter& json);
+
-
-
-
-
- 8302 void DestroyPool(
VmaPool pool);
-
+ 8298 VkResult DefragmentationBegin(
+
+
+
+ 8302 VkResult DefragmentationEnd(
+
- 8305 void SetCurrentFrameIndex(uint32_t frameIndex);
- 8306 uint32_t GetCurrentFrameIndex()
const {
return m_CurrentFrameIndex.load(); }
-
- 8308 void MakePoolAllocationsLost(
-
- 8310 size_t* pLostAllocationCount);
- 8311 VkResult CheckPoolCorruption(
VmaPool hPool);
- 8312 VkResult CheckCorruption(uint32_t memoryTypeBits);
+ 8305 VkResult DefragmentationPassBegin(
+
+
+ 8308 VkResult DefragmentationPassEnd(
+
+
+
+
-
-
-
- 8317 VkResult AllocateVulkanMemory(
const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory);
-
- 8319 void FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory);
-
- 8321 VkResult BindVulkanBuffer(
- 8322 VkDeviceMemory memory,
- 8323 VkDeviceSize memoryOffset,
-
-
-
- 8327 VkResult BindVulkanImage(
- 8328 VkDeviceMemory memory,
- 8329 VkDeviceSize memoryOffset,
-
-
-
-
-
-
- 8336 VkResult BindBufferMemory(
-
- 8338 VkDeviceSize allocationLocalOffset,
-
-
- 8341 VkResult BindImageMemory(
-
- 8343 VkDeviceSize allocationLocalOffset,
-
-
-
- 8347 VkResult FlushOrInvalidateAllocation(
-
- 8349 VkDeviceSize offset, VkDeviceSize size,
- 8350 VMA_CACHE_OPERATION op);
- 8351 VkResult FlushOrInvalidateAllocations(
- 8352 uint32_t allocationCount,
-
- 8354 const VkDeviceSize* offsets,
const VkDeviceSize* sizes,
- 8355 VMA_CACHE_OPERATION op);
-
- 8357 void FillAllocation(
const VmaAllocation hAllocation, uint8_t pattern);
-
-
-
-
-
- 8363 uint32_t GetGpuDefragmentationMemoryTypeBits();
-
-
- 8366 VkDeviceSize m_PreferredLargeHeapBlockSize;
-
- 8368 VkPhysicalDevice m_PhysicalDevice;
- 8369 VMA_ATOMIC_UINT32 m_CurrentFrameIndex;
- 8370 VMA_ATOMIC_UINT32 m_GpuDefragmentationMemoryTypeBits;
+
+ 8315 void DestroyPool(
VmaPool pool);
+
+
+ 8318 void SetCurrentFrameIndex(uint32_t frameIndex);
+ 8319 uint32_t GetCurrentFrameIndex()
const {
return m_CurrentFrameIndex.load(); }
+
+ 8321 void MakePoolAllocationsLost(
+
+ 8323 size_t* pLostAllocationCount);
+ 8324 VkResult CheckPoolCorruption(
VmaPool hPool);
+ 8325 VkResult CheckCorruption(uint32_t memoryTypeBits);
+
+
+
+
+ 8330 VkResult AllocateVulkanMemory(
const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory);
+
+ 8332 void FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory);
+
+ 8334 VkResult BindVulkanBuffer(
+ 8335 VkDeviceMemory memory,
+ 8336 VkDeviceSize memoryOffset,
+
+
+
+ 8340 VkResult BindVulkanImage(
+ 8341 VkDeviceMemory memory,
+ 8342 VkDeviceSize memoryOffset,
+
+
+
+
+
+
+ 8349 VkResult BindBufferMemory(
+
+ 8351 VkDeviceSize allocationLocalOffset,
+
+
+ 8354 VkResult BindImageMemory(
+
+ 8356 VkDeviceSize allocationLocalOffset,
+
+
+
+ 8360 VkResult FlushOrInvalidateAllocation(
+
+ 8362 VkDeviceSize offset, VkDeviceSize size,
+ 8363 VMA_CACHE_OPERATION op);
+ 8364 VkResult FlushOrInvalidateAllocations(
+ 8365 uint32_t allocationCount,
+
+ 8367 const VkDeviceSize* offsets,
const VkDeviceSize* sizes,
+ 8368 VMA_CACHE_OPERATION op);
+
+ 8370 void FillAllocation(
const VmaAllocation hAllocation, uint8_t pattern);
- 8372 VMA_RW_MUTEX m_PoolsMutex;
- 8373 typedef VmaIntrusiveLinkedList<VmaPoolListItemTraits> PoolList;
-
-
- 8376 uint32_t m_NextPoolId;
+
+
+
+
+ 8376 uint32_t GetGpuDefragmentationMemoryTypeBits();
-
-
-
- 8381 uint32_t m_GlobalMemoryTypeBits;
-
- 8383 #if VMA_RECORDING_ENABLED
- 8384 VmaRecorder* m_pRecorder;
-
-
-
-
- 8389 #if VMA_STATIC_VULKAN_FUNCTIONS == 1
- 8390 void ImportVulkanFunctions_Static();
-
+
+ 8379 VkDeviceSize m_PreferredLargeHeapBlockSize;
+
+ 8381 VkPhysicalDevice m_PhysicalDevice;
+ 8382 VMA_ATOMIC_UINT32 m_CurrentFrameIndex;
+ 8383 VMA_ATOMIC_UINT32 m_GpuDefragmentationMemoryTypeBits;
+
+ 8385 VMA_RW_MUTEX m_PoolsMutex;
+ 8386 typedef VmaIntrusiveLinkedList<VmaPoolListItemTraits> PoolList;
+
+
+ 8389 uint32_t m_NextPoolId;
+
+
-
-
- 8395 #if VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
- 8396 void ImportVulkanFunctions_Dynamic();
-
-
- 8399 void ValidateVulkanFunctions();
-
- 8401 VkDeviceSize CalcPreferredBlockSize(uint32_t memTypeIndex);
-
- 8403 VkResult AllocateMemoryOfType(
-
- 8405 VkDeviceSize alignment,
- 8406 bool dedicatedAllocation,
- 8407 VkBuffer dedicatedBuffer,
- 8408 VkBufferUsageFlags dedicatedBufferUsage,
- 8409 VkImage dedicatedImage,
-
- 8411 uint32_t memTypeIndex,
- 8412 VmaSuballocationType suballocType,
- 8413 size_t allocationCount,
-
+
+ 8394 uint32_t m_GlobalMemoryTypeBits;
+
+ 8396 #if VMA_RECORDING_ENABLED
+ 8397 VmaRecorder* m_pRecorder;
+
+
+
+
+ 8402 #if VMA_STATIC_VULKAN_FUNCTIONS == 1
+ 8403 void ImportVulkanFunctions_Static();
+
+
+
+
+ 8408 #if VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
+ 8409 void ImportVulkanFunctions_Dynamic();
+
+
+ 8412 void ValidateVulkanFunctions();
+
+ 8414 VkDeviceSize CalcPreferredBlockSize(uint32_t memTypeIndex);
-
- 8417 VkResult AllocateDedicatedMemoryPage(
-
- 8419 VmaSuballocationType suballocType,
- 8420 uint32_t memTypeIndex,
- 8421 const VkMemoryAllocateInfo& allocInfo,
-
- 8423 bool isUserDataString,
-
-
-
-
- 8428 VkResult AllocateDedicatedMemory(
-
- 8430 VmaSuballocationType suballocType,
- 8431 uint32_t memTypeIndex,
-
-
- 8434 bool isUserDataString,
-
-
- 8437 VkBuffer dedicatedBuffer,
- 8438 VkBufferUsageFlags dedicatedBufferUsage,
- 8439 VkImage dedicatedImage,
- 8440 size_t allocationCount,
-
-
-
-
-
-
-
-
- 8449 uint32_t CalculateGpuDefragmentationMemoryTypeBits()
const;
-
- 8451 uint32_t CalculateGlobalMemoryTypeBits()
const;
-
- 8453 bool GetFlushOrInvalidateRange(
-
- 8455 VkDeviceSize offset, VkDeviceSize size,
- 8456 VkMappedMemoryRange& outRange)
const;
+ 8416 VkResult AllocateMemoryOfType(
+
+ 8418 VkDeviceSize alignment,
+ 8419 bool dedicatedAllocation,
+ 8420 VkBuffer dedicatedBuffer,
+ 8421 VkBufferUsageFlags dedicatedBufferUsage,
+ 8422 VkImage dedicatedImage,
+
+ 8424 uint32_t memTypeIndex,
+ 8425 VmaSuballocationType suballocType,
+ 8426 size_t allocationCount,
+
+
+
+ 8430 VkResult AllocateDedicatedMemoryPage(
+
+ 8432 VmaSuballocationType suballocType,
+ 8433 uint32_t memTypeIndex,
+ 8434 const VkMemoryAllocateInfo& allocInfo,
+
+ 8436 bool isUserDataString,
+
+
+
+
+ 8441 VkResult AllocateDedicatedMemory(
+
+ 8443 VmaSuballocationType suballocType,
+ 8444 uint32_t memTypeIndex,
+
+
+ 8447 bool isUserDataString,
+
+
+ 8450 VkBuffer dedicatedBuffer,
+ 8451 VkBufferUsageFlags dedicatedBufferUsage,
+ 8452 VkImage dedicatedImage,
+ 8453 size_t allocationCount,
+
+
+
- 8458 #if VMA_MEMORY_BUDGET
- 8459 void UpdateVulkanBudget();
-
-
-
-
+
+
+
+
+ 8462 uint32_t CalculateGpuDefragmentationMemoryTypeBits()
const;
+
+ 8464 uint32_t CalculateGlobalMemoryTypeBits()
const;
- 8466 static void* VmaMalloc(
VmaAllocator hAllocator,
size_t size,
size_t alignment)
-
- 8468 return VmaMalloc(&hAllocator->m_AllocationCallbacks, size, alignment);
-
+ 8466 bool GetFlushOrInvalidateRange(
+
+ 8468 VkDeviceSize offset, VkDeviceSize size,
+ 8469 VkMappedMemoryRange& outRange)
const;
- 8471 static void VmaFree(
VmaAllocator hAllocator,
void* ptr)
-
- 8473 VmaFree(&hAllocator->m_AllocationCallbacks, ptr);
-
+ 8471 #if VMA_MEMORY_BUDGET
+ 8472 void UpdateVulkanBudget();
+
+
- 8476 template<
typename T>
-
-
- 8479 return (T*)VmaMalloc(hAllocator,
sizeof(T), VMA_ALIGN_OF(T));
-
-
- 8482 template<
typename T>
- 8483 static T* VmaAllocateArray(
VmaAllocator hAllocator,
size_t count)
-
- 8485 return (T*)VmaMalloc(hAllocator,
sizeof(T) * count, VMA_ALIGN_OF(T));
-
-
- 8488 template<
typename T>
- 8489 static void vma_delete(
VmaAllocator hAllocator, T* ptr)
-
-
-
-
- 8494 VmaFree(hAllocator, ptr);
-
-
-
- 8498 template<
typename T>
- 8499 static void vma_delete_array(
VmaAllocator hAllocator, T* ptr,
size_t count)
-
-
-
- 8503 for(
size_t i = count; i--; )
-
- 8505 VmaFree(hAllocator, ptr);
-
-
-
-
-
- 8512 #if VMA_STATS_STRING_ENABLED
-
- 8514 class VmaStringBuilder
-
-
- 8517 VmaStringBuilder(
VmaAllocator alloc) : m_Data(VmaStlAllocator<char>(alloc->GetAllocationCallbacks())) { }
- 8518 size_t GetLength()
const {
return m_Data.size(); }
- 8519 const char* GetData()
const {
return m_Data.data(); }
-
- 8521 void Add(
char ch) { m_Data.push_back(ch); }
- 8522 void Add(
const char* pStr);
- 8523 void AddNewLine() { Add(
'\n'); }
- 8524 void AddNumber(uint32_t num);
- 8525 void AddNumber(uint64_t num);
- 8526 void AddPointer(
const void* ptr);
-
-
- 8529 VmaVector< char, VmaStlAllocator<char> > m_Data;
-
-
- 8532 void VmaStringBuilder::Add(
const char* pStr)
-
- 8534 const size_t strLen = strlen(pStr);
-
-
- 8537 const size_t oldCount = m_Data.size();
- 8538 m_Data.resize(oldCount + strLen);
- 8539 memcpy(m_Data.data() + oldCount, pStr, strLen);
-
-
-
- 8543 void VmaStringBuilder::AddNumber(uint32_t num)
-
-
-
-
-
+
+
+ 8479 static void* VmaMalloc(
VmaAllocator hAllocator,
size_t size,
size_t alignment)
+
+ 8481 return VmaMalloc(&hAllocator->m_AllocationCallbacks, size, alignment);
+
+
+ 8484 static void VmaFree(
VmaAllocator hAllocator,
void* ptr)
+
+ 8486 VmaFree(&hAllocator->m_AllocationCallbacks, ptr);
+
+
+ 8489 template<
typename T>
+
+
+ 8492 return (T*)VmaMalloc(hAllocator,
sizeof(T), VMA_ALIGN_OF(T));
+
+
+ 8495 template<
typename T>
+ 8496 static T* VmaAllocateArray(
VmaAllocator hAllocator,
size_t count)
+
+ 8498 return (T*)VmaMalloc(hAllocator,
sizeof(T) * count, VMA_ALIGN_OF(T));
+
+
+ 8501 template<
typename T>
+ 8502 static void vma_delete(
VmaAllocator hAllocator, T* ptr)
+
+
+
+
+ 8507 VmaFree(hAllocator, ptr);
+
+
+
+ 8511 template<
typename T>
+ 8512 static void vma_delete_array(
VmaAllocator hAllocator, T* ptr,
size_t count)
+
+
+
+ 8516 for(
size_t i = count; i--; )
+
+ 8518 VmaFree(hAllocator, ptr);
+
+
+
+
+
+ 8525 #if VMA_STATS_STRING_ENABLED
+
+ 8527 class VmaStringBuilder
+
+
+ 8530 VmaStringBuilder(
VmaAllocator alloc) : m_Data(VmaStlAllocator<char>(alloc->GetAllocationCallbacks())) { }
+ 8531 size_t GetLength()
const {
return m_Data.size(); }
+ 8532 const char* GetData()
const {
return m_Data.data(); }
+
+ 8534 void Add(
char ch) { m_Data.push_back(ch); }
+ 8535 void Add(
const char* pStr);
+ 8536 void AddNewLine() { Add(
'\n'); }
+ 8537 void AddNumber(uint32_t num);
+ 8538 void AddNumber(uint64_t num);
+ 8539 void AddPointer(
const void* ptr);
+
+
+ 8542 VmaVector< char, VmaStlAllocator<char> > m_Data;
+
+
+ 8545 void VmaStringBuilder::Add(
const char* pStr)
+
+ 8547 const size_t strLen = strlen(pStr);
+
- 8550 *--p =
'0' + (num % 10);
-
-
-
-
-
-
- 8557 void VmaStringBuilder::AddNumber(uint64_t num)
-
-
-
-
-
-
- 8564 *--p =
'0' + (num % 10);
-
-
-
-
-
-
- 8571 void VmaStringBuilder::AddPointer(
const void* ptr)
-
-
- 8574 VmaPtrToStr(buf,
sizeof(buf), ptr);
-
-
-
-
-
-
-
- 8583 #if VMA_STATS_STRING_ENABLED
-
-
-
- 8587 VMA_CLASS_NO_COPY(VmaJsonWriter)
-
- 8589 VmaJsonWriter(
const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb);
-
-
- 8592 void BeginObject(
bool singleLine =
false);
-
-
- 8595 void BeginArray(
bool singleLine =
false);
-
+ 8550 const size_t oldCount = m_Data.size();
+ 8551 m_Data.resize(oldCount + strLen);
+ 8552 memcpy(m_Data.data() + oldCount, pStr, strLen);
+
+
+
+ 8556 void VmaStringBuilder::AddNumber(uint32_t num)
+
+
+
+
+
+
+ 8563 *--p =
'0' + (num % 10);
+
+
+
+
+
+
+ 8570 void VmaStringBuilder::AddNumber(uint64_t num)
+
+
+
+
+
+
+ 8577 *--p =
'0' + (num % 10);
+
+
+
+
+
+
+ 8584 void VmaStringBuilder::AddPointer(
const void* ptr)
+
+
+ 8587 VmaPtrToStr(buf,
sizeof(buf), ptr);
+
+
+
+
+
+
+
+ 8596 #if VMA_STATS_STRING_ENABLED
- 8598 void WriteString(
const char* pStr);
- 8599 void BeginString(
const char* pStr = VMA_NULL);
- 8600 void ContinueString(
const char* pStr);
- 8601 void ContinueString(uint32_t n);
- 8602 void ContinueString(uint64_t n);
- 8603 void ContinueString_Pointer(
const void* ptr);
- 8604 void EndString(
const char* pStr = VMA_NULL);
-
- 8606 void WriteNumber(uint32_t n);
- 8607 void WriteNumber(uint64_t n);
- 8608 void WriteBool(
bool b);
-
+
+
+ 8600 VMA_CLASS_NO_COPY(VmaJsonWriter)
+
+ 8602 VmaJsonWriter(
const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb);
+
+
+ 8605 void BeginObject(
bool singleLine =
false);
+
+
+ 8608 void BeginArray(
bool singleLine =
false);
+
-
- 8612 static const char*
const INDENT;
-
- 8614 enum COLLECTION_TYPE
-
- 8616 COLLECTION_TYPE_OBJECT,
- 8617 COLLECTION_TYPE_ARRAY,
-
-
-
- 8621 COLLECTION_TYPE type;
- 8622 uint32_t valueCount;
- 8623 bool singleLineMode;
-
-
- 8626 VmaStringBuilder& m_SB;
- 8627 VmaVector< StackItem, VmaStlAllocator<StackItem> > m_Stack;
- 8628 bool m_InsideString;
-
- 8630 void BeginValue(
bool isString);
- 8631 void WriteIndent(
bool oneLess =
false);
-
-
- 8634 const char*
const VmaJsonWriter::INDENT =
" ";
-
- 8636 VmaJsonWriter::VmaJsonWriter(
const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb) :
-
- 8638 m_Stack(VmaStlAllocator<StackItem>(pAllocationCallbacks)),
- 8639 m_InsideString(false)
-
-
+ 8611 void WriteString(
const char* pStr);
+ 8612 void BeginString(
const char* pStr = VMA_NULL);
+ 8613 void ContinueString(
const char* pStr);
+ 8614 void ContinueString(uint32_t n);
+ 8615 void ContinueString(uint64_t n);
+ 8616 void ContinueString_Pointer(
const void* ptr);
+ 8617 void EndString(
const char* pStr = VMA_NULL);
+
+ 8619 void WriteNumber(uint32_t n);
+ 8620 void WriteNumber(uint64_t n);
+ 8621 void WriteBool(
bool b);
+
+
+
+ 8625 static const char*
const INDENT;
+
+ 8627 enum COLLECTION_TYPE
+
+ 8629 COLLECTION_TYPE_OBJECT,
+ 8630 COLLECTION_TYPE_ARRAY,
+
+
+
+ 8634 COLLECTION_TYPE type;
+ 8635 uint32_t valueCount;
+ 8636 bool singleLineMode;
+
+
+ 8639 VmaStringBuilder& m_SB;
+ 8640 VmaVector< StackItem, VmaStlAllocator<StackItem> > m_Stack;
+ 8641 bool m_InsideString;
- 8643 VmaJsonWriter::~VmaJsonWriter()
-
- 8645 VMA_ASSERT(!m_InsideString);
- 8646 VMA_ASSERT(m_Stack.empty());
-
+ 8643 void BeginValue(
bool isString);
+ 8644 void WriteIndent(
bool oneLess =
false);
+
+
+ 8647 const char*
const VmaJsonWriter::INDENT =
" ";
- 8649 void VmaJsonWriter::BeginObject(
bool singleLine)
-
- 8651 VMA_ASSERT(!m_InsideString);
-
-
-
+ 8649 VmaJsonWriter::VmaJsonWriter(
const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb) :
+
+ 8651 m_Stack(VmaStlAllocator<StackItem>(pAllocationCallbacks)),
+ 8652 m_InsideString(false)
+
+
-
- 8657 item.type = COLLECTION_TYPE_OBJECT;
- 8658 item.valueCount = 0;
- 8659 item.singleLineMode = singleLine;
- 8660 m_Stack.push_back(item);
-
-
- 8663 void VmaJsonWriter::EndObject()
-
- 8665 VMA_ASSERT(!m_InsideString);
-
-
-
-
- 8670 VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_OBJECT);
-
-
-
- 8674 void VmaJsonWriter::BeginArray(
bool singleLine)
-
- 8676 VMA_ASSERT(!m_InsideString);
-
-
-
-
-
- 8682 item.type = COLLECTION_TYPE_ARRAY;
- 8683 item.valueCount = 0;
- 8684 item.singleLineMode = singleLine;
- 8685 m_Stack.push_back(item);
-
-
- 8688 void VmaJsonWriter::EndArray()
-
- 8690 VMA_ASSERT(!m_InsideString);
-
-
-
-
- 8695 VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_ARRAY);
-
-
-
- 8699 void VmaJsonWriter::WriteString(
const char* pStr)
-
-
-
-
+ 8656 VmaJsonWriter::~VmaJsonWriter()
+
+ 8658 VMA_ASSERT(!m_InsideString);
+ 8659 VMA_ASSERT(m_Stack.empty());
+
+
+ 8662 void VmaJsonWriter::BeginObject(
bool singleLine)
+
+ 8664 VMA_ASSERT(!m_InsideString);
+
+
+
+
+
+ 8670 item.type = COLLECTION_TYPE_OBJECT;
+ 8671 item.valueCount = 0;
+ 8672 item.singleLineMode = singleLine;
+ 8673 m_Stack.push_back(item);
+
+
+ 8676 void VmaJsonWriter::EndObject()
+
+ 8678 VMA_ASSERT(!m_InsideString);
+
+
+
+
+ 8683 VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_OBJECT);
+
+
+
+ 8687 void VmaJsonWriter::BeginArray(
bool singleLine)
+
+ 8689 VMA_ASSERT(!m_InsideString);
+
+
+
+
+
+ 8695 item.type = COLLECTION_TYPE_ARRAY;
+ 8696 item.valueCount = 0;
+ 8697 item.singleLineMode = singleLine;
+ 8698 m_Stack.push_back(item);
+
+
+ 8701 void VmaJsonWriter::EndArray()
+
+ 8703 VMA_ASSERT(!m_InsideString);
- 8705 void VmaJsonWriter::BeginString(
const char* pStr)
-
- 8707 VMA_ASSERT(!m_InsideString);
-
-
-
- 8711 m_InsideString =
true;
- 8712 if(pStr != VMA_NULL && pStr[0] !=
'\0')
-
- 8714 ContinueString(pStr);
-
+
+
+
+ 8708 VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_ARRAY);
+
+
+
+ 8712 void VmaJsonWriter::WriteString(
const char* pStr)
+
+
+
- 8718 void VmaJsonWriter::ContinueString(
const char* pStr)
+ 8718 void VmaJsonWriter::BeginString(
const char* pStr)
- 8720 VMA_ASSERT(m_InsideString);
+ 8720 VMA_ASSERT(!m_InsideString);
- 8722 const size_t strLen = strlen(pStr);
- 8723 for(
size_t i = 0; i < strLen; ++i)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 8756 VMA_ASSERT(0 &&
"Character not currently supported.");
-
-
-
-
-
- 8762 void VmaJsonWriter::ContinueString(uint32_t n)
-
- 8764 VMA_ASSERT(m_InsideString);
-
-
-
- 8768 void VmaJsonWriter::ContinueString(uint64_t n)
-
- 8770 VMA_ASSERT(m_InsideString);
-
-
-
- 8774 void VmaJsonWriter::ContinueString_Pointer(
const void* ptr)
-
- 8776 VMA_ASSERT(m_InsideString);
- 8777 m_SB.AddPointer(ptr);
-
-
- 8780 void VmaJsonWriter::EndString(
const char* pStr)
-
- 8782 VMA_ASSERT(m_InsideString);
- 8783 if(pStr != VMA_NULL && pStr[0] !=
'\0')
-
- 8785 ContinueString(pStr);
-
-
- 8788 m_InsideString =
false;
-
-
- 8791 void VmaJsonWriter::WriteNumber(uint32_t n)
-
- 8793 VMA_ASSERT(!m_InsideString);
-
-
-
-
- 8798 void VmaJsonWriter::WriteNumber(uint64_t n)
-
- 8800 VMA_ASSERT(!m_InsideString);
-
-
-
-
- 8805 void VmaJsonWriter::WriteBool(
bool b)
-
- 8807 VMA_ASSERT(!m_InsideString);
-
- 8809 m_SB.Add(b ?
"true" :
"false");
-
-
- 8812 void VmaJsonWriter::WriteNull()
-
- 8814 VMA_ASSERT(!m_InsideString);
-
-
-
-
- 8819 void VmaJsonWriter::BeginValue(
bool isString)
-
- 8821 if(!m_Stack.empty())
-
- 8823 StackItem& currItem = m_Stack.back();
- 8824 if(currItem.type == COLLECTION_TYPE_OBJECT &&
- 8825 currItem.valueCount % 2 == 0)
-
- 8827 VMA_ASSERT(isString);
-
-
- 8830 if(currItem.type == COLLECTION_TYPE_OBJECT &&
- 8831 currItem.valueCount % 2 != 0)
-
-
-
- 8835 else if(currItem.valueCount > 0)
-
-
-
-
-
-
-
-
- 8844 ++currItem.valueCount;
-
-
-
- 8848 void VmaJsonWriter::WriteIndent(
bool oneLess)
-
- 8850 if(!m_Stack.empty() && !m_Stack.back().singleLineMode)
-
-
-
- 8854 size_t count = m_Stack.size();
- 8855 if(count > 0 && oneLess)
-
-
-
- 8859 for(
size_t i = 0; i < count; ++i)
-
-
-
-
-
-
-
-
-
- 8870 void VmaAllocation_T::SetUserData(
VmaAllocator hAllocator,
void* pUserData)
-
- 8872 if(IsUserDataString())
-
- 8874 VMA_ASSERT(pUserData == VMA_NULL || pUserData != m_pUserData);
-
- 8876 FreeUserDataString(hAllocator);
-
- 8878 if(pUserData != VMA_NULL)
-
- 8880 m_pUserData = VmaCreateStringCopy(hAllocator->GetAllocationCallbacks(), (
const char*)pUserData);
-
-
-
-
- 8885 m_pUserData = pUserData;
-
-
+
+
+ 8724 m_InsideString =
true;
+ 8725 if(pStr != VMA_NULL && pStr[0] !=
'\0')
+
+ 8727 ContinueString(pStr);
+
+
+
+ 8731 void VmaJsonWriter::ContinueString(
const char* pStr)
+
+ 8733 VMA_ASSERT(m_InsideString);
+
+ 8735 const size_t strLen = strlen(pStr);
+ 8736 for(
size_t i = 0; i < strLen; ++i)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 8769 VMA_ASSERT(0 &&
"Character not currently supported.");
+
+
+
+
+
+ 8775 void VmaJsonWriter::ContinueString(uint32_t n)
+
+ 8777 VMA_ASSERT(m_InsideString);
+
+
+
+ 8781 void VmaJsonWriter::ContinueString(uint64_t n)
+
+ 8783 VMA_ASSERT(m_InsideString);
+
+
+
+ 8787 void VmaJsonWriter::ContinueString_Pointer(
const void* ptr)
+
+ 8789 VMA_ASSERT(m_InsideString);
+ 8790 m_SB.AddPointer(ptr);
+
+
+ 8793 void VmaJsonWriter::EndString(
const char* pStr)
+
+ 8795 VMA_ASSERT(m_InsideString);
+ 8796 if(pStr != VMA_NULL && pStr[0] !=
'\0')
+
+ 8798 ContinueString(pStr);
+
+
+ 8801 m_InsideString =
false;
+
+
+ 8804 void VmaJsonWriter::WriteNumber(uint32_t n)
+
+ 8806 VMA_ASSERT(!m_InsideString);
+
+
+
+
+ 8811 void VmaJsonWriter::WriteNumber(uint64_t n)
+
+ 8813 VMA_ASSERT(!m_InsideString);
+
+
+
+
+ 8818 void VmaJsonWriter::WriteBool(
bool b)
+
+ 8820 VMA_ASSERT(!m_InsideString);
+
+ 8822 m_SB.Add(b ?
"true" :
"false");
+
+
+ 8825 void VmaJsonWriter::WriteNull()
+
+ 8827 VMA_ASSERT(!m_InsideString);
+
+
+
+
+ 8832 void VmaJsonWriter::BeginValue(
bool isString)
+
+ 8834 if(!m_Stack.empty())
+
+ 8836 StackItem& currItem = m_Stack.back();
+ 8837 if(currItem.type == COLLECTION_TYPE_OBJECT &&
+ 8838 currItem.valueCount % 2 == 0)
+
+ 8840 VMA_ASSERT(isString);
+
+
+ 8843 if(currItem.type == COLLECTION_TYPE_OBJECT &&
+ 8844 currItem.valueCount % 2 != 0)
+
+
+
+ 8848 else if(currItem.valueCount > 0)
+
+
+
+
+
+
+
+
+ 8857 ++currItem.valueCount;
+
+
+
+ 8861 void VmaJsonWriter::WriteIndent(
bool oneLess)
+
+ 8863 if(!m_Stack.empty() && !m_Stack.back().singleLineMode)
+
+
+
+ 8867 size_t count = m_Stack.size();
+ 8868 if(count > 0 && oneLess)
+
+
+
+ 8872 for(
size_t i = 0; i < count; ++i)
+
+
+
+
+
+
+
+
+
+ 8883 void VmaAllocation_T::SetUserData(
VmaAllocator hAllocator,
void* pUserData)
+
+ 8885 if(IsUserDataString())
+
+ 8887 VMA_ASSERT(pUserData == VMA_NULL || pUserData != m_pUserData);
- 8889 void VmaAllocation_T::ChangeBlockAllocation(
-
- 8891 VmaDeviceMemoryBlock* block,
- 8892 VkDeviceSize offset)
-
- 8894 VMA_ASSERT(block != VMA_NULL);
- 8895 VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
-
-
- 8898 if(block != m_BlockAllocation.m_Block)
-
- 8900 uint32_t mapRefCount = m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP;
- 8901 if(IsPersistentMap())
-
- 8903 m_BlockAllocation.m_Block->Unmap(hAllocator, mapRefCount);
- 8904 block->Map(hAllocator, mapRefCount, VMA_NULL);
-
-
- 8907 m_BlockAllocation.m_Block = block;
- 8908 m_BlockAllocation.m_Offset = offset;
-
-
- 8911 void VmaAllocation_T::ChangeOffset(VkDeviceSize newOffset)
-
- 8913 VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
- 8914 m_BlockAllocation.m_Offset = newOffset;
-
-
- 8917 VkDeviceSize VmaAllocation_T::GetOffset()
const
-
-
-
- 8921 case ALLOCATION_TYPE_BLOCK:
- 8922 return m_BlockAllocation.m_Offset;
- 8923 case ALLOCATION_TYPE_DEDICATED:
-
-
-
-
-
-
-
- 8931 VkDeviceMemory VmaAllocation_T::GetMemory()
const
-
-
-
- 8935 case ALLOCATION_TYPE_BLOCK:
- 8936 return m_BlockAllocation.m_Block->GetDeviceMemory();
- 8937 case ALLOCATION_TYPE_DEDICATED:
- 8938 return m_DedicatedAllocation.m_hMemory;
-
-
- 8941 return VK_NULL_HANDLE;
-
-
-
- 8945 void* VmaAllocation_T::GetMappedData()
const
-
-
-
- 8949 case ALLOCATION_TYPE_BLOCK:
-
-
- 8952 void* pBlockData = m_BlockAllocation.m_Block->GetMappedData();
- 8953 VMA_ASSERT(pBlockData != VMA_NULL);
- 8954 return (
char*)pBlockData + m_BlockAllocation.m_Offset;
-
-
-
-
-
-
- 8961 case ALLOCATION_TYPE_DEDICATED:
- 8962 VMA_ASSERT((m_DedicatedAllocation.m_pMappedData != VMA_NULL) == (m_MapCount != 0));
- 8963 return m_DedicatedAllocation.m_pMappedData;
-
-
-
-
-
-
- 8970 bool VmaAllocation_T::CanBecomeLost()
const
-
-
-
- 8974 case ALLOCATION_TYPE_BLOCK:
- 8975 return m_BlockAllocation.m_CanBecomeLost;
- 8976 case ALLOCATION_TYPE_DEDICATED:
-
-
-
-
-
-
-
- 8984 bool VmaAllocation_T::MakeLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
-
- 8986 VMA_ASSERT(CanBecomeLost());
-
-
-
-
-
- 8992 uint32_t localLastUseFrameIndex = GetLastUseFrameIndex();
-
-
- 8995 if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST)
-
-
-
-
- 9000 else if(localLastUseFrameIndex + frameInUseCount >= currentFrameIndex)
-
-
-
-
-
- 9006 if(CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, VMA_FRAME_INDEX_LOST))
-
-
-
-
-
+ 8889 FreeUserDataString(hAllocator);
+
+ 8891 if(pUserData != VMA_NULL)
+
+ 8893 m_pUserData = VmaCreateStringCopy(hAllocator->GetAllocationCallbacks(), (
const char*)pUserData);
+
+
+
+
+ 8898 m_pUserData = pUserData;
+
+
+
+ 8902 void VmaAllocation_T::ChangeBlockAllocation(
+
+ 8904 VmaDeviceMemoryBlock* block,
+ 8905 VkDeviceSize offset)
+
+ 8907 VMA_ASSERT(block != VMA_NULL);
+ 8908 VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
+
+
+ 8911 if(block != m_BlockAllocation.m_Block)
+
+ 8913 uint32_t mapRefCount = m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP;
+ 8914 if(IsPersistentMap())
+
+ 8916 m_BlockAllocation.m_Block->Unmap(hAllocator, mapRefCount);
+ 8917 block->Map(hAllocator, mapRefCount, VMA_NULL);
+
+
+ 8920 m_BlockAllocation.m_Block = block;
+ 8921 m_BlockAllocation.m_Offset = offset;
+
+
+ 8924 void VmaAllocation_T::ChangeOffset(VkDeviceSize newOffset)
+
+ 8926 VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
+ 8927 m_BlockAllocation.m_Offset = newOffset;
+
+
+ 8930 VkDeviceSize VmaAllocation_T::GetOffset()
const
+
+
+
+ 8934 case ALLOCATION_TYPE_BLOCK:
+ 8935 return m_BlockAllocation.m_Offset;
+ 8936 case ALLOCATION_TYPE_DEDICATED:
+
+
+
+
+
+
+
+ 8944 VkDeviceMemory VmaAllocation_T::GetMemory()
const
+
+
+
+ 8948 case ALLOCATION_TYPE_BLOCK:
+ 8949 return m_BlockAllocation.m_Block->GetDeviceMemory();
+ 8950 case ALLOCATION_TYPE_DEDICATED:
+ 8951 return m_DedicatedAllocation.m_hMemory;
+
+
+ 8954 return VK_NULL_HANDLE;
+
+
+
+ 8958 void* VmaAllocation_T::GetMappedData()
const
+
+
+
+ 8962 case ALLOCATION_TYPE_BLOCK:
+
+
+ 8965 void* pBlockData = m_BlockAllocation.m_Block->GetMappedData();
+ 8966 VMA_ASSERT(pBlockData != VMA_NULL);
+ 8967 return (
char*)pBlockData + m_BlockAllocation.m_Offset;
+
+
+
+
+
+
+ 8974 case ALLOCATION_TYPE_DEDICATED:
+ 8975 VMA_ASSERT((m_DedicatedAllocation.m_pMappedData != VMA_NULL) == (m_MapCount != 0));
+ 8976 return m_DedicatedAllocation.m_pMappedData;
+
+
+
+
+
+
+ 8983 bool VmaAllocation_T::CanBecomeLost()
const
+
+
+
+ 8987 case ALLOCATION_TYPE_BLOCK:
+ 8988 return m_BlockAllocation.m_CanBecomeLost;
+ 8989 case ALLOCATION_TYPE_DEDICATED:
+
+
+
+
+
+
+
+ 8997 bool VmaAllocation_T::MakeLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
+
+ 8999 VMA_ASSERT(CanBecomeLost());
+
+
+
+
+
+ 9005 uint32_t localLastUseFrameIndex = GetLastUseFrameIndex();
+
+
+ 9008 if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST)
+
+
+
-
-
-
- 9016 #if VMA_STATS_STRING_ENABLED
-
-
- 9019 static const char* VMA_SUBALLOCATION_TYPE_NAMES[] = {
-
-
-
-
-
-
-
-
- 9028 void VmaAllocation_T::PrintParameters(
class VmaJsonWriter& json)
const
-
- 9030 json.WriteString(
"Type");
- 9031 json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[m_SuballocationType]);
-
- 9033 json.WriteString(
"Size");
- 9034 json.WriteNumber(m_Size);
-
- 9036 if(m_pUserData != VMA_NULL)
-
- 9038 json.WriteString(
"UserData");
- 9039 if(IsUserDataString())
-
- 9041 json.WriteString((
const char*)m_pUserData);
-
-
-
-
- 9046 json.ContinueString_Pointer(m_pUserData);
-
-
-
-
- 9051 json.WriteString(
"CreationFrameIndex");
- 9052 json.WriteNumber(m_CreationFrameIndex);
-
- 9054 json.WriteString(
"LastUseFrameIndex");
- 9055 json.WriteNumber(GetLastUseFrameIndex());
-
- 9057 if(m_BufferImageUsage != 0)
-
- 9059 json.WriteString(
"Usage");
- 9060 json.WriteNumber(m_BufferImageUsage);
-
-
+ 9013 else if(localLastUseFrameIndex + frameInUseCount >= currentFrameIndex)
+
+
+
+
+
+ 9019 if(CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, VMA_FRAME_INDEX_LOST))
+
+
+
+
+
+
+
+
+
+ 9029 #if VMA_STATS_STRING_ENABLED
+
+
+ 9032 static const char* VMA_SUBALLOCATION_TYPE_NAMES[] = {
+
+
+
+
+
+
+
+
+ 9041 void VmaAllocation_T::PrintParameters(
class VmaJsonWriter& json)
const
+
+ 9043 json.WriteString(
"Type");
+ 9044 json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[m_SuballocationType]);
+
+ 9046 json.WriteString(
"Size");
+ 9047 json.WriteNumber(m_Size);
+
+ 9049 if(m_pUserData != VMA_NULL)
+
+ 9051 json.WriteString(
"UserData");
+ 9052 if(IsUserDataString())
+
+ 9054 json.WriteString((
const char*)m_pUserData);
+
+
+
+
+ 9059 json.ContinueString_Pointer(m_pUserData);
+
+
+
-
-
- 9066 void VmaAllocation_T::FreeUserDataString(
VmaAllocator hAllocator)
-
- 9068 VMA_ASSERT(IsUserDataString());
- 9069 VmaFreeString(hAllocator->GetAllocationCallbacks(), (
char*)m_pUserData);
- 9070 m_pUserData = VMA_NULL;
-
-
- 9073 void VmaAllocation_T::BlockAllocMap()
-
- 9075 VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK);
+ 9064 json.WriteString(
"CreationFrameIndex");
+ 9065 json.WriteNumber(m_CreationFrameIndex);
+
+ 9067 json.WriteString(
"LastUseFrameIndex");
+ 9068 json.WriteNumber(GetLastUseFrameIndex());
+
+ 9070 if(m_BufferImageUsage != 0)
+
+ 9072 json.WriteString(
"Usage");
+ 9073 json.WriteNumber(m_BufferImageUsage);
+
+
- 9077 if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) < 0x7F)
-
-
-
-
-
- 9083 VMA_ASSERT(0 &&
"Allocation mapped too many times simultaneously.");
-
-
-
- 9087 void VmaAllocation_T::BlockAllocUnmap()
-
- 9089 VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK);
-
- 9091 if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) != 0)
-
-
-
-
-
- 9097 VMA_ASSERT(0 &&
"Unmapping allocation not previously mapped.");
-
-
-
- 9101 VkResult VmaAllocation_T::DedicatedAllocMap(
VmaAllocator hAllocator,
void** ppData)
-
- 9103 VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED);
-
-
-
- 9107 if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) < 0x7F)
-
- 9109 VMA_ASSERT(m_DedicatedAllocation.m_pMappedData != VMA_NULL);
- 9110 *ppData = m_DedicatedAllocation.m_pMappedData;
-
-
-
-
-
- 9116 VMA_ASSERT(0 &&
"Dedicated allocation mapped too many times simultaneously.");
- 9117 return VK_ERROR_MEMORY_MAP_FAILED;
-
-
-
-
- 9122 VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)(
- 9123 hAllocator->m_hDevice,
- 9124 m_DedicatedAllocation.m_hMemory,
-
-
-
-
- 9129 if(result == VK_SUCCESS)
-
- 9131 m_DedicatedAllocation.m_pMappedData = *ppData;
-
-
-
-
-
-
- 9138 void VmaAllocation_T::DedicatedAllocUnmap(
VmaAllocator hAllocator)
-
- 9140 VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED);
-
- 9142 if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) != 0)
-
-
-
-
- 9147 m_DedicatedAllocation.m_pMappedData = VMA_NULL;
- 9148 (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(
- 9149 hAllocator->m_hDevice,
- 9150 m_DedicatedAllocation.m_hMemory);
-
-
-
-
- 9155 VMA_ASSERT(0 &&
"Unmapping dedicated allocation not previously mapped.");
-
-
-
- 9159 #if VMA_STATS_STRING_ENABLED
-
- 9161 static void VmaPrintStatInfo(VmaJsonWriter& json,
const VmaStatInfo& stat)
-
-
-
- 9165 json.WriteString(
"Blocks");
-
-
- 9168 json.WriteString(
"Allocations");
-
-
- 9171 json.WriteString(
"UnusedRanges");
-
+
+
+ 9079 void VmaAllocation_T::FreeUserDataString(
VmaAllocator hAllocator)
+
+ 9081 VMA_ASSERT(IsUserDataString());
+ 9082 VmaFreeString(hAllocator->GetAllocationCallbacks(), (
char*)m_pUserData);
+ 9083 m_pUserData = VMA_NULL;
+
+
+ 9086 void VmaAllocation_T::BlockAllocMap()
+
+ 9088 VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK);
+
+ 9090 if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) < 0x7F)
+
+
+
+
+
+ 9096 VMA_ASSERT(0 &&
"Allocation mapped too many times simultaneously.");
+
+
+
+ 9100 void VmaAllocation_T::BlockAllocUnmap()
+
+ 9102 VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK);
+
+ 9104 if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) != 0)
+
+
+
+
+
+ 9110 VMA_ASSERT(0 &&
"Unmapping allocation not previously mapped.");
+
+
+
+ 9114 VkResult VmaAllocation_T::DedicatedAllocMap(
VmaAllocator hAllocator,
void** ppData)
+
+ 9116 VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED);
+
+
+
+ 9120 if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) < 0x7F)
+
+ 9122 VMA_ASSERT(m_DedicatedAllocation.m_pMappedData != VMA_NULL);
+ 9123 *ppData = m_DedicatedAllocation.m_pMappedData;
+
+
+
+
+
+ 9129 VMA_ASSERT(0 &&
"Dedicated allocation mapped too many times simultaneously.");
+ 9130 return VK_ERROR_MEMORY_MAP_FAILED;
+
+
+
+
+ 9135 VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)(
+ 9136 hAllocator->m_hDevice,
+ 9137 m_DedicatedAllocation.m_hMemory,
+
+
+
+
+ 9142 if(result == VK_SUCCESS)
+
+ 9144 m_DedicatedAllocation.m_pMappedData = *ppData;
+
+
+
+
+
+
+ 9151 void VmaAllocation_T::DedicatedAllocUnmap(
VmaAllocator hAllocator)
+
+ 9153 VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED);
+
+ 9155 if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) != 0)
+
+
+
+
+ 9160 m_DedicatedAllocation.m_pMappedData = VMA_NULL;
+ 9161 (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(
+ 9162 hAllocator->m_hDevice,
+ 9163 m_DedicatedAllocation.m_hMemory);
+
+
+
+
+ 9168 VMA_ASSERT(0 &&
"Unmapping dedicated allocation not previously mapped.");
+
+
+
+ 9172 #if VMA_STATS_STRING_ENABLED
- 9174 json.WriteString(
"UsedBytes");
-
-
- 9177 json.WriteString(
"UnusedBytes");
-
-
-
-
- 9182 json.WriteString(
"AllocationSize");
- 9183 json.BeginObject(
true);
- 9184 json.WriteString(
"Min");
-
- 9186 json.WriteString(
"Avg");
-
- 9188 json.WriteString(
"Max");
-
-
-
+ 9174 static void VmaPrintStatInfo(VmaJsonWriter& json,
const VmaStatInfo& stat)
+
+
+
+ 9178 json.WriteString(
"Blocks");
+
+
+ 9181 json.WriteString(
"Allocations");
+
+
+ 9184 json.WriteString(
"UnusedRanges");
+
+
+ 9187 json.WriteString(
"UsedBytes");
+
+
+ 9190 json.WriteString(
"UnusedBytes");
+
-
+
- 9195 json.WriteString(
"UnusedRangeSize");
+ 9195 json.WriteString(
"AllocationSize");
9196 json.BeginObject(
true);
9197 json.WriteString(
"Min");
-
+
9199 json.WriteString(
"Avg");
-
+
9201 json.WriteString(
"Max");
-
+
-
-
-
-
-
- 9211 struct VmaSuballocationItemSizeLess
-
-
- 9214 const VmaSuballocationList::iterator lhs,
- 9215 const VmaSuballocationList::iterator rhs)
const
-
- 9217 return lhs->size < rhs->size;
-
-
- 9220 const VmaSuballocationList::iterator lhs,
- 9221 VkDeviceSize rhsSize)
const
-
- 9223 return lhs->size < rhsSize;
-
-
-
-
-
-
- 9231 VmaBlockMetadata::VmaBlockMetadata(
VmaAllocator hAllocator) :
-
- 9233 m_pAllocationCallbacks(hAllocator->GetAllocationCallbacks())
-
-
-
- 9237 #if VMA_STATS_STRING_ENABLED
-
- 9239 void VmaBlockMetadata::PrintDetailedMap_Begin(
class VmaJsonWriter& json,
- 9240 VkDeviceSize unusedBytes,
- 9241 size_t allocationCount,
- 9242 size_t unusedRangeCount)
const
-
-
-
- 9246 json.WriteString(
"TotalBytes");
- 9247 json.WriteNumber(GetSize());
-
- 9249 json.WriteString(
"UnusedBytes");
- 9250 json.WriteNumber(unusedBytes);
+
+
+ 9208 json.WriteString(
"UnusedRangeSize");
+ 9209 json.BeginObject(
true);
+ 9210 json.WriteString(
"Min");
+
+ 9212 json.WriteString(
"Avg");
+
+ 9214 json.WriteString(
"Max");
+
+
+
+
+
+
+
+
+
+ 9224 struct VmaSuballocationItemSizeLess
+
+
+ 9227 const VmaSuballocationList::iterator lhs,
+ 9228 const VmaSuballocationList::iterator rhs)
const
+
+ 9230 return lhs->size < rhs->size;
+
+
+ 9233 const VmaSuballocationList::iterator lhs,
+ 9234 VkDeviceSize rhsSize)
const
+
+ 9236 return lhs->size < rhsSize;
+
+
+
+
+
+
+ 9244 VmaBlockMetadata::VmaBlockMetadata(
VmaAllocator hAllocator) :
+
+ 9246 m_pAllocationCallbacks(hAllocator->GetAllocationCallbacks())
+
+
+
+ 9250 #if VMA_STATS_STRING_ENABLED
- 9252 json.WriteString(
"Allocations");
- 9253 json.WriteNumber((uint64_t)allocationCount);
-
- 9255 json.WriteString(
"UnusedRanges");
- 9256 json.WriteNumber((uint64_t)unusedRangeCount);
-
- 9258 json.WriteString(
"Suballocations");
-
-
+ 9252 void VmaBlockMetadata::PrintDetailedMap_Begin(
class VmaJsonWriter& json,
+ 9253 VkDeviceSize unusedBytes,
+ 9254 size_t allocationCount,
+ 9255 size_t unusedRangeCount)
const
+
+
+
+ 9259 json.WriteString(
"TotalBytes");
+ 9260 json.WriteNumber(GetSize());
- 9262 void VmaBlockMetadata::PrintDetailedMap_Allocation(
class VmaJsonWriter& json,
- 9263 VkDeviceSize offset,
-
-
- 9266 json.BeginObject(
true);
+ 9262 json.WriteString(
"UnusedBytes");
+ 9263 json.WriteNumber(unusedBytes);
+
+ 9265 json.WriteString(
"Allocations");
+ 9266 json.WriteNumber((uint64_t)allocationCount);
- 9268 json.WriteString(
"Offset");
- 9269 json.WriteNumber(offset);
+ 9268 json.WriteString(
"UnusedRanges");
+ 9269 json.WriteNumber((uint64_t)unusedRangeCount);
- 9271 hAllocation->PrintParameters(json);
-
-
-
-
- 9276 void VmaBlockMetadata::PrintDetailedMap_UnusedRange(
class VmaJsonWriter& json,
- 9277 VkDeviceSize offset,
- 9278 VkDeviceSize size)
const
-
- 9280 json.BeginObject(
true);
-
- 9282 json.WriteString(
"Offset");
- 9283 json.WriteNumber(offset);
-
- 9285 json.WriteString(
"Type");
- 9286 json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[VMA_SUBALLOCATION_TYPE_FREE]);
-
- 9288 json.WriteString(
"Size");
- 9289 json.WriteNumber(size);
-
-
-
-
- 9294 void VmaBlockMetadata::PrintDetailedMap_End(
class VmaJsonWriter& json)
const
-
-
-
-
-
-
-
-
-
- 9305 VmaBlockMetadata_Generic::VmaBlockMetadata_Generic(
VmaAllocator hAllocator) :
- 9306 VmaBlockMetadata(hAllocator),
-
-
- 9309 m_Suballocations(VmaStlAllocator<VmaSuballocation>(hAllocator->GetAllocationCallbacks())),
- 9310 m_FreeSuballocationsBySize(VmaStlAllocator<VmaSuballocationList::iterator>(hAllocator->GetAllocationCallbacks()))
-
-
-
- 9314 VmaBlockMetadata_Generic::~VmaBlockMetadata_Generic()
-
-
+ 9271 json.WriteString(
"Suballocations");
+
+
+
+ 9275 void VmaBlockMetadata::PrintDetailedMap_Allocation(
class VmaJsonWriter& json,
+ 9276 VkDeviceSize offset,
+
+
+ 9279 json.BeginObject(
true);
+
+ 9281 json.WriteString(
"Offset");
+ 9282 json.WriteNumber(offset);
+
+ 9284 hAllocation->PrintParameters(json);
+
+
+
+
+ 9289 void VmaBlockMetadata::PrintDetailedMap_UnusedRange(
class VmaJsonWriter& json,
+ 9290 VkDeviceSize offset,
+ 9291 VkDeviceSize size)
const
+
+ 9293 json.BeginObject(
true);
+
+ 9295 json.WriteString(
"Offset");
+ 9296 json.WriteNumber(offset);
+
+ 9298 json.WriteString(
"Type");
+ 9299 json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[VMA_SUBALLOCATION_TYPE_FREE]);
+
+ 9301 json.WriteString(
"Size");
+ 9302 json.WriteNumber(size);
+
+
+
+
+ 9307 void VmaBlockMetadata::PrintDetailedMap_End(
class VmaJsonWriter& json)
const
+
+
+
+
+
+
+
+
- 9318 void VmaBlockMetadata_Generic::Init(VkDeviceSize size)
-
- 9320 VmaBlockMetadata::Init(size);
-
-
- 9323 m_SumFreeSize = size;
-
- 9325 VmaSuballocation suballoc = {};
- 9326 suballoc.offset = 0;
- 9327 suballoc.size = size;
- 9328 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
- 9329 suballoc.hAllocation = VK_NULL_HANDLE;
+ 9318 VmaBlockMetadata_Generic::VmaBlockMetadata_Generic(
VmaAllocator hAllocator) :
+ 9319 VmaBlockMetadata(hAllocator),
+
+
+ 9322 m_Suballocations(VmaStlAllocator<VmaSuballocation>(hAllocator->GetAllocationCallbacks())),
+ 9323 m_FreeSuballocationsBySize(VmaStlAllocator<VmaSuballocationList::iterator>(hAllocator->GetAllocationCallbacks()))
+
+
+
+ 9327 VmaBlockMetadata_Generic::~VmaBlockMetadata_Generic()
+
+
- 9331 VMA_ASSERT(size > VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER);
- 9332 m_Suballocations.push_back(suballoc);
- 9333 VmaSuballocationList::iterator suballocItem = m_Suballocations.end();
-
- 9335 m_FreeSuballocationsBySize.push_back(suballocItem);
-
+ 9331 void VmaBlockMetadata_Generic::Init(VkDeviceSize size)
+
+ 9333 VmaBlockMetadata::Init(size);
+
+
+ 9336 m_SumFreeSize = size;
- 9338 bool VmaBlockMetadata_Generic::Validate()
const
-
- 9340 VMA_VALIDATE(!m_Suballocations.empty());
-
-
- 9343 VkDeviceSize calculatedOffset = 0;
-
- 9345 uint32_t calculatedFreeCount = 0;
-
- 9347 VkDeviceSize calculatedSumFreeSize = 0;
-
-
- 9350 size_t freeSuballocationsToRegister = 0;
-
- 9352 bool prevFree =
false;
-
- 9354 for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin();
- 9355 suballocItem != m_Suballocations.cend();
-
-
- 9358 const VmaSuballocation& subAlloc = *suballocItem;
-
-
- 9361 VMA_VALIDATE(subAlloc.offset == calculatedOffset);
-
- 9363 const bool currFree = (subAlloc.type == VMA_SUBALLOCATION_TYPE_FREE);
-
- 9365 VMA_VALIDATE(!prevFree || !currFree);
+ 9338 VmaSuballocation suballoc = {};
+ 9339 suballoc.offset = 0;
+ 9340 suballoc.size = size;
+ 9341 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ 9342 suballoc.hAllocation = VK_NULL_HANDLE;
+
+ 9344 VMA_ASSERT(size > VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER);
+ 9345 m_Suballocations.push_back(suballoc);
+ 9346 VmaSuballocationList::iterator suballocItem = m_Suballocations.end();
+
+ 9348 m_FreeSuballocationsBySize.push_back(suballocItem);
+
+
+ 9351 bool VmaBlockMetadata_Generic::Validate()
const
+
+ 9353 VMA_VALIDATE(!m_Suballocations.empty());
+
+
+ 9356 VkDeviceSize calculatedOffset = 0;
+
+ 9358 uint32_t calculatedFreeCount = 0;
+
+ 9360 VkDeviceSize calculatedSumFreeSize = 0;
+
+
+ 9363 size_t freeSuballocationsToRegister = 0;
+
+ 9365 bool prevFree =
false;
- 9367 VMA_VALIDATE(currFree == (subAlloc.hAllocation == VK_NULL_HANDLE));
-
-
-
- 9371 calculatedSumFreeSize += subAlloc.size;
- 9372 ++calculatedFreeCount;
- 9373 if(subAlloc.size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
-
- 9375 ++freeSuballocationsToRegister;
-
-
-
- 9379 VMA_VALIDATE(subAlloc.size >= VMA_DEBUG_MARGIN);
-
-
-
- 9383 VMA_VALIDATE(subAlloc.hAllocation->GetOffset() == subAlloc.offset);
- 9384 VMA_VALIDATE(subAlloc.hAllocation->GetSize() == subAlloc.size);
-
-
- 9387 VMA_VALIDATE(VMA_DEBUG_MARGIN == 0 || prevFree);
-
-
- 9390 calculatedOffset += subAlloc.size;
- 9391 prevFree = currFree;
-
-
-
-
- 9396 VMA_VALIDATE(m_FreeSuballocationsBySize.size() == freeSuballocationsToRegister);
-
- 9398 VkDeviceSize lastSize = 0;
- 9399 for(
size_t i = 0; i < m_FreeSuballocationsBySize.size(); ++i)
-
- 9401 VmaSuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[i];
+ 9367 for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin();
+ 9368 suballocItem != m_Suballocations.cend();
+
+
+ 9371 const VmaSuballocation& subAlloc = *suballocItem;
+
+
+ 9374 VMA_VALIDATE(subAlloc.offset == calculatedOffset);
+
+ 9376 const bool currFree = (subAlloc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ 9378 VMA_VALIDATE(!prevFree || !currFree);
+
+ 9380 VMA_VALIDATE(currFree == (subAlloc.hAllocation == VK_NULL_HANDLE));
+
+
+
+ 9384 calculatedSumFreeSize += subAlloc.size;
+ 9385 ++calculatedFreeCount;
+ 9386 if(subAlloc.size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+
+ 9388 ++freeSuballocationsToRegister;
+
+
+
+ 9392 VMA_VALIDATE(subAlloc.size >= VMA_DEBUG_MARGIN);
+
+
+
+ 9396 VMA_VALIDATE(subAlloc.hAllocation->GetOffset() == subAlloc.offset);
+ 9397 VMA_VALIDATE(subAlloc.hAllocation->GetSize() == subAlloc.size);
+
+
+ 9400 VMA_VALIDATE(VMA_DEBUG_MARGIN == 0 || prevFree);
+
-
- 9404 VMA_VALIDATE(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE);
-
- 9406 VMA_VALIDATE(suballocItem->size >= lastSize);
-
- 9408 lastSize = suballocItem->size;
-
+ 9403 calculatedOffset += subAlloc.size;
+ 9404 prevFree = currFree;
+
+
+
+
+ 9409 VMA_VALIDATE(m_FreeSuballocationsBySize.size() == freeSuballocationsToRegister);
-
- 9412 VMA_VALIDATE(ValidateFreeSuballocationList());
- 9413 VMA_VALIDATE(calculatedOffset == GetSize());
- 9414 VMA_VALIDATE(calculatedSumFreeSize == m_SumFreeSize);
- 9415 VMA_VALIDATE(calculatedFreeCount == m_FreeCount);
-
-
-
-
- 9420 VkDeviceSize VmaBlockMetadata_Generic::GetUnusedRangeSizeMax()
const
-
- 9422 if(!m_FreeSuballocationsBySize.empty())
-
- 9424 return m_FreeSuballocationsBySize.back()->size;
-
-
-
-
-
-
-
- 9432 bool VmaBlockMetadata_Generic::IsEmpty()
const
-
- 9434 return (m_Suballocations.size() == 1) && (m_FreeCount == 1);
-
-
- 9437 void VmaBlockMetadata_Generic::CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const
-
-
-
- 9441 const uint32_t rangeCount = (uint32_t)m_Suballocations.size();
-
-
+ 9411 VkDeviceSize lastSize = 0;
+ 9412 for(
size_t i = 0; i < m_FreeSuballocationsBySize.size(); ++i)
+
+ 9414 VmaSuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[i];
+
+
+ 9417 VMA_VALIDATE(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ 9419 VMA_VALIDATE(suballocItem->size >= lastSize);
+
+ 9421 lastSize = suballocItem->size;
+
+
+
+ 9425 VMA_VALIDATE(ValidateFreeSuballocationList());
+ 9426 VMA_VALIDATE(calculatedOffset == GetSize());
+ 9427 VMA_VALIDATE(calculatedSumFreeSize == m_SumFreeSize);
+ 9428 VMA_VALIDATE(calculatedFreeCount == m_FreeCount);
+
+
+
+
+ 9433 VkDeviceSize VmaBlockMetadata_Generic::GetUnusedRangeSizeMax()
const
+
+ 9435 if(!m_FreeSuballocationsBySize.empty())
+
+ 9437 return m_FreeSuballocationsBySize.back()->size;
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- 9453 for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin();
- 9454 suballocItem != m_Suballocations.cend();
-
-
- 9457 const VmaSuballocation& suballoc = *suballocItem;
- 9458 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
-
-
-
-
-
-
-
-
-
-
-
-
- 9471 void VmaBlockMetadata_Generic::AddPoolStats(
VmaPoolStats& inoutStats)
const
-
- 9473 const uint32_t rangeCount = (uint32_t)m_Suballocations.size();
-
- 9475 inoutStats.
size += GetSize();
-
-
-
-
-
-
- 9482 #if VMA_STATS_STRING_ENABLED
+ 9445 bool VmaBlockMetadata_Generic::IsEmpty()
const
+
+ 9447 return (m_Suballocations.size() == 1) && (m_FreeCount == 1);
+
+
+ 9450 void VmaBlockMetadata_Generic::CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const
+
+
+
+ 9454 const uint32_t rangeCount = (uint32_t)m_Suballocations.size();
+
+
+
+
+
+
+
+
+
+
+
+ 9466 for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin();
+ 9467 suballocItem != m_Suballocations.cend();
+
+
+ 9470 const VmaSuballocation& suballoc = *suballocItem;
+ 9471 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
+
+
+
+
+
+
+
+
+
+
+
- 9484 void VmaBlockMetadata_Generic::PrintDetailedMap(
class VmaJsonWriter& json)
const
+ 9484 void VmaBlockMetadata_Generic::AddPoolStats(
VmaPoolStats& inoutStats)
const
- 9486 PrintDetailedMap_Begin(json,
-
- 9488 m_Suballocations.size() - (
size_t)m_FreeCount,
-
-
-
- 9492 for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin();
- 9493 suballocItem != m_Suballocations.cend();
- 9494 ++suballocItem, ++i)
-
- 9496 if(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE)
-
- 9498 PrintDetailedMap_UnusedRange(json, suballocItem->offset, suballocItem->size);
-
-
-
- 9502 PrintDetailedMap_Allocation(json, suballocItem->offset, suballocItem->hAllocation);
-
-
-
- 9506 PrintDetailedMap_End(json);
-
-
-
-
- 9511 bool VmaBlockMetadata_Generic::CreateAllocationRequest(
- 9512 uint32_t currentFrameIndex,
- 9513 uint32_t frameInUseCount,
- 9514 VkDeviceSize bufferImageGranularity,
- 9515 VkDeviceSize allocSize,
- 9516 VkDeviceSize allocAlignment,
-
- 9518 VmaSuballocationType allocType,
- 9519 bool canMakeOtherLost,
-
- 9521 VmaAllocationRequest* pAllocationRequest)
-
- 9523 VMA_ASSERT(allocSize > 0);
- 9524 VMA_ASSERT(!upperAddress);
- 9525 VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
- 9526 VMA_ASSERT(pAllocationRequest != VMA_NULL);
- 9527 VMA_HEAVY_ASSERT(Validate());
-
- 9529 pAllocationRequest->type = VmaAllocationRequestType::Normal;
-
-
- 9532 if(canMakeOtherLost ==
false &&
- 9533 m_SumFreeSize < allocSize + 2 * VMA_DEBUG_MARGIN)
-
-
-
-
-
- 9539 const size_t freeSuballocCount = m_FreeSuballocationsBySize.size();
- 9540 if(freeSuballocCount > 0)
-
-
-
-
- 9545 VmaSuballocationList::iterator*
const it = VmaBinaryFindFirstNotLess(
- 9546 m_FreeSuballocationsBySize.data(),
- 9547 m_FreeSuballocationsBySize.data() + freeSuballocCount,
- 9548 allocSize + 2 * VMA_DEBUG_MARGIN,
- 9549 VmaSuballocationItemSizeLess());
- 9550 size_t index = it - m_FreeSuballocationsBySize.data();
- 9551 for(; index < freeSuballocCount; ++index)
-
-
-
-
- 9556 bufferImageGranularity,
-
-
-
- 9560 m_FreeSuballocationsBySize[index],
-
- 9562 &pAllocationRequest->offset,
- 9563 &pAllocationRequest->itemsToMakeLostCount,
- 9564 &pAllocationRequest->sumFreeSize,
- 9565 &pAllocationRequest->sumItemSize))
-
- 9567 pAllocationRequest->item = m_FreeSuballocationsBySize[index];
-
-
-
-
- 9572 else if(strategy == VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET)
-
- 9574 for(VmaSuballocationList::iterator it = m_Suballocations.begin();
- 9575 it != m_Suballocations.end();
-
-
- 9578 if(it->type == VMA_SUBALLOCATION_TYPE_FREE && CheckAllocation(
-
-
- 9581 bufferImageGranularity,
-
-
-
-
-
- 9587 &pAllocationRequest->offset,
- 9588 &pAllocationRequest->itemsToMakeLostCount,
- 9589 &pAllocationRequest->sumFreeSize,
- 9590 &pAllocationRequest->sumItemSize))
-
- 9592 pAllocationRequest->item = it;
-
-
-
-
-
-
-
- 9600 for(
size_t index = freeSuballocCount; index--; )
-
-
-
-
- 9605 bufferImageGranularity,
-
-
-
- 9609 m_FreeSuballocationsBySize[index],
-
- 9611 &pAllocationRequest->offset,
- 9612 &pAllocationRequest->itemsToMakeLostCount,
- 9613 &pAllocationRequest->sumFreeSize,
- 9614 &pAllocationRequest->sumItemSize))
-
- 9616 pAllocationRequest->item = m_FreeSuballocationsBySize[index];
-
-
-
-
-
-
- 9623 if(canMakeOtherLost)
-
-
-
-
- 9628 VmaAllocationRequest tmpAllocRequest = {};
- 9629 tmpAllocRequest.type = VmaAllocationRequestType::Normal;
- 9630 for(VmaSuballocationList::iterator suballocIt = m_Suballocations.begin();
- 9631 suballocIt != m_Suballocations.end();
-
-
- 9634 if(suballocIt->type == VMA_SUBALLOCATION_TYPE_FREE ||
- 9635 suballocIt->hAllocation->CanBecomeLost())
-
-
-
-
- 9640 bufferImageGranularity,
-
-
-
-
-
- 9646 &tmpAllocRequest.offset,
- 9647 &tmpAllocRequest.itemsToMakeLostCount,
- 9648 &tmpAllocRequest.sumFreeSize,
- 9649 &tmpAllocRequest.sumItemSize))
-
-
-
- 9653 *pAllocationRequest = tmpAllocRequest;
- 9654 pAllocationRequest->item = suballocIt;
-
-
- 9657 if(!found || tmpAllocRequest.CalcCost() < pAllocationRequest->CalcCost())
-
- 9659 *pAllocationRequest = tmpAllocRequest;
- 9660 pAllocationRequest->item = suballocIt;
-
-
-
-
-
-
-
-
-
-
-
-
- 9673 bool VmaBlockMetadata_Generic::MakeRequestedAllocationsLost(
- 9674 uint32_t currentFrameIndex,
- 9675 uint32_t frameInUseCount,
- 9676 VmaAllocationRequest* pAllocationRequest)
-
- 9678 VMA_ASSERT(pAllocationRequest && pAllocationRequest->type == VmaAllocationRequestType::Normal);
+ 9486 const uint32_t rangeCount = (uint32_t)m_Suballocations.size();
+
+ 9488 inoutStats.
size += GetSize();
+
+
+
+
+
+
+ 9495 #if VMA_STATS_STRING_ENABLED
+
+ 9497 void VmaBlockMetadata_Generic::PrintDetailedMap(
class VmaJsonWriter& json)
const
+
+ 9499 PrintDetailedMap_Begin(json,
+
+ 9501 m_Suballocations.size() - (
size_t)m_FreeCount,
+
+
+
+ 9505 for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin();
+ 9506 suballocItem != m_Suballocations.cend();
+ 9507 ++suballocItem, ++i)
+
+ 9509 if(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+
+ 9511 PrintDetailedMap_UnusedRange(json, suballocItem->offset, suballocItem->size);
+
+
+
+ 9515 PrintDetailedMap_Allocation(json, suballocItem->offset, suballocItem->hAllocation);
+
+
+
+ 9519 PrintDetailedMap_End(json);
+
+
+
+
+ 9524 bool VmaBlockMetadata_Generic::CreateAllocationRequest(
+ 9525 uint32_t currentFrameIndex,
+ 9526 uint32_t frameInUseCount,
+ 9527 VkDeviceSize bufferImageGranularity,
+ 9528 VkDeviceSize allocSize,
+ 9529 VkDeviceSize allocAlignment,
+
+ 9531 VmaSuballocationType allocType,
+ 9532 bool canMakeOtherLost,
+
+ 9534 VmaAllocationRequest* pAllocationRequest)
+
+ 9536 VMA_ASSERT(allocSize > 0);
+ 9537 VMA_ASSERT(!upperAddress);
+ 9538 VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
+ 9539 VMA_ASSERT(pAllocationRequest != VMA_NULL);
+ 9540 VMA_HEAVY_ASSERT(Validate());
+
+ 9542 pAllocationRequest->type = VmaAllocationRequestType::Normal;
+
+
+ 9545 if(canMakeOtherLost ==
false &&
+ 9546 m_SumFreeSize < allocSize + 2 * VMA_DEBUG_MARGIN)
+
+
+
+
+
+ 9552 const size_t freeSuballocCount = m_FreeSuballocationsBySize.size();
+ 9553 if(freeSuballocCount > 0)
+
+
+
+
+ 9558 VmaSuballocationList::iterator*
const it = VmaBinaryFindFirstNotLess(
+ 9559 m_FreeSuballocationsBySize.data(),
+ 9560 m_FreeSuballocationsBySize.data() + freeSuballocCount,
+ 9561 allocSize + 2 * VMA_DEBUG_MARGIN,
+ 9562 VmaSuballocationItemSizeLess());
+ 9563 size_t index = it - m_FreeSuballocationsBySize.data();
+ 9564 for(; index < freeSuballocCount; ++index)
+
+
+
+
+ 9569 bufferImageGranularity,
+
+
+
+ 9573 m_FreeSuballocationsBySize[index],
+
+ 9575 &pAllocationRequest->offset,
+ 9576 &pAllocationRequest->itemsToMakeLostCount,
+ 9577 &pAllocationRequest->sumFreeSize,
+ 9578 &pAllocationRequest->sumItemSize))
+
+ 9580 pAllocationRequest->item = m_FreeSuballocationsBySize[index];
+
+
+
+
+ 9585 else if(strategy == VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET)
+
+ 9587 for(VmaSuballocationList::iterator it = m_Suballocations.begin();
+ 9588 it != m_Suballocations.end();
+
+
+ 9591 if(it->type == VMA_SUBALLOCATION_TYPE_FREE && CheckAllocation(
+
+
+ 9594 bufferImageGranularity,
+
+
+
+
+
+ 9600 &pAllocationRequest->offset,
+ 9601 &pAllocationRequest->itemsToMakeLostCount,
+ 9602 &pAllocationRequest->sumFreeSize,
+ 9603 &pAllocationRequest->sumItemSize))
+
+ 9605 pAllocationRequest->item = it;
+
+
+
+
+
+
+
+ 9613 for(
size_t index = freeSuballocCount; index--; )
+
+
+
+
+ 9618 bufferImageGranularity,
+
+
+
+ 9622 m_FreeSuballocationsBySize[index],
+
+ 9624 &pAllocationRequest->offset,
+ 9625 &pAllocationRequest->itemsToMakeLostCount,
+ 9626 &pAllocationRequest->sumFreeSize,
+ 9627 &pAllocationRequest->sumItemSize))
+
+ 9629 pAllocationRequest->item = m_FreeSuballocationsBySize[index];
+
+
+
+
+
+
+ 9636 if(canMakeOtherLost)
+
+
+
+
+ 9641 VmaAllocationRequest tmpAllocRequest = {};
+ 9642 tmpAllocRequest.type = VmaAllocationRequestType::Normal;
+ 9643 for(VmaSuballocationList::iterator suballocIt = m_Suballocations.begin();
+ 9644 suballocIt != m_Suballocations.end();
+
+
+ 9647 if(suballocIt->type == VMA_SUBALLOCATION_TYPE_FREE ||
+ 9648 suballocIt->hAllocation->CanBecomeLost())
+
+
+
+
+ 9653 bufferImageGranularity,
+
+
+
+
+
+ 9659 &tmpAllocRequest.offset,
+ 9660 &tmpAllocRequest.itemsToMakeLostCount,
+ 9661 &tmpAllocRequest.sumFreeSize,
+ 9662 &tmpAllocRequest.sumItemSize))
+
+
+
+ 9666 *pAllocationRequest = tmpAllocRequest;
+ 9667 pAllocationRequest->item = suballocIt;
+
+
+ 9670 if(!found || tmpAllocRequest.CalcCost() < pAllocationRequest->CalcCost())
+
+ 9672 *pAllocationRequest = tmpAllocRequest;
+ 9673 pAllocationRequest->item = suballocIt;
+
+
+
+
+
- 9680 while(pAllocationRequest->itemsToMakeLostCount > 0)
-
- 9682 if(pAllocationRequest->item->type == VMA_SUBALLOCATION_TYPE_FREE)
-
- 9684 ++pAllocationRequest->item;
-
- 9686 VMA_ASSERT(pAllocationRequest->item != m_Suballocations.end());
- 9687 VMA_ASSERT(pAllocationRequest->item->hAllocation != VK_NULL_HANDLE);
- 9688 VMA_ASSERT(pAllocationRequest->item->hAllocation->CanBecomeLost());
- 9689 if(pAllocationRequest->item->hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
-
- 9691 pAllocationRequest->item = FreeSuballocation(pAllocationRequest->item);
- 9692 --pAllocationRequest->itemsToMakeLostCount;
-
-
-
-
-
-
-
- 9700 VMA_HEAVY_ASSERT(Validate());
- 9701 VMA_ASSERT(pAllocationRequest->item != m_Suballocations.end());
- 9702 VMA_ASSERT(pAllocationRequest->item->type == VMA_SUBALLOCATION_TYPE_FREE);
-
-
-
-
- 9707 uint32_t VmaBlockMetadata_Generic::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
-
- 9709 uint32_t lostAllocationCount = 0;
- 9710 for(VmaSuballocationList::iterator it = m_Suballocations.begin();
- 9711 it != m_Suballocations.end();
-
-
- 9714 if(it->type != VMA_SUBALLOCATION_TYPE_FREE &&
- 9715 it->hAllocation->CanBecomeLost() &&
- 9716 it->hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
-
- 9718 it = FreeSuballocation(it);
- 9719 ++lostAllocationCount;
-
-
- 9722 return lostAllocationCount;
-
-
- 9725 VkResult VmaBlockMetadata_Generic::CheckCorruption(
const void* pBlockData)
-
- 9727 for(VmaSuballocationList::iterator it = m_Suballocations.begin();
- 9728 it != m_Suballocations.end();
-
-
- 9731 if(it->type != VMA_SUBALLOCATION_TYPE_FREE)
-
- 9733 if(!VmaValidateMagicValue(pBlockData, it->offset - VMA_DEBUG_MARGIN))
-
- 9735 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED BEFORE VALIDATED ALLOCATION!");
- 9736 return VK_ERROR_VALIDATION_FAILED_EXT;
-
- 9738 if(!VmaValidateMagicValue(pBlockData, it->offset + it->size))
-
- 9740 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
- 9741 return VK_ERROR_VALIDATION_FAILED_EXT;
-
-
-
-
-
-
-
- 9749 void VmaBlockMetadata_Generic::Alloc(
- 9750 const VmaAllocationRequest& request,
- 9751 VmaSuballocationType type,
- 9752 VkDeviceSize allocSize,
-
-
- 9755 VMA_ASSERT(request.type == VmaAllocationRequestType::Normal);
- 9756 VMA_ASSERT(request.item != m_Suballocations.end());
- 9757 VmaSuballocation& suballoc = *request.item;
-
- 9759 VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
-
- 9761 VMA_ASSERT(request.offset >= suballoc.offset);
- 9762 const VkDeviceSize paddingBegin = request.offset - suballoc.offset;
- 9763 VMA_ASSERT(suballoc.size >= paddingBegin + allocSize);
- 9764 const VkDeviceSize paddingEnd = suballoc.size - paddingBegin - allocSize;
-
-
-
- 9768 UnregisterFreeSuballocation(request.item);
-
- 9770 suballoc.offset = request.offset;
- 9771 suballoc.size = allocSize;
- 9772 suballoc.type = type;
- 9773 suballoc.hAllocation = hAllocation;
-
-
-
-
- 9778 VmaSuballocation paddingSuballoc = {};
- 9779 paddingSuballoc.offset = request.offset + allocSize;
- 9780 paddingSuballoc.size = paddingEnd;
- 9781 paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
- 9782 VmaSuballocationList::iterator next = request.item;
-
- 9784 const VmaSuballocationList::iterator paddingEndItem =
- 9785 m_Suballocations.insert(next, paddingSuballoc);
- 9786 RegisterFreeSuballocation(paddingEndItem);
-
-
-
-
-
- 9792 VmaSuballocation paddingSuballoc = {};
- 9793 paddingSuballoc.offset = request.offset - paddingBegin;
- 9794 paddingSuballoc.size = paddingBegin;
- 9795 paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
- 9796 const VmaSuballocationList::iterator paddingBeginItem =
- 9797 m_Suballocations.insert(request.item, paddingSuballoc);
- 9798 RegisterFreeSuballocation(paddingBeginItem);
-
-
-
- 9802 m_FreeCount = m_FreeCount - 1;
- 9803 if(paddingBegin > 0)
+
+
+
+
+
+
+ 9686 bool VmaBlockMetadata_Generic::MakeRequestedAllocationsLost(
+ 9687 uint32_t currentFrameIndex,
+ 9688 uint32_t frameInUseCount,
+ 9689 VmaAllocationRequest* pAllocationRequest)
+
+ 9691 VMA_ASSERT(pAllocationRequest && pAllocationRequest->type == VmaAllocationRequestType::Normal);
+
+ 9693 while(pAllocationRequest->itemsToMakeLostCount > 0)
+
+ 9695 if(pAllocationRequest->item->type == VMA_SUBALLOCATION_TYPE_FREE)
+
+ 9697 ++pAllocationRequest->item;
+
+ 9699 VMA_ASSERT(pAllocationRequest->item != m_Suballocations.end());
+ 9700 VMA_ASSERT(pAllocationRequest->item->hAllocation != VK_NULL_HANDLE);
+ 9701 VMA_ASSERT(pAllocationRequest->item->hAllocation->CanBecomeLost());
+ 9702 if(pAllocationRequest->item->hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+
+ 9704 pAllocationRequest->item = FreeSuballocation(pAllocationRequest->item);
+ 9705 --pAllocationRequest->itemsToMakeLostCount;
+
+
+
+
+
+
+
+ 9713 VMA_HEAVY_ASSERT(Validate());
+ 9714 VMA_ASSERT(pAllocationRequest->item != m_Suballocations.end());
+ 9715 VMA_ASSERT(pAllocationRequest->item->type == VMA_SUBALLOCATION_TYPE_FREE);
+
+
+
+
+ 9720 uint32_t VmaBlockMetadata_Generic::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
+
+ 9722 uint32_t lostAllocationCount = 0;
+ 9723 for(VmaSuballocationList::iterator it = m_Suballocations.begin();
+ 9724 it != m_Suballocations.end();
+
+
+ 9727 if(it->type != VMA_SUBALLOCATION_TYPE_FREE &&
+ 9728 it->hAllocation->CanBecomeLost() &&
+ 9729 it->hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+
+ 9731 it = FreeSuballocation(it);
+ 9732 ++lostAllocationCount;
+
+
+ 9735 return lostAllocationCount;
+
+
+ 9738 VkResult VmaBlockMetadata_Generic::CheckCorruption(
const void* pBlockData)
+
+ 9740 for(VmaSuballocationList::iterator it = m_Suballocations.begin();
+ 9741 it != m_Suballocations.end();
+
+
+ 9744 if(it->type != VMA_SUBALLOCATION_TYPE_FREE)
+
+ 9746 if(!VmaValidateMagicValue(pBlockData, it->offset - VMA_DEBUG_MARGIN))
+
+ 9748 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED BEFORE VALIDATED ALLOCATION!");
+ 9749 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+ 9751 if(!VmaValidateMagicValue(pBlockData, it->offset + it->size))
+
+ 9753 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
+ 9754 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+
+
+
+
+
+
+ 9762 void VmaBlockMetadata_Generic::Alloc(
+ 9763 const VmaAllocationRequest& request,
+ 9764 VmaSuballocationType type,
+ 9765 VkDeviceSize allocSize,
+
+
+ 9768 VMA_ASSERT(request.type == VmaAllocationRequestType::Normal);
+ 9769 VMA_ASSERT(request.item != m_Suballocations.end());
+ 9770 VmaSuballocation& suballoc = *request.item;
+
+ 9772 VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ 9774 VMA_ASSERT(request.offset >= suballoc.offset);
+ 9775 const VkDeviceSize paddingBegin = request.offset - suballoc.offset;
+ 9776 VMA_ASSERT(suballoc.size >= paddingBegin + allocSize);
+ 9777 const VkDeviceSize paddingEnd = suballoc.size - paddingBegin - allocSize;
+
+
+
+ 9781 UnregisterFreeSuballocation(request.item);
+
+ 9783 suballoc.offset = request.offset;
+ 9784 suballoc.size = allocSize;
+ 9785 suballoc.type = type;
+ 9786 suballoc.hAllocation = hAllocation;
+
+
+
+
+ 9791 VmaSuballocation paddingSuballoc = {};
+ 9792 paddingSuballoc.offset = request.offset + allocSize;
+ 9793 paddingSuballoc.size = paddingEnd;
+ 9794 paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ 9795 VmaSuballocationList::iterator next = request.item;
+
+ 9797 const VmaSuballocationList::iterator paddingEndItem =
+ 9798 m_Suballocations.insert(next, paddingSuballoc);
+ 9799 RegisterFreeSuballocation(paddingEndItem);
+
+
+
+
-
-
-
-
-
-
- 9811 m_SumFreeSize -= allocSize;
-
+ 9805 VmaSuballocation paddingSuballoc = {};
+ 9806 paddingSuballoc.offset = request.offset - paddingBegin;
+ 9807 paddingSuballoc.size = paddingBegin;
+ 9808 paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ 9809 const VmaSuballocationList::iterator paddingBeginItem =
+ 9810 m_Suballocations.insert(request.item, paddingSuballoc);
+ 9811 RegisterFreeSuballocation(paddingBeginItem);
+
- 9814 void VmaBlockMetadata_Generic::Free(
const VmaAllocation allocation)
-
- 9816 for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin();
- 9817 suballocItem != m_Suballocations.end();
-
-
- 9820 VmaSuballocation& suballoc = *suballocItem;
- 9821 if(suballoc.hAllocation == allocation)
-
- 9823 FreeSuballocation(suballocItem);
- 9824 VMA_HEAVY_ASSERT(Validate());
-
-
-
- 9828 VMA_ASSERT(0 &&
"Not found!");
-
-
- 9831 void VmaBlockMetadata_Generic::FreeAtOffset(VkDeviceSize offset)
-
- 9833 for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin();
- 9834 suballocItem != m_Suballocations.end();
-
-
- 9837 VmaSuballocation& suballoc = *suballocItem;
- 9838 if(suballoc.offset == offset)
-
- 9840 FreeSuballocation(suballocItem);
-
-
-
- 9844 VMA_ASSERT(0 &&
"Not found!");
-
-
- 9847 bool VmaBlockMetadata_Generic::ValidateFreeSuballocationList()
const
-
- 9849 VkDeviceSize lastSize = 0;
- 9850 for(
size_t i = 0, count = m_FreeSuballocationsBySize.size(); i < count; ++i)
-
- 9852 const VmaSuballocationList::iterator it = m_FreeSuballocationsBySize[i];
-
- 9854 VMA_VALIDATE(it->type == VMA_SUBALLOCATION_TYPE_FREE);
- 9855 VMA_VALIDATE(it->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER);
- 9856 VMA_VALIDATE(it->size >= lastSize);
- 9857 lastSize = it->size;
-
-
-
-
- 9862 bool VmaBlockMetadata_Generic::CheckAllocation(
- 9863 uint32_t currentFrameIndex,
- 9864 uint32_t frameInUseCount,
- 9865 VkDeviceSize bufferImageGranularity,
- 9866 VkDeviceSize allocSize,
- 9867 VkDeviceSize allocAlignment,
- 9868 VmaSuballocationType allocType,
- 9869 VmaSuballocationList::const_iterator suballocItem,
- 9870 bool canMakeOtherLost,
- 9871 VkDeviceSize* pOffset,
- 9872 size_t* itemsToMakeLostCount,
- 9873 VkDeviceSize* pSumFreeSize,
- 9874 VkDeviceSize* pSumItemSize)
const
-
- 9876 VMA_ASSERT(allocSize > 0);
- 9877 VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
- 9878 VMA_ASSERT(suballocItem != m_Suballocations.cend());
- 9879 VMA_ASSERT(pOffset != VMA_NULL);
-
- 9881 *itemsToMakeLostCount = 0;
-
-
-
- 9885 if(canMakeOtherLost)
-
- 9887 if(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE)
-
- 9889 *pSumFreeSize = suballocItem->size;
-
-
-
- 9893 if(suballocItem->hAllocation->CanBecomeLost() &&
- 9894 suballocItem->hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
-
- 9896 ++*itemsToMakeLostCount;
- 9897 *pSumItemSize = suballocItem->size;
-
-
-
-
-
+
+ 9815 m_FreeCount = m_FreeCount - 1;
+ 9816 if(paddingBegin > 0)
+
+
+
+
+
+
+
+ 9824 m_SumFreeSize -= allocSize;
+
+
+ 9827 void VmaBlockMetadata_Generic::Free(
const VmaAllocation allocation)
+
+ 9829 for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin();
+ 9830 suballocItem != m_Suballocations.end();
+
+
+ 9833 VmaSuballocation& suballoc = *suballocItem;
+ 9834 if(suballoc.hAllocation == allocation)
+
+ 9836 FreeSuballocation(suballocItem);
+ 9837 VMA_HEAVY_ASSERT(Validate());
+
+
+
+ 9841 VMA_ASSERT(0 &&
"Not found!");
+
+
+ 9844 void VmaBlockMetadata_Generic::FreeAtOffset(VkDeviceSize offset)
+
+ 9846 for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin();
+ 9847 suballocItem != m_Suballocations.end();
+
+
+ 9850 VmaSuballocation& suballoc = *suballocItem;
+ 9851 if(suballoc.offset == offset)
+
+ 9853 FreeSuballocation(suballocItem);
+
+
+
+ 9857 VMA_ASSERT(0 &&
"Not found!");
+
+
+ 9860 bool VmaBlockMetadata_Generic::ValidateFreeSuballocationList()
const
+
+ 9862 VkDeviceSize lastSize = 0;
+ 9863 for(
size_t i = 0, count = m_FreeSuballocationsBySize.size(); i < count; ++i)
+
+ 9865 const VmaSuballocationList::iterator it = m_FreeSuballocationsBySize[i];
+
+ 9867 VMA_VALIDATE(it->type == VMA_SUBALLOCATION_TYPE_FREE);
+ 9868 VMA_VALIDATE(it->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER);
+ 9869 VMA_VALIDATE(it->size >= lastSize);
+ 9870 lastSize = it->size;
+
+
+
+
+ 9875 bool VmaBlockMetadata_Generic::CheckAllocation(
+ 9876 uint32_t currentFrameIndex,
+ 9877 uint32_t frameInUseCount,
+ 9878 VkDeviceSize bufferImageGranularity,
+ 9879 VkDeviceSize allocSize,
+ 9880 VkDeviceSize allocAlignment,
+ 9881 VmaSuballocationType allocType,
+ 9882 VmaSuballocationList::const_iterator suballocItem,
+ 9883 bool canMakeOtherLost,
+ 9884 VkDeviceSize* pOffset,
+ 9885 size_t* itemsToMakeLostCount,
+ 9886 VkDeviceSize* pSumFreeSize,
+ 9887 VkDeviceSize* pSumItemSize)
const
+
+ 9889 VMA_ASSERT(allocSize > 0);
+ 9890 VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
+ 9891 VMA_ASSERT(suballocItem != m_Suballocations.cend());
+ 9892 VMA_ASSERT(pOffset != VMA_NULL);
+
+ 9894 *itemsToMakeLostCount = 0;
+
+
+
+ 9898 if(canMakeOtherLost)
+
+ 9900 if(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+
+ 9902 *pSumFreeSize = suballocItem->size;
-
-
- 9906 if(GetSize() - suballocItem->offset < allocSize)
-
-
-
-
-
- 9912 *pOffset = suballocItem->offset;
-
-
- 9915 if(VMA_DEBUG_MARGIN > 0)
-
- 9917 *pOffset += VMA_DEBUG_MARGIN;
-
-
-
- 9921 *pOffset = VmaAlignUp(*pOffset, allocAlignment);
-
-
-
- 9925 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment)
-
- 9927 bool bufferImageGranularityConflict =
false;
- 9928 VmaSuballocationList::const_iterator prevSuballocItem = suballocItem;
- 9929 while(prevSuballocItem != m_Suballocations.cbegin())
-
-
- 9932 const VmaSuballocation& prevSuballoc = *prevSuballocItem;
- 9933 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, *pOffset, bufferImageGranularity))
-
- 9935 if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
-
- 9937 bufferImageGranularityConflict =
true;
-
-
-
-
-
-
-
- 9945 if(bufferImageGranularityConflict)
-
- 9947 *pOffset = VmaAlignUp(*pOffset, bufferImageGranularity);
-
-
-
-
-
- 9953 if(*pOffset >= suballocItem->offset + suballocItem->size)
-
-
-
-
-
- 9959 const VkDeviceSize paddingBegin = *pOffset - suballocItem->offset;
-
-
- 9962 const VkDeviceSize requiredEndMargin = VMA_DEBUG_MARGIN;
+
+
+ 9906 if(suballocItem->hAllocation->CanBecomeLost() &&
+ 9907 suballocItem->hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+
+ 9909 ++*itemsToMakeLostCount;
+ 9910 *pSumItemSize = suballocItem->size;
+
+
+
+
+
+
+
+
+ 9919 if(GetSize() - suballocItem->offset < allocSize)
+
+
+
+
+
+ 9925 *pOffset = suballocItem->offset;
+
+
+ 9928 if(VMA_DEBUG_MARGIN > 0)
+
+ 9930 *pOffset += VMA_DEBUG_MARGIN;
+
+
+
+ 9934 *pOffset = VmaAlignUp(*pOffset, allocAlignment);
+
+
+
+ 9938 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment)
+
+ 9940 bool bufferImageGranularityConflict =
false;
+ 9941 VmaSuballocationList::const_iterator prevSuballocItem = suballocItem;
+ 9942 while(prevSuballocItem != m_Suballocations.cbegin())
+
+
+ 9945 const VmaSuballocation& prevSuballoc = *prevSuballocItem;
+ 9946 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, *pOffset, bufferImageGranularity))
+
+ 9948 if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
+
+ 9950 bufferImageGranularityConflict =
true;
+
+
+
+
+
+
+
+ 9958 if(bufferImageGranularityConflict)
+
+ 9960 *pOffset = VmaAlignUp(*pOffset, bufferImageGranularity);
+
+
- 9964 const VkDeviceSize totalSize = paddingBegin + allocSize + requiredEndMargin;
-
- 9966 if(suballocItem->offset + totalSize > GetSize())
+
+
+ 9966 if(*pOffset >= suballocItem->offset + suballocItem->size)
-
-
- 9973 VmaSuballocationList::const_iterator lastSuballocItem = suballocItem;
- 9974 if(totalSize > suballocItem->size)
-
- 9976 VkDeviceSize remainingSize = totalSize - suballocItem->size;
- 9977 while(remainingSize > 0)
-
-
- 9980 if(lastSuballocItem == m_Suballocations.cend())
-
-
-
- 9984 if(lastSuballocItem->type == VMA_SUBALLOCATION_TYPE_FREE)
-
- 9986 *pSumFreeSize += lastSuballocItem->size;
-
-
-
- 9990 VMA_ASSERT(lastSuballocItem->hAllocation != VK_NULL_HANDLE);
- 9991 if(lastSuballocItem->hAllocation->CanBecomeLost() &&
- 9992 lastSuballocItem->hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
-
- 9994 ++*itemsToMakeLostCount;
- 9995 *pSumItemSize += lastSuballocItem->size;
-
-
-
-
-
-
-10002 remainingSize = (lastSuballocItem->size < remainingSize) ?
-10003 remainingSize - lastSuballocItem->size : 0;
-
-
-
-
-
-10009 if(allocSize % bufferImageGranularity || *pOffset % bufferImageGranularity)
-
-10011 VmaSuballocationList::const_iterator nextSuballocItem = lastSuballocItem;
-10012 ++nextSuballocItem;
-10013 while(nextSuballocItem != m_Suballocations.cend())
-
-10015 const VmaSuballocation& nextSuballoc = *nextSuballocItem;
-10016 if(VmaBlocksOnSamePage(*pOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
-
-10018 if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
-
-10020 VMA_ASSERT(nextSuballoc.hAllocation != VK_NULL_HANDLE);
-10021 if(nextSuballoc.hAllocation->CanBecomeLost() &&
-10022 nextSuballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
-
-10024 ++*itemsToMakeLostCount;
-
-
-
-
-
-
-
-
-
-
-
-
-10037 ++nextSuballocItem;
-
-
-
-
-
-10043 const VmaSuballocation& suballoc = *suballocItem;
-10044 VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
-
-10046 *pSumFreeSize = suballoc.size;
-
-
-10049 if(suballoc.size < allocSize)
-
-
+
+ 9972 const VkDeviceSize paddingBegin = *pOffset - suballocItem->offset;
+
+
+ 9975 const VkDeviceSize requiredEndMargin = VMA_DEBUG_MARGIN;
+
+ 9977 const VkDeviceSize totalSize = paddingBegin + allocSize + requiredEndMargin;
+
+ 9979 if(suballocItem->offset + totalSize > GetSize())
+
+
+
+
+
+
+ 9986 VmaSuballocationList::const_iterator lastSuballocItem = suballocItem;
+ 9987 if(totalSize > suballocItem->size)
+
+ 9989 VkDeviceSize remainingSize = totalSize - suballocItem->size;
+ 9990 while(remainingSize > 0)
+
+
+ 9993 if(lastSuballocItem == m_Suballocations.cend())
+
+
+
+ 9997 if(lastSuballocItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+
+ 9999 *pSumFreeSize += lastSuballocItem->size;
+
+
+
+10003 VMA_ASSERT(lastSuballocItem->hAllocation != VK_NULL_HANDLE);
+10004 if(lastSuballocItem->hAllocation->CanBecomeLost() &&
+10005 lastSuballocItem->hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+
+10007 ++*itemsToMakeLostCount;
+10008 *pSumItemSize += lastSuballocItem->size;
+
+
+
+
+
+
+10015 remainingSize = (lastSuballocItem->size < remainingSize) ?
+10016 remainingSize - lastSuballocItem->size : 0;
+
+
+
+
+
+10022 if(allocSize % bufferImageGranularity || *pOffset % bufferImageGranularity)
+
+10024 VmaSuballocationList::const_iterator nextSuballocItem = lastSuballocItem;
+10025 ++nextSuballocItem;
+10026 while(nextSuballocItem != m_Suballocations.cend())
+
+10028 const VmaSuballocation& nextSuballoc = *nextSuballocItem;
+10029 if(VmaBlocksOnSamePage(*pOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+
+10031 if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
+
+10033 VMA_ASSERT(nextSuballoc.hAllocation != VK_NULL_HANDLE);
+10034 if(nextSuballoc.hAllocation->CanBecomeLost() &&
+10035 nextSuballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+
+10037 ++*itemsToMakeLostCount;
+
+
+
+
+
+
+
+
+
+
+
+
+10050 ++nextSuballocItem;
+
-
-
-10055 *pOffset = suballoc.offset;
-
-
-10058 if(VMA_DEBUG_MARGIN > 0)
-
-10060 *pOffset += VMA_DEBUG_MARGIN;
-
-
-
-10064 *pOffset = VmaAlignUp(*pOffset, allocAlignment);
-
-
-
-10068 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment)
-
-10070 bool bufferImageGranularityConflict =
false;
-10071 VmaSuballocationList::const_iterator prevSuballocItem = suballocItem;
-10072 while(prevSuballocItem != m_Suballocations.cbegin())
-
-10074 --prevSuballocItem;
-10075 const VmaSuballocation& prevSuballoc = *prevSuballocItem;
-10076 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, *pOffset, bufferImageGranularity))
-
-10078 if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
-
-10080 bufferImageGranularityConflict =
true;
-
-
-
-
-
-
-
-10088 if(bufferImageGranularityConflict)
-
-10090 *pOffset = VmaAlignUp(*pOffset, bufferImageGranularity);
-
-
-
-
-10095 const VkDeviceSize paddingBegin = *pOffset - suballoc.offset;
-
-
-10098 const VkDeviceSize requiredEndMargin = VMA_DEBUG_MARGIN;
-
-
-10101 if(paddingBegin + allocSize + requiredEndMargin > suballoc.size)
-
-
-
-
-
-
-10108 if(allocSize % bufferImageGranularity || *pOffset % bufferImageGranularity)
-
-10110 VmaSuballocationList::const_iterator nextSuballocItem = suballocItem;
-10111 ++nextSuballocItem;
-10112 while(nextSuballocItem != m_Suballocations.cend())
-
-10114 const VmaSuballocation& nextSuballoc = *nextSuballocItem;
-10115 if(VmaBlocksOnSamePage(*pOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
-
-10117 if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
-
-
-
-
-
-
-
-
-
-10127 ++nextSuballocItem;
-
-
-
-
-
-
-
-
-10136 void VmaBlockMetadata_Generic::MergeFreeWithNext(VmaSuballocationList::iterator item)
-
-10138 VMA_ASSERT(item != m_Suballocations.end());
-10139 VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
-
-10141 VmaSuballocationList::iterator nextItem = item;
-
-10143 VMA_ASSERT(nextItem != m_Suballocations.end());
-10144 VMA_ASSERT(nextItem->type == VMA_SUBALLOCATION_TYPE_FREE);
-
-10146 item->size += nextItem->size;
-
-10148 m_Suballocations.erase(nextItem);
-
-
-10151 VmaSuballocationList::iterator VmaBlockMetadata_Generic::FreeSuballocation(VmaSuballocationList::iterator suballocItem)
-
-
-10154 VmaSuballocation& suballoc = *suballocItem;
-10155 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
-10156 suballoc.hAllocation = VK_NULL_HANDLE;
-
-
-
-10160 m_SumFreeSize += suballoc.size;
-
-
-10163 bool mergeWithNext =
false;
-10164 bool mergeWithPrev =
false;
-
-10166 VmaSuballocationList::iterator nextItem = suballocItem;
-
-10168 if((nextItem != m_Suballocations.end()) && (nextItem->type == VMA_SUBALLOCATION_TYPE_FREE))
-
-10170 mergeWithNext =
true;
-
-
-10173 VmaSuballocationList::iterator prevItem = suballocItem;
-10174 if(suballocItem != m_Suballocations.begin())
-
-
-10177 if(prevItem->type == VMA_SUBALLOCATION_TYPE_FREE)
-
-10179 mergeWithPrev =
true;
-
-
-
-
-
-10185 UnregisterFreeSuballocation(nextItem);
-10186 MergeFreeWithNext(suballocItem);
-
-
-
-
-10191 UnregisterFreeSuballocation(prevItem);
-10192 MergeFreeWithNext(prevItem);
-10193 RegisterFreeSuballocation(prevItem);
-
-
-
+
+
+
+10056 const VmaSuballocation& suballoc = *suballocItem;
+10057 VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+10059 *pSumFreeSize = suballoc.size;
+
+
+10062 if(suballoc.size < allocSize)
+
+
+
+
+
+10068 *pOffset = suballoc.offset;
+
+
+10071 if(VMA_DEBUG_MARGIN > 0)
+
+10073 *pOffset += VMA_DEBUG_MARGIN;
+
+
+
+10077 *pOffset = VmaAlignUp(*pOffset, allocAlignment);
+
+
+
+10081 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment)
+
+10083 bool bufferImageGranularityConflict =
false;
+10084 VmaSuballocationList::const_iterator prevSuballocItem = suballocItem;
+10085 while(prevSuballocItem != m_Suballocations.cbegin())
+
+10087 --prevSuballocItem;
+10088 const VmaSuballocation& prevSuballoc = *prevSuballocItem;
+10089 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, *pOffset, bufferImageGranularity))
+
+10091 if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
+
+10093 bufferImageGranularityConflict =
true;
+
+
+
+
+
+
+
+10101 if(bufferImageGranularityConflict)
+
+10103 *pOffset = VmaAlignUp(*pOffset, bufferImageGranularity);
+
+
+
+
+10108 const VkDeviceSize paddingBegin = *pOffset - suballoc.offset;
+
+
+10111 const VkDeviceSize requiredEndMargin = VMA_DEBUG_MARGIN;
+
+
+10114 if(paddingBegin + allocSize + requiredEndMargin > suballoc.size)
+
+
+
+
+
+
+10121 if(allocSize % bufferImageGranularity || *pOffset % bufferImageGranularity)
+
+10123 VmaSuballocationList::const_iterator nextSuballocItem = suballocItem;
+10124 ++nextSuballocItem;
+10125 while(nextSuballocItem != m_Suballocations.cend())
+
+10127 const VmaSuballocation& nextSuballoc = *nextSuballocItem;
+10128 if(VmaBlocksOnSamePage(*pOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+
+10130 if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
+
+
+
+
+
+
+
+
+
+10140 ++nextSuballocItem;
+
+
+
+
+
+
+
+
+10149 void VmaBlockMetadata_Generic::MergeFreeWithNext(VmaSuballocationList::iterator item)
+
+10151 VMA_ASSERT(item != m_Suballocations.end());
+10152 VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
+
+10154 VmaSuballocationList::iterator nextItem = item;
+
+10156 VMA_ASSERT(nextItem != m_Suballocations.end());
+10157 VMA_ASSERT(nextItem->type == VMA_SUBALLOCATION_TYPE_FREE);
+
+10159 item->size += nextItem->size;
+
+10161 m_Suballocations.erase(nextItem);
+
+
+10164 VmaSuballocationList::iterator VmaBlockMetadata_Generic::FreeSuballocation(VmaSuballocationList::iterator suballocItem)
+
+
+10167 VmaSuballocation& suballoc = *suballocItem;
+10168 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+10169 suballoc.hAllocation = VK_NULL_HANDLE;
+
+
+
+10173 m_SumFreeSize += suballoc.size;
+
+
+10176 bool mergeWithNext =
false;
+10177 bool mergeWithPrev =
false;
+
+10179 VmaSuballocationList::iterator nextItem = suballocItem;
+
+10181 if((nextItem != m_Suballocations.end()) && (nextItem->type == VMA_SUBALLOCATION_TYPE_FREE))
+
+10183 mergeWithNext =
true;
+
+
+10186 VmaSuballocationList::iterator prevItem = suballocItem;
+10187 if(suballocItem != m_Suballocations.begin())
+
+
+10190 if(prevItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+
+10192 mergeWithPrev =
true;
+
+
+
+
-10198 RegisterFreeSuballocation(suballocItem);
-10199 return suballocItem;
+10198 UnregisterFreeSuballocation(nextItem);
+10199 MergeFreeWithNext(suballocItem);
-
-
-10203 void VmaBlockMetadata_Generic::RegisterFreeSuballocation(VmaSuballocationList::iterator item)
-
-10205 VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
-10206 VMA_ASSERT(item->size > 0);
-
-
-
-10210 VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
-
-10212 if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
-
-10214 if(m_FreeSuballocationsBySize.empty())
-
-10216 m_FreeSuballocationsBySize.push_back(item);
-
-
-
-10220 VmaVectorInsertSorted<VmaSuballocationItemSizeLess>(m_FreeSuballocationsBySize, item);
-
-
-
-
-
-
-
-10228 void VmaBlockMetadata_Generic::UnregisterFreeSuballocation(VmaSuballocationList::iterator item)
-
-10230 VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
-10231 VMA_ASSERT(item->size > 0);
-
-
-
-10235 VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
+
+
+
+10204 UnregisterFreeSuballocation(prevItem);
+10205 MergeFreeWithNext(prevItem);
+10206 RegisterFreeSuballocation(prevItem);
+
+
+
+
+10211 RegisterFreeSuballocation(suballocItem);
+10212 return suballocItem;
+
+
+
+10216 void VmaBlockMetadata_Generic::RegisterFreeSuballocation(VmaSuballocationList::iterator item)
+
+10218 VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
+10219 VMA_ASSERT(item->size > 0);
+
+
+
+10223 VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
+
+10225 if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+
+10227 if(m_FreeSuballocationsBySize.empty())
+
+10229 m_FreeSuballocationsBySize.push_back(item);
+
+
+
+10233 VmaVectorInsertSorted<VmaSuballocationItemSizeLess>(m_FreeSuballocationsBySize, item);
+
+
-10237 if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
-
-10239 VmaSuballocationList::iterator*
const it = VmaBinaryFindFirstNotLess(
-10240 m_FreeSuballocationsBySize.data(),
-10241 m_FreeSuballocationsBySize.data() + m_FreeSuballocationsBySize.size(),
-
-10243 VmaSuballocationItemSizeLess());
-10244 for(
size_t index = it - m_FreeSuballocationsBySize.data();
-10245 index < m_FreeSuballocationsBySize.size();
-
-
-10248 if(m_FreeSuballocationsBySize[index] == item)
-
-10250 VmaVectorRemove(m_FreeSuballocationsBySize, index);
-
-
-10253 VMA_ASSERT((m_FreeSuballocationsBySize[index]->size == item->size) &&
"Not found.");
-
-10255 VMA_ASSERT(0 &&
"Not found.");
-
-
-
-
-
-10261 bool VmaBlockMetadata_Generic::IsBufferImageGranularityConflictPossible(
-10262 VkDeviceSize bufferImageGranularity,
-10263 VmaSuballocationType& inOutPrevSuballocType)
const
-
-10265 if(bufferImageGranularity == 1 || IsEmpty())
-
-
-
-
-10270 VkDeviceSize minAlignment = VK_WHOLE_SIZE;
-10271 bool typeConflictFound =
false;
-10272 for(VmaSuballocationList::const_iterator it = m_Suballocations.cbegin();
-10273 it != m_Suballocations.cend();
-
-
-10276 const VmaSuballocationType suballocType = it->type;
-10277 if(suballocType != VMA_SUBALLOCATION_TYPE_FREE)
-
-10279 minAlignment = VMA_MIN(minAlignment, it->hAllocation->GetAlignment());
-10280 if(VmaIsBufferImageGranularityConflict(inOutPrevSuballocType, suballocType))
-
-10282 typeConflictFound =
true;
-
-10284 inOutPrevSuballocType = suballocType;
-
-
-
-10288 return typeConflictFound || minAlignment >= bufferImageGranularity;
-
-
-
-
-10294 VmaBlockMetadata_Linear::VmaBlockMetadata_Linear(
VmaAllocator hAllocator) :
-10295 VmaBlockMetadata(hAllocator),
-
-10297 m_Suballocations0(VmaStlAllocator<VmaSuballocation>(hAllocator->GetAllocationCallbacks())),
-10298 m_Suballocations1(VmaStlAllocator<VmaSuballocation>(hAllocator->GetAllocationCallbacks())),
-10299 m_1stVectorIndex(0),
-10300 m_2ndVectorMode(SECOND_VECTOR_EMPTY),
-10301 m_1stNullItemsBeginCount(0),
-10302 m_1stNullItemsMiddleCount(0),
-10303 m_2ndNullItemsCount(0)
-
-
+
+
+
+
+10241 void VmaBlockMetadata_Generic::UnregisterFreeSuballocation(VmaSuballocationList::iterator item)
+
+10243 VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
+10244 VMA_ASSERT(item->size > 0);
+
+
+
+10248 VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
+
+10250 if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+
+10252 VmaSuballocationList::iterator*
const it = VmaBinaryFindFirstNotLess(
+10253 m_FreeSuballocationsBySize.data(),
+10254 m_FreeSuballocationsBySize.data() + m_FreeSuballocationsBySize.size(),
+
+10256 VmaSuballocationItemSizeLess());
+10257 for(
size_t index = it - m_FreeSuballocationsBySize.data();
+10258 index < m_FreeSuballocationsBySize.size();
+
+
+10261 if(m_FreeSuballocationsBySize[index] == item)
+
+10263 VmaVectorRemove(m_FreeSuballocationsBySize, index);
+
+
+10266 VMA_ASSERT((m_FreeSuballocationsBySize[index]->size == item->size) &&
"Not found.");
+
+10268 VMA_ASSERT(0 &&
"Not found.");
+
+
+
+
+
+10274 bool VmaBlockMetadata_Generic::IsBufferImageGranularityConflictPossible(
+10275 VkDeviceSize bufferImageGranularity,
+10276 VmaSuballocationType& inOutPrevSuballocType)
const
+
+10278 if(bufferImageGranularity == 1 || IsEmpty())
+
+
+
+
+10283 VkDeviceSize minAlignment = VK_WHOLE_SIZE;
+10284 bool typeConflictFound =
false;
+10285 for(VmaSuballocationList::const_iterator it = m_Suballocations.cbegin();
+10286 it != m_Suballocations.cend();
+
+
+10289 const VmaSuballocationType suballocType = it->type;
+10290 if(suballocType != VMA_SUBALLOCATION_TYPE_FREE)
+
+10292 minAlignment = VMA_MIN(minAlignment, it->hAllocation->GetAlignment());
+10293 if(VmaIsBufferImageGranularityConflict(inOutPrevSuballocType, suballocType))
+
+10295 typeConflictFound =
true;
+
+10297 inOutPrevSuballocType = suballocType;
+
+
+
+10301 return typeConflictFound || minAlignment >= bufferImageGranularity;
+
+
+
-10307 VmaBlockMetadata_Linear::~VmaBlockMetadata_Linear()
-
-
-
-10311 void VmaBlockMetadata_Linear::Init(VkDeviceSize size)
-
-10313 VmaBlockMetadata::Init(size);
-10314 m_SumFreeSize = size;
-
-
-10317 bool VmaBlockMetadata_Linear::Validate()
const
-
-10319 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-10320 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-
-10322 VMA_VALIDATE(suballocations2nd.empty() == (m_2ndVectorMode == SECOND_VECTOR_EMPTY));
-10323 VMA_VALIDATE(!suballocations1st.empty() ||
-10324 suballocations2nd.empty() ||
-10325 m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER);
-
-10327 if(!suballocations1st.empty())
-
-
-10330 VMA_VALIDATE(suballocations1st[m_1stNullItemsBeginCount].hAllocation != VK_NULL_HANDLE);
-
-10332 VMA_VALIDATE(suballocations1st.back().hAllocation != VK_NULL_HANDLE);
-
-10334 if(!suballocations2nd.empty())
-
-
-10337 VMA_VALIDATE(suballocations2nd.back().hAllocation != VK_NULL_HANDLE);
-
+10307 VmaBlockMetadata_Linear::VmaBlockMetadata_Linear(
VmaAllocator hAllocator) :
+10308 VmaBlockMetadata(hAllocator),
+
+10310 m_Suballocations0(VmaStlAllocator<VmaSuballocation>(hAllocator->GetAllocationCallbacks())),
+10311 m_Suballocations1(VmaStlAllocator<VmaSuballocation>(hAllocator->GetAllocationCallbacks())),
+10312 m_1stVectorIndex(0),
+10313 m_2ndVectorMode(SECOND_VECTOR_EMPTY),
+10314 m_1stNullItemsBeginCount(0),
+10315 m_1stNullItemsMiddleCount(0),
+10316 m_2ndNullItemsCount(0)
+
+
+
+10320 VmaBlockMetadata_Linear::~VmaBlockMetadata_Linear()
+
+
+
+10324 void VmaBlockMetadata_Linear::Init(VkDeviceSize size)
+
+10326 VmaBlockMetadata::Init(size);
+10327 m_SumFreeSize = size;
+
+
+10330 bool VmaBlockMetadata_Linear::Validate()
const
+
+10332 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+10333 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+10335 VMA_VALIDATE(suballocations2nd.empty() == (m_2ndVectorMode == SECOND_VECTOR_EMPTY));
+10336 VMA_VALIDATE(!suballocations1st.empty() ||
+10337 suballocations2nd.empty() ||
+10338 m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER);
-10340 VMA_VALIDATE(m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount <= suballocations1st.size());
-10341 VMA_VALIDATE(m_2ndNullItemsCount <= suballocations2nd.size());
-
-10343 VkDeviceSize sumUsedSize = 0;
-10344 const size_t suballoc1stCount = suballocations1st.size();
-10345 VkDeviceSize offset = VMA_DEBUG_MARGIN;
-
-10347 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+10340 if(!suballocations1st.empty())
+
+
+10343 VMA_VALIDATE(suballocations1st[m_1stNullItemsBeginCount].hAllocation != VK_NULL_HANDLE);
+
+10345 VMA_VALIDATE(suballocations1st.back().hAllocation != VK_NULL_HANDLE);
+
+10347 if(!suballocations2nd.empty())
-10349 const size_t suballoc2ndCount = suballocations2nd.size();
-10350 size_t nullItem2ndCount = 0;
-10351 for(
size_t i = 0; i < suballoc2ndCount; ++i)
-
-10353 const VmaSuballocation& suballoc = suballocations2nd[i];
-10354 const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+10350 VMA_VALIDATE(suballocations2nd.back().hAllocation != VK_NULL_HANDLE);
+
+
+10353 VMA_VALIDATE(m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount <= suballocations1st.size());
+10354 VMA_VALIDATE(m_2ndNullItemsCount <= suballocations2nd.size());
-10356 VMA_VALIDATE(currFree == (suballoc.hAllocation == VK_NULL_HANDLE));
-10357 VMA_VALIDATE(suballoc.offset >= offset);
-
-
-
-10361 VMA_VALIDATE(suballoc.hAllocation->GetOffset() == suballoc.offset);
-10362 VMA_VALIDATE(suballoc.hAllocation->GetSize() == suballoc.size);
-10363 sumUsedSize += suballoc.size;
-
-
-
-10367 ++nullItem2ndCount;
-
-
-10370 offset = suballoc.offset + suballoc.size + VMA_DEBUG_MARGIN;
-
-
-10373 VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount);
-
-
-10376 for(
size_t i = 0; i < m_1stNullItemsBeginCount; ++i)
-
-10378 const VmaSuballocation& suballoc = suballocations1st[i];
-10379 VMA_VALIDATE(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE &&
-10380 suballoc.hAllocation == VK_NULL_HANDLE);
-
+10356 VkDeviceSize sumUsedSize = 0;
+10357 const size_t suballoc1stCount = suballocations1st.size();
+10358 VkDeviceSize offset = VMA_DEBUG_MARGIN;
+
+10360 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+
+10362 const size_t suballoc2ndCount = suballocations2nd.size();
+10363 size_t nullItem2ndCount = 0;
+10364 for(
size_t i = 0; i < suballoc2ndCount; ++i)
+
+10366 const VmaSuballocation& suballoc = suballocations2nd[i];
+10367 const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+10369 VMA_VALIDATE(currFree == (suballoc.hAllocation == VK_NULL_HANDLE));
+10370 VMA_VALIDATE(suballoc.offset >= offset);
+
+
+
+10374 VMA_VALIDATE(suballoc.hAllocation->GetOffset() == suballoc.offset);
+10375 VMA_VALIDATE(suballoc.hAllocation->GetSize() == suballoc.size);
+10376 sumUsedSize += suballoc.size;
+
+
+
+10380 ++nullItem2ndCount;
+
-10383 size_t nullItem1stCount = m_1stNullItemsBeginCount;
-
-10385 for(
size_t i = m_1stNullItemsBeginCount; i < suballoc1stCount; ++i)
-
-10387 const VmaSuballocation& suballoc = suballocations1st[i];
-10388 const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
-
-10390 VMA_VALIDATE(currFree == (suballoc.hAllocation == VK_NULL_HANDLE));
-10391 VMA_VALIDATE(suballoc.offset >= offset);
-10392 VMA_VALIDATE(i >= m_1stNullItemsBeginCount || currFree);
-
-
-
-10396 VMA_VALIDATE(suballoc.hAllocation->GetOffset() == suballoc.offset);
-10397 VMA_VALIDATE(suballoc.hAllocation->GetSize() == suballoc.size);
-10398 sumUsedSize += suballoc.size;
-
-
-
-10402 ++nullItem1stCount;
-
-
-10405 offset = suballoc.offset + suballoc.size + VMA_DEBUG_MARGIN;
-
-10407 VMA_VALIDATE(nullItem1stCount == m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount);
-
-10409 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
-
-10411 const size_t suballoc2ndCount = suballocations2nd.size();
-10412 size_t nullItem2ndCount = 0;
-10413 for(
size_t i = suballoc2ndCount; i--; )
+10383 offset = suballoc.offset + suballoc.size + VMA_DEBUG_MARGIN;
+
+
+10386 VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount);
+
+
+10389 for(
size_t i = 0; i < m_1stNullItemsBeginCount; ++i)
+
+10391 const VmaSuballocation& suballoc = suballocations1st[i];
+10392 VMA_VALIDATE(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE &&
+10393 suballoc.hAllocation == VK_NULL_HANDLE);
+
+
+10396 size_t nullItem1stCount = m_1stNullItemsBeginCount;
+
+10398 for(
size_t i = m_1stNullItemsBeginCount; i < suballoc1stCount; ++i)
+
+10400 const VmaSuballocation& suballoc = suballocations1st[i];
+10401 const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+10403 VMA_VALIDATE(currFree == (suballoc.hAllocation == VK_NULL_HANDLE));
+10404 VMA_VALIDATE(suballoc.offset >= offset);
+10405 VMA_VALIDATE(i >= m_1stNullItemsBeginCount || currFree);
+
+
+
+10409 VMA_VALIDATE(suballoc.hAllocation->GetOffset() == suballoc.offset);
+10410 VMA_VALIDATE(suballoc.hAllocation->GetSize() == suballoc.size);
+10411 sumUsedSize += suballoc.size;
+
+
-10415 const VmaSuballocation& suballoc = suballocations2nd[i];
-10416 const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+10415 ++nullItem1stCount;
+
-10418 VMA_VALIDATE(currFree == (suballoc.hAllocation == VK_NULL_HANDLE));
-10419 VMA_VALIDATE(suballoc.offset >= offset);
-
-
-
-10423 VMA_VALIDATE(suballoc.hAllocation->GetOffset() == suballoc.offset);
-10424 VMA_VALIDATE(suballoc.hAllocation->GetSize() == suballoc.size);
-10425 sumUsedSize += suballoc.size;
-
-
-
-10429 ++nullItem2ndCount;
-
-
-10432 offset = suballoc.offset + suballoc.size + VMA_DEBUG_MARGIN;
-
-
-10435 VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount);
-
-
-10438 VMA_VALIDATE(offset <= GetSize());
-10439 VMA_VALIDATE(m_SumFreeSize == GetSize() - sumUsedSize);
-
-
-
-
-10444 size_t VmaBlockMetadata_Linear::GetAllocationCount()
const
-
-10446 return AccessSuballocations1st().size() - (m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount) +
-10447 AccessSuballocations2nd().size() - m_2ndNullItemsCount;
-
-
-10450 VkDeviceSize VmaBlockMetadata_Linear::GetUnusedRangeSizeMax()
const
-
-10452 const VkDeviceSize size = GetSize();
+10418 offset = suballoc.offset + suballoc.size + VMA_DEBUG_MARGIN;
+
+10420 VMA_VALIDATE(nullItem1stCount == m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount);
+
+10422 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+
+10424 const size_t suballoc2ndCount = suballocations2nd.size();
+10425 size_t nullItem2ndCount = 0;
+10426 for(
size_t i = suballoc2ndCount; i--; )
+
+10428 const VmaSuballocation& suballoc = suballocations2nd[i];
+10429 const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+10431 VMA_VALIDATE(currFree == (suballoc.hAllocation == VK_NULL_HANDLE));
+10432 VMA_VALIDATE(suballoc.offset >= offset);
+
+
+
+10436 VMA_VALIDATE(suballoc.hAllocation->GetOffset() == suballoc.offset);
+10437 VMA_VALIDATE(suballoc.hAllocation->GetSize() == suballoc.size);
+10438 sumUsedSize += suballoc.size;
+
+
+
+10442 ++nullItem2ndCount;
+
+
+10445 offset = suballoc.offset + suballoc.size + VMA_DEBUG_MARGIN;
+
+
+10448 VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount);
+
+
+10451 VMA_VALIDATE(offset <= GetSize());
+10452 VMA_VALIDATE(m_SumFreeSize == GetSize() - sumUsedSize);
-
-
-
-
-
-
-
-
-
-
-10464 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-
-10466 switch(m_2ndVectorMode)
-
-10468 case SECOND_VECTOR_EMPTY:
-
-
-
-
-
-10474 const size_t suballocations1stCount = suballocations1st.size();
-10475 VMA_ASSERT(suballocations1stCount > m_1stNullItemsBeginCount);
-10476 const VmaSuballocation& firstSuballoc = suballocations1st[m_1stNullItemsBeginCount];
-10477 const VmaSuballocation& lastSuballoc = suballocations1st[suballocations1stCount - 1];
-
-10479 firstSuballoc.offset,
-10480 size - (lastSuballoc.offset + lastSuballoc.size));
-
-
-
-10484 case SECOND_VECTOR_RING_BUFFER:
-
-
-
-
-10489 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-10490 const VmaSuballocation& lastSuballoc2nd = suballocations2nd.back();
-10491 const VmaSuballocation& firstSuballoc1st = suballocations1st[m_1stNullItemsBeginCount];
-10492 return firstSuballoc1st.offset - (lastSuballoc2nd.offset + lastSuballoc2nd.size);
-
-
-
-10496 case SECOND_VECTOR_DOUBLE_STACK:
-
-
-
-
-10501 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-10502 const VmaSuballocation& topSuballoc2nd = suballocations2nd.back();
-10503 const VmaSuballocation& lastSuballoc1st = suballocations1st.back();
-10504 return topSuballoc2nd.offset - (lastSuballoc1st.offset + lastSuballoc1st.size);
-
-
-
-
-
-
-
-
-
-10514 void VmaBlockMetadata_Linear::CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const
-
-10516 const VkDeviceSize size = GetSize();
-10517 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-10518 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-10519 const size_t suballoc1stCount = suballocations1st.size();
-10520 const size_t suballoc2ndCount = suballocations2nd.size();
-
-
-
-
-
-
-
-
-
-
-10531 VkDeviceSize lastOffset = 0;
-
-10533 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
-
-10535 const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
-10536 size_t nextAlloc2ndIndex = 0;
-10537 while(lastOffset < freeSpace2ndTo1stEnd)
-
-
-10540 while(nextAlloc2ndIndex < suballoc2ndCount &&
-10541 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
-
-10543 ++nextAlloc2ndIndex;
-
+
+
+
+10457 size_t VmaBlockMetadata_Linear::GetAllocationCount()
const
+
+10459 return AccessSuballocations1st().size() - (m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount) +
+10460 AccessSuballocations2nd().size() - m_2ndNullItemsCount;
+
+
+10463 VkDeviceSize VmaBlockMetadata_Linear::GetUnusedRangeSizeMax()
const
+
+10465 const VkDeviceSize size = GetSize();
+
+
+
+
+
+
+
+
+
+
+
+10477 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+
+10479 switch(m_2ndVectorMode)
+
+10481 case SECOND_VECTOR_EMPTY:
+
+
+
+
+
+10487 const size_t suballocations1stCount = suballocations1st.size();
+10488 VMA_ASSERT(suballocations1stCount > m_1stNullItemsBeginCount);
+10489 const VmaSuballocation& firstSuballoc = suballocations1st[m_1stNullItemsBeginCount];
+10490 const VmaSuballocation& lastSuballoc = suballocations1st[suballocations1stCount - 1];
+
+10492 firstSuballoc.offset,
+10493 size - (lastSuballoc.offset + lastSuballoc.size));
+
+
+
+10497 case SECOND_VECTOR_RING_BUFFER:
+
+
+
+
+10502 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+10503 const VmaSuballocation& lastSuballoc2nd = suballocations2nd.back();
+10504 const VmaSuballocation& firstSuballoc1st = suballocations1st[m_1stNullItemsBeginCount];
+10505 return firstSuballoc1st.offset - (lastSuballoc2nd.offset + lastSuballoc2nd.size);
+
+
+
+10509 case SECOND_VECTOR_DOUBLE_STACK:
+
+
+
+
+10514 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+10515 const VmaSuballocation& topSuballoc2nd = suballocations2nd.back();
+10516 const VmaSuballocation& lastSuballoc1st = suballocations1st.back();
+10517 return topSuballoc2nd.offset - (lastSuballoc1st.offset + lastSuballoc1st.size);
+
+
+
+
+
+
+
+
+
+10527 void VmaBlockMetadata_Linear::CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const
+
+10529 const VkDeviceSize size = GetSize();
+10530 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+10531 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+10532 const size_t suballoc1stCount = suballocations1st.size();
+10533 const size_t suballoc2ndCount = suballocations2nd.size();
+
+
+
+
+
+
+
+
+
+
+10544 VkDeviceSize lastOffset = 0;
-
-10547 if(nextAlloc2ndIndex < suballoc2ndCount)
-
-10549 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
-
-
-10552 if(lastOffset < suballoc.offset)
-
-
-10555 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
-
-
-
-
-
-
-
-
-
-
-
-
-
-10569 lastOffset = suballoc.offset + suballoc.size;
-10570 ++nextAlloc2ndIndex;
-
-
-
-
-
-10576 if(lastOffset < freeSpace2ndTo1stEnd)
-
-10578 const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
-
-
-
-
-
-
-
-10586 lastOffset = freeSpace2ndTo1stEnd;
-
-
-
-
-10591 size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
-10592 const VkDeviceSize freeSpace1stTo2ndEnd =
-10593 m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
-10594 while(lastOffset < freeSpace1stTo2ndEnd)
-
-
-10597 while(nextAlloc1stIndex < suballoc1stCount &&
-10598 suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
-
-10600 ++nextAlloc1stIndex;
+10546 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+
+10548 const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
+10549 size_t nextAlloc2ndIndex = 0;
+10550 while(lastOffset < freeSpace2ndTo1stEnd)
+
+
+10553 while(nextAlloc2ndIndex < suballoc2ndCount &&
+10554 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+
+10556 ++nextAlloc2ndIndex;
+
+
+
+10560 if(nextAlloc2ndIndex < suballoc2ndCount)
+
+10562 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+
+10565 if(lastOffset < suballoc.offset)
+
+
+10568 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+
+
+
+
+
+
+
+
+
+
+
+
+
+10582 lastOffset = suballoc.offset + suballoc.size;
+10583 ++nextAlloc2ndIndex;
+
+
+
+
+
+10589 if(lastOffset < freeSpace2ndTo1stEnd)
+
+10591 const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
+
+
+
+
+
+
+
+10599 lastOffset = freeSpace2ndTo1stEnd;
+
-
-
-10604 if(nextAlloc1stIndex < suballoc1stCount)
-
-10606 const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
-
-
-10609 if(lastOffset < suballoc.offset)
-
-
-10612 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
-
-
-
-
-
-
-
-
-
-
-
-
-
-10626 lastOffset = suballoc.offset + suballoc.size;
-10627 ++nextAlloc1stIndex;
-
-
-
-
-
-10633 if(lastOffset < freeSpace1stTo2ndEnd)
-
-10635 const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
-
-
-
-
-
-
-
-10643 lastOffset = freeSpace1stTo2ndEnd;
-
-
-
-10647 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
-
-10649 size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
-10650 while(lastOffset < size)
-
-
-10653 while(nextAlloc2ndIndex != SIZE_MAX &&
-10654 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
-
-10656 --nextAlloc2ndIndex;
-
-
-
-10660 if(nextAlloc2ndIndex != SIZE_MAX)
-
-10662 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
-
-
-10665 if(lastOffset < suballoc.offset)
-
-
-10668 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
-
-
-
-
-
-
-
-
-
-
-
-
-
-10682 lastOffset = suballoc.offset + suballoc.size;
-10683 --nextAlloc2ndIndex;
-
-
-
-
-
-10689 if(lastOffset < size)
-
-10691 const VkDeviceSize unusedRangeSize = size - lastOffset;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-10707 void VmaBlockMetadata_Linear::AddPoolStats(
VmaPoolStats& inoutStats)
const
-
-10709 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-10710 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-10711 const VkDeviceSize size = GetSize();
-10712 const size_t suballoc1stCount = suballocations1st.size();
-10713 const size_t suballoc2ndCount = suballocations2nd.size();
-
-10715 inoutStats.
size += size;
+
+
+10604 size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
+10605 const VkDeviceSize freeSpace1stTo2ndEnd =
+10606 m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
+10607 while(lastOffset < freeSpace1stTo2ndEnd)
+
+
+10610 while(nextAlloc1stIndex < suballoc1stCount &&
+10611 suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
+
+10613 ++nextAlloc1stIndex;
+
+
+
+10617 if(nextAlloc1stIndex < suballoc1stCount)
+
+10619 const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
+
+
+10622 if(lastOffset < suballoc.offset)
+
+
+10625 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+
+
+
+
+
+
+
+
+
+
+
+
+
+10639 lastOffset = suballoc.offset + suballoc.size;
+10640 ++nextAlloc1stIndex;
+
+
+
+
+
+10646 if(lastOffset < freeSpace1stTo2ndEnd)
+
+10648 const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
+
+
+
+
+
+
+
+10656 lastOffset = freeSpace1stTo2ndEnd;
+
+
+
+10660 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+
+10662 size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
+10663 while(lastOffset < size)
+
+
+10666 while(nextAlloc2ndIndex != SIZE_MAX &&
+10667 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+
+10669 --nextAlloc2ndIndex;
+
+
+
+10673 if(nextAlloc2ndIndex != SIZE_MAX)
+
+10675 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+
+10678 if(lastOffset < suballoc.offset)
+
+
+10681 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+
+
+
+
+
+
+
+
+
+
+
+
+
+10695 lastOffset = suballoc.offset + suballoc.size;
+10696 --nextAlloc2ndIndex;
+
+
+
+
+
+10702 if(lastOffset < size)
+
+10704 const VkDeviceSize unusedRangeSize = size - lastOffset;
+
+
+
+
+
+
+
+
+
+
+
-10717 VkDeviceSize lastOffset = 0;
-
-10719 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
-
-10721 const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
-10722 size_t nextAlloc2ndIndex = m_1stNullItemsBeginCount;
-10723 while(lastOffset < freeSpace2ndTo1stEnd)
-
-
-10726 while(nextAlloc2ndIndex < suballoc2ndCount &&
-10727 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
-
-10729 ++nextAlloc2ndIndex;
-
+
+
+
+10720 void VmaBlockMetadata_Linear::AddPoolStats(
VmaPoolStats& inoutStats)
const
+
+10722 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+10723 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+10724 const VkDeviceSize size = GetSize();
+10725 const size_t suballoc1stCount = suballocations1st.size();
+10726 const size_t suballoc2ndCount = suballocations2nd.size();
+
+10728 inoutStats.
size += size;
+
+10730 VkDeviceSize lastOffset = 0;
-
-10733 if(nextAlloc2ndIndex < suballoc2ndCount)
-
-10735 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
-
-
-10738 if(lastOffset < suballoc.offset)
-
-
-10741 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
-
-
-
-
-
-
-
-
-
-
-10752 lastOffset = suballoc.offset + suballoc.size;
-10753 ++nextAlloc2ndIndex;
-
-
-
-
-10758 if(lastOffset < freeSpace2ndTo1stEnd)
-
-
-10761 const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
-
-
-
-
-
-
-10768 lastOffset = freeSpace2ndTo1stEnd;
-
-
-
-
-10773 size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
-10774 const VkDeviceSize freeSpace1stTo2ndEnd =
-10775 m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
-10776 while(lastOffset < freeSpace1stTo2ndEnd)
-
-
-10779 while(nextAlloc1stIndex < suballoc1stCount &&
-10780 suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
-
-10782 ++nextAlloc1stIndex;
+10732 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+
+10734 const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
+10735 size_t nextAlloc2ndIndex = m_1stNullItemsBeginCount;
+10736 while(lastOffset < freeSpace2ndTo1stEnd)
+
+
+10739 while(nextAlloc2ndIndex < suballoc2ndCount &&
+10740 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+
+10742 ++nextAlloc2ndIndex;
+
+
+
+10746 if(nextAlloc2ndIndex < suballoc2ndCount)
+
+10748 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+
+10751 if(lastOffset < suballoc.offset)
+
+
+10754 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+
+
+
+
+
+
+
+
+
+
+10765 lastOffset = suballoc.offset + suballoc.size;
+10766 ++nextAlloc2ndIndex;
+
+
+
+
+10771 if(lastOffset < freeSpace2ndTo1stEnd)
+
+
+10774 const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
+
+
+
+
+
+
+10781 lastOffset = freeSpace2ndTo1stEnd;
+
-
-
-10786 if(nextAlloc1stIndex < suballoc1stCount)
-
-10788 const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
-
-
-10791 if(lastOffset < suballoc.offset)
-
-
-10794 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
-
-
-
-
-
-
-
-
-
-
-10805 lastOffset = suballoc.offset + suballoc.size;
-10806 ++nextAlloc1stIndex;
-
-
-
-
-10811 if(lastOffset < freeSpace1stTo2ndEnd)
-
-
-10814 const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
-
-
-
-
-
-
-10821 lastOffset = freeSpace1stTo2ndEnd;
-
-
-
-10825 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
-
-10827 size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
-10828 while(lastOffset < size)
-
-
-10831 while(nextAlloc2ndIndex != SIZE_MAX &&
-10832 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
-
-10834 --nextAlloc2ndIndex;
-
-
-
-10838 if(nextAlloc2ndIndex != SIZE_MAX)
-
-10840 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
-
-
-10843 if(lastOffset < suballoc.offset)
-
-
-10846 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
-
-
-
-
-
-
-
-
-
-
-10857 lastOffset = suballoc.offset + suballoc.size;
-10858 --nextAlloc2ndIndex;
-
-
-
-
-10863 if(lastOffset < size)
-
-
-10866 const VkDeviceSize unusedRangeSize = size - lastOffset;
-
-
-
-
-
-
-
-
-
-
-
-
-10879 #if VMA_STATS_STRING_ENABLED
-10880 void VmaBlockMetadata_Linear::PrintDetailedMap(
class VmaJsonWriter& json)
const
-
-10882 const VkDeviceSize size = GetSize();
-10883 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-10884 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-10885 const size_t suballoc1stCount = suballocations1st.size();
-10886 const size_t suballoc2ndCount = suballocations2nd.size();
-
-
-
-10890 size_t unusedRangeCount = 0;
-10891 VkDeviceSize usedBytes = 0;
-
-10893 VkDeviceSize lastOffset = 0;
-
-10895 size_t alloc2ndCount = 0;
-10896 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
-
-10898 const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
-10899 size_t nextAlloc2ndIndex = 0;
-10900 while(lastOffset < freeSpace2ndTo1stEnd)
-
-
-10903 while(nextAlloc2ndIndex < suballoc2ndCount &&
-10904 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
-
-10906 ++nextAlloc2ndIndex;
-
-
-
-10910 if(nextAlloc2ndIndex < suballoc2ndCount)
-
-10912 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
-
-
-10915 if(lastOffset < suballoc.offset)
-
-
-10918 ++unusedRangeCount;
-
-
-
-
-
-10924 usedBytes += suballoc.size;
-
-
-10927 lastOffset = suballoc.offset + suballoc.size;
-10928 ++nextAlloc2ndIndex;
-
-
-
-
-10933 if(lastOffset < freeSpace2ndTo1stEnd)
-
-
-10936 ++unusedRangeCount;
-
+
+
+10786 size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
+10787 const VkDeviceSize freeSpace1stTo2ndEnd =
+10788 m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
+10789 while(lastOffset < freeSpace1stTo2ndEnd)
+
+
+10792 while(nextAlloc1stIndex < suballoc1stCount &&
+10793 suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
+
+10795 ++nextAlloc1stIndex;
+
+
+
+10799 if(nextAlloc1stIndex < suballoc1stCount)
+
+10801 const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
+
+
+10804 if(lastOffset < suballoc.offset)
+
+
+10807 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+
+
+
+
+
+
+
+
+
+
+10818 lastOffset = suballoc.offset + suballoc.size;
+10819 ++nextAlloc1stIndex;
+
+
+
+
+10824 if(lastOffset < freeSpace1stTo2ndEnd)
+
+
+10827 const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
+
+
+
+
+
+
+10834 lastOffset = freeSpace1stTo2ndEnd;
+
+
+
+10838 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+
+10840 size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
+10841 while(lastOffset < size)
+
+
+10844 while(nextAlloc2ndIndex != SIZE_MAX &&
+10845 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+
+10847 --nextAlloc2ndIndex;
+
+
+
+10851 if(nextAlloc2ndIndex != SIZE_MAX)
+
+10853 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+
+10856 if(lastOffset < suballoc.offset)
+
+
+10859 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+
+
+
+
+
+
+
+
+
+
+10870 lastOffset = suballoc.offset + suballoc.size;
+10871 --nextAlloc2ndIndex;
+
+
+
+
+10876 if(lastOffset < size)
+
+
+10879 const VkDeviceSize unusedRangeSize = size - lastOffset;
+
+
+
+
+
+
+
+
+
+
+
+
+10892 #if VMA_STATS_STRING_ENABLED
+10893 void VmaBlockMetadata_Linear::PrintDetailedMap(
class VmaJsonWriter& json)
const
+
+10895 const VkDeviceSize size = GetSize();
+10896 const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+10897 const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+10898 const size_t suballoc1stCount = suballocations1st.size();
+10899 const size_t suballoc2ndCount = suballocations2nd.size();
+
+
+
+10903 size_t unusedRangeCount = 0;
+10904 VkDeviceSize usedBytes = 0;
+
+10906 VkDeviceSize lastOffset = 0;
+
+10908 size_t alloc2ndCount = 0;
+10909 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+
+10911 const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
+10912 size_t nextAlloc2ndIndex = 0;
+10913 while(lastOffset < freeSpace2ndTo1stEnd)
+
+
+10916 while(nextAlloc2ndIndex < suballoc2ndCount &&
+10917 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+
+10919 ++nextAlloc2ndIndex;
+
+
+
+10923 if(nextAlloc2ndIndex < suballoc2ndCount)
+
+10925 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+
+10928 if(lastOffset < suballoc.offset)
+
+
+10931 ++unusedRangeCount;
+
+
+
+
+
+10937 usedBytes += suballoc.size;
-
-10940 lastOffset = freeSpace2ndTo1stEnd;
-
-
-
-
-10945 size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
-10946 size_t alloc1stCount = 0;
-10947 const VkDeviceSize freeSpace1stTo2ndEnd =
-10948 m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
-10949 while(lastOffset < freeSpace1stTo2ndEnd)
-
-
-10952 while(nextAlloc1stIndex < suballoc1stCount &&
-10953 suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
-
-10955 ++nextAlloc1stIndex;
-
+
+10940 lastOffset = suballoc.offset + suballoc.size;
+10941 ++nextAlloc2ndIndex;
+
+
+
+
+10946 if(lastOffset < freeSpace2ndTo1stEnd)
+
+
+10949 ++unusedRangeCount;
+
+
+
+10953 lastOffset = freeSpace2ndTo1stEnd;
+
+
+
-
-10959 if(nextAlloc1stIndex < suballoc1stCount)
-
-10961 const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
-
-
-10964 if(lastOffset < suballoc.offset)
-
-
-10967 ++unusedRangeCount;
-
-
-
-
-
-10973 usedBytes += suballoc.size;
-
-
-10976 lastOffset = suballoc.offset + suballoc.size;
-10977 ++nextAlloc1stIndex;
-
-
-
-
-10982 if(lastOffset < size)
-
-
-10985 ++unusedRangeCount;
-
+10958 size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
+10959 size_t alloc1stCount = 0;
+10960 const VkDeviceSize freeSpace1stTo2ndEnd =
+10961 m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
+10962 while(lastOffset < freeSpace1stTo2ndEnd)
+
+
+10965 while(nextAlloc1stIndex < suballoc1stCount &&
+10966 suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
+
+10968 ++nextAlloc1stIndex;
+
+
+
+10972 if(nextAlloc1stIndex < suballoc1stCount)
+
+10974 const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
+
+
+10977 if(lastOffset < suballoc.offset)
+
+
+10980 ++unusedRangeCount;
+
+
+
+
+
+10986 usedBytes += suballoc.size;
-
-10989 lastOffset = freeSpace1stTo2ndEnd;
-
-
-
-10993 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
-
-10995 size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
-10996 while(lastOffset < size)
-
-
-10999 while(nextAlloc2ndIndex != SIZE_MAX &&
-11000 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
-
-11002 --nextAlloc2ndIndex;
-
-
-
-11006 if(nextAlloc2ndIndex != SIZE_MAX)
-
-11008 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
-
-
-11011 if(lastOffset < suballoc.offset)
-
-
-11014 ++unusedRangeCount;
-
-
-
-
-
-11020 usedBytes += suballoc.size;
-
-
-11023 lastOffset = suballoc.offset + suballoc.size;
-11024 --nextAlloc2ndIndex;
-
-
-
-
-11029 if(lastOffset < size)
-
-
-11032 ++unusedRangeCount;
-
+
+10989 lastOffset = suballoc.offset + suballoc.size;
+10990 ++nextAlloc1stIndex;
+
+
+
+
+10995 if(lastOffset < size)
+
+
+10998 ++unusedRangeCount;
+
+
+
+11002 lastOffset = freeSpace1stTo2ndEnd;
+
+
+
+11006 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+
+11008 size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
+11009 while(lastOffset < size)
+
+
+11012 while(nextAlloc2ndIndex != SIZE_MAX &&
+11013 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+
+11015 --nextAlloc2ndIndex;
+
+
+
+11019 if(nextAlloc2ndIndex != SIZE_MAX)
+
+11021 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+
+11024 if(lastOffset < suballoc.offset)
+
+
+11027 ++unusedRangeCount;
+
+
+
+
+
+11033 usedBytes += suballoc.size;
-
-
-
-
-
-
-11041 const VkDeviceSize unusedBytes = size - usedBytes;
-11042 PrintDetailedMap_Begin(json, unusedBytes, alloc1stCount + alloc2ndCount, unusedRangeCount);
-
-
-
-
-11047 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
-
-11049 const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
-11050 size_t nextAlloc2ndIndex = 0;
-11051 while(lastOffset < freeSpace2ndTo1stEnd)
-
-
-11054 while(nextAlloc2ndIndex < suballoc2ndCount &&
-11055 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
-
-11057 ++nextAlloc2ndIndex;
-
+
+11036 lastOffset = suballoc.offset + suballoc.size;
+11037 --nextAlloc2ndIndex;
+
+
+
+
+11042 if(lastOffset < size)
+
+
+11045 ++unusedRangeCount;
+
+
+
+
+
+
+
+
+11054 const VkDeviceSize unusedBytes = size - usedBytes;
+11055 PrintDetailedMap_Begin(json, unusedBytes, alloc1stCount + alloc2ndCount, unusedRangeCount);
+
+
+
-
-11061 if(nextAlloc2ndIndex < suballoc2ndCount)
-
-11063 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
-
-
-11066 if(lastOffset < suballoc.offset)
-
-
-11069 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
-11070 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
-
+11060 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+
+11062 const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
+11063 size_t nextAlloc2ndIndex = 0;
+11064 while(lastOffset < freeSpace2ndTo1stEnd)
+
+
+11067 while(nextAlloc2ndIndex < suballoc2ndCount &&
+11068 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+
+11070 ++nextAlloc2ndIndex;
+
-
-
-11075 PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.hAllocation);
-
-
-11078 lastOffset = suballoc.offset + suballoc.size;
-11079 ++nextAlloc2ndIndex;
-
-
-
-
-11084 if(lastOffset < freeSpace2ndTo1stEnd)
-
-
-11087 const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
-11088 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
-
-
-
-11092 lastOffset = freeSpace2ndTo1stEnd;
+
+11074 if(nextAlloc2ndIndex < suballoc2ndCount)
+
+11076 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+
+11079 if(lastOffset < suballoc.offset)
+
+
+11082 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+11083 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+
+
+
+
+11088 PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.hAllocation);
+
+
+11091 lastOffset = suballoc.offset + suballoc.size;
+11092 ++nextAlloc2ndIndex;
-
-
-
-11097 nextAlloc1stIndex = m_1stNullItemsBeginCount;
-11098 while(lastOffset < freeSpace1stTo2ndEnd)
-
-
-11101 while(nextAlloc1stIndex < suballoc1stCount &&
-11102 suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
-
-11104 ++nextAlloc1stIndex;
-
-
-
-11108 if(nextAlloc1stIndex < suballoc1stCount)
-
-11110 const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
-
-
-11113 if(lastOffset < suballoc.offset)
-
-
-11116 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
-11117 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
-
+
+
+
+11097 if(lastOffset < freeSpace2ndTo1stEnd)
+
+
+11100 const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
+11101 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+
+
+
+11105 lastOffset = freeSpace2ndTo1stEnd;
+
+
+
+
+11110 nextAlloc1stIndex = m_1stNullItemsBeginCount;
+11111 while(lastOffset < freeSpace1stTo2ndEnd)
+
+
+11114 while(nextAlloc1stIndex < suballoc1stCount &&
+11115 suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
+
+11117 ++nextAlloc1stIndex;
+
-
-
-11122 PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.hAllocation);
-
-
-11125 lastOffset = suballoc.offset + suballoc.size;
-11126 ++nextAlloc1stIndex;
-
-
-
-
-11131 if(lastOffset < freeSpace1stTo2ndEnd)
-
-
-11134 const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
-11135 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
-
-
-
-11139 lastOffset = freeSpace1stTo2ndEnd;
+
+11121 if(nextAlloc1stIndex < suballoc1stCount)
+
+11123 const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
+
+
+11126 if(lastOffset < suballoc.offset)
+
+
+11129 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+11130 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+
+
+
+
+11135 PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.hAllocation);
+
+
+11138 lastOffset = suballoc.offset + suballoc.size;
+11139 ++nextAlloc1stIndex;
-
-
-11143 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
-
-11145 size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
-11146 while(lastOffset < size)
-
-
-11149 while(nextAlloc2ndIndex != SIZE_MAX &&
-11150 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
-
-11152 --nextAlloc2ndIndex;
-
-
-
-11156 if(nextAlloc2ndIndex != SIZE_MAX)
-
-11158 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
-
-
-11161 if(lastOffset < suballoc.offset)
-
-
-11164 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
-11165 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
-
+
+
+
+11144 if(lastOffset < freeSpace1stTo2ndEnd)
+
+
+11147 const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
+11148 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+
+
+
+11152 lastOffset = freeSpace1stTo2ndEnd;
+
+
+
+11156 if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+
+11158 size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
+11159 while(lastOffset < size)
+
+
+11162 while(nextAlloc2ndIndex != SIZE_MAX &&
+11163 suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+
+11165 --nextAlloc2ndIndex;
+
-
-
-11170 PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.hAllocation);
-
-
-11173 lastOffset = suballoc.offset + suballoc.size;
-11174 --nextAlloc2ndIndex;
-
-
-
-
-11179 if(lastOffset < size)
-
-
-11182 const VkDeviceSize unusedRangeSize = size - lastOffset;
-11183 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
-
-
-
-
+
+11169 if(nextAlloc2ndIndex != SIZE_MAX)
+
+11171 const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+
+11174 if(lastOffset < suballoc.offset)
+
+
+11177 const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+11178 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+
+
+
+
+11183 PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.hAllocation);
+
+
+11186 lastOffset = suballoc.offset + suballoc.size;
+11187 --nextAlloc2ndIndex;
-
-
-
-11192 PrintDetailedMap_End(json);
-
-
-
-11196 bool VmaBlockMetadata_Linear::CreateAllocationRequest(
-11197 uint32_t currentFrameIndex,
-11198 uint32_t frameInUseCount,
-11199 VkDeviceSize bufferImageGranularity,
-11200 VkDeviceSize allocSize,
-11201 VkDeviceSize allocAlignment,
-
-11203 VmaSuballocationType allocType,
-11204 bool canMakeOtherLost,
-
-11206 VmaAllocationRequest* pAllocationRequest)
-
-11208 VMA_ASSERT(allocSize > 0);
-11209 VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
-11210 VMA_ASSERT(pAllocationRequest != VMA_NULL);
-11211 VMA_HEAVY_ASSERT(Validate());
-11212 return upperAddress ?
-11213 CreateAllocationRequest_UpperAddress(
-11214 currentFrameIndex, frameInUseCount, bufferImageGranularity,
-11215 allocSize, allocAlignment, allocType, canMakeOtherLost, strategy, pAllocationRequest) :
-11216 CreateAllocationRequest_LowerAddress(
-11217 currentFrameIndex, frameInUseCount, bufferImageGranularity,
-11218 allocSize, allocAlignment, allocType, canMakeOtherLost, strategy, pAllocationRequest);
-
-
-11221 bool VmaBlockMetadata_Linear::CreateAllocationRequest_UpperAddress(
-11222 uint32_t currentFrameIndex,
-11223 uint32_t frameInUseCount,
-11224 VkDeviceSize bufferImageGranularity,
-11225 VkDeviceSize allocSize,
-11226 VkDeviceSize allocAlignment,
-11227 VmaSuballocationType allocType,
-11228 bool canMakeOtherLost,
-
-11230 VmaAllocationRequest* pAllocationRequest)
-
-11232 const VkDeviceSize size = GetSize();
-11233 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-11234 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-
-11236 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
-
-11238 VMA_ASSERT(0 &&
"Trying to use pool with linear algorithm as double stack, while it is already being used as ring buffer.");
-
-
-
-
-11243 if(allocSize > size)
-
-
-
-11247 VkDeviceSize resultBaseOffset = size - allocSize;
-11248 if(!suballocations2nd.empty())
-
-11250 const VmaSuballocation& lastSuballoc = suballocations2nd.back();
-11251 resultBaseOffset = lastSuballoc.offset - allocSize;
-11252 if(allocSize > lastSuballoc.offset)
-
-
-
-
-
-
-11259 VkDeviceSize resultOffset = resultBaseOffset;
-
-
-11262 if(VMA_DEBUG_MARGIN > 0)
-
-11264 if(resultOffset < VMA_DEBUG_MARGIN)
-
-
-
-11268 resultOffset -= VMA_DEBUG_MARGIN;
+
+
+
+11192 if(lastOffset < size)
+
+
+11195 const VkDeviceSize unusedRangeSize = size - lastOffset;
+11196 PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+
+
+
+
+
+
+
+
+11205 PrintDetailedMap_End(json);
+
+
+
+11209 bool VmaBlockMetadata_Linear::CreateAllocationRequest(
+11210 uint32_t currentFrameIndex,
+11211 uint32_t frameInUseCount,
+11212 VkDeviceSize bufferImageGranularity,
+11213 VkDeviceSize allocSize,
+11214 VkDeviceSize allocAlignment,
+
+11216 VmaSuballocationType allocType,
+11217 bool canMakeOtherLost,
+
+11219 VmaAllocationRequest* pAllocationRequest)
+
+11221 VMA_ASSERT(allocSize > 0);
+11222 VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
+11223 VMA_ASSERT(pAllocationRequest != VMA_NULL);
+11224 VMA_HEAVY_ASSERT(Validate());
+11225 return upperAddress ?
+11226 CreateAllocationRequest_UpperAddress(
+11227 currentFrameIndex, frameInUseCount, bufferImageGranularity,
+11228 allocSize, allocAlignment, allocType, canMakeOtherLost, strategy, pAllocationRequest) :
+11229 CreateAllocationRequest_LowerAddress(
+11230 currentFrameIndex, frameInUseCount, bufferImageGranularity,
+11231 allocSize, allocAlignment, allocType, canMakeOtherLost, strategy, pAllocationRequest);
+
+
+11234 bool VmaBlockMetadata_Linear::CreateAllocationRequest_UpperAddress(
+11235 uint32_t currentFrameIndex,
+11236 uint32_t frameInUseCount,
+11237 VkDeviceSize bufferImageGranularity,
+11238 VkDeviceSize allocSize,
+11239 VkDeviceSize allocAlignment,
+11240 VmaSuballocationType allocType,
+11241 bool canMakeOtherLost,
+
+11243 VmaAllocationRequest* pAllocationRequest)
+
+11245 const VkDeviceSize size = GetSize();
+11246 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+11247 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+11249 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+
+11251 VMA_ASSERT(0 &&
"Trying to use pool with linear algorithm as double stack, while it is already being used as ring buffer.");
+
+
+
+
+11256 if(allocSize > size)
+
+
+
+11260 VkDeviceSize resultBaseOffset = size - allocSize;
+11261 if(!suballocations2nd.empty())
+
+11263 const VmaSuballocation& lastSuballoc = suballocations2nd.back();
+11264 resultBaseOffset = lastSuballoc.offset - allocSize;
+11265 if(allocSize > lastSuballoc.offset)
+
+
+
-
-11272 resultOffset = VmaAlignDown(resultOffset, allocAlignment);
+
+11272 VkDeviceSize resultOffset = resultBaseOffset;
-
-
-11276 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty())
-
-11278 bool bufferImageGranularityConflict =
false;
-11279 for(
size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; )
-
-11281 const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex];
-11282 if(VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
-
-11284 if(VmaIsBufferImageGranularityConflict(nextSuballoc.type, allocType))
-
-11286 bufferImageGranularityConflict =
true;
-
-
-
-
-
-
-
-11294 if(bufferImageGranularityConflict)
-
-11296 resultOffset = VmaAlignDown(resultOffset, bufferImageGranularity);
-
-
-
-
-11301 const VkDeviceSize endOf1st = !suballocations1st.empty() ?
-11302 suballocations1st.back().offset + suballocations1st.back().size :
-
-11304 if(endOf1st + VMA_DEBUG_MARGIN <= resultOffset)
-
-
-
-11308 if(bufferImageGranularity > 1)
-
-11310 for(
size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; )
-
-11312 const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex];
-11313 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
-
-11315 if(VmaIsBufferImageGranularityConflict(allocType, prevSuballoc.type))
-
-
-
-
-
-
-
-
-
-
-
-
-
-11329 pAllocationRequest->offset = resultOffset;
-11330 pAllocationRequest->sumFreeSize = resultBaseOffset + allocSize - endOf1st;
-11331 pAllocationRequest->sumItemSize = 0;
-
-11333 pAllocationRequest->itemsToMakeLostCount = 0;
-11334 pAllocationRequest->type = VmaAllocationRequestType::UpperAddress;
-
-
-
-
-
+
+11275 if(VMA_DEBUG_MARGIN > 0)
+
+11277 if(resultOffset < VMA_DEBUG_MARGIN)
+
+
+
+11281 resultOffset -= VMA_DEBUG_MARGIN;
+
+
+
+11285 resultOffset = VmaAlignDown(resultOffset, allocAlignment);
+
+
+
+11289 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty())
+
+11291 bool bufferImageGranularityConflict =
false;
+11292 for(
size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; )
+
+11294 const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex];
+11295 if(VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+
+11297 if(VmaIsBufferImageGranularityConflict(nextSuballoc.type, allocType))
+
+11299 bufferImageGranularityConflict =
true;
+
+
+
+
+
+
+
+11307 if(bufferImageGranularityConflict)
+
+11309 resultOffset = VmaAlignDown(resultOffset, bufferImageGranularity);
+
+
+
+
+11314 const VkDeviceSize endOf1st = !suballocations1st.empty() ?
+11315 suballocations1st.back().offset + suballocations1st.back().size :
+
+11317 if(endOf1st + VMA_DEBUG_MARGIN <= resultOffset)
+
+
+
+11321 if(bufferImageGranularity > 1)
+
+11323 for(
size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; )
+
+11325 const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex];
+11326 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
+
+11328 if(VmaIsBufferImageGranularityConflict(allocType, prevSuballoc.type))
+
+
+
+
+
+
+
+
+
+
+
-11341 bool VmaBlockMetadata_Linear::CreateAllocationRequest_LowerAddress(
-11342 uint32_t currentFrameIndex,
-11343 uint32_t frameInUseCount,
-11344 VkDeviceSize bufferImageGranularity,
-11345 VkDeviceSize allocSize,
-11346 VkDeviceSize allocAlignment,
-11347 VmaSuballocationType allocType,
-11348 bool canMakeOtherLost,
-
-11350 VmaAllocationRequest* pAllocationRequest)
-
-11352 const VkDeviceSize size = GetSize();
-11353 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-11354 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-
-11356 if(m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
-
-
-
-11360 VkDeviceSize resultBaseOffset = 0;
-11361 if(!suballocations1st.empty())
-
-11363 const VmaSuballocation& lastSuballoc = suballocations1st.back();
-11364 resultBaseOffset = lastSuballoc.offset + lastSuballoc.size;
-
-
-
-11368 VkDeviceSize resultOffset = resultBaseOffset;
-
-
-11371 if(VMA_DEBUG_MARGIN > 0)
-
-11373 resultOffset += VMA_DEBUG_MARGIN;
-
-
-
-11377 resultOffset = VmaAlignUp(resultOffset, allocAlignment);
-
-
-
-11381 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations1st.empty())
-
-11383 bool bufferImageGranularityConflict =
false;
-11384 for(
size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; )
-
-11386 const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex];
-11387 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
-
-11389 if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
-
-11391 bufferImageGranularityConflict =
true;
-
-
-
-
-
-
-
-11399 if(bufferImageGranularityConflict)
-
-11401 resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity);
-
-
-
-11405 const VkDeviceSize freeSpaceEnd = m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ?
-11406 suballocations2nd.back().offset : size;
-
-
-11409 if(resultOffset + allocSize + VMA_DEBUG_MARGIN <= freeSpaceEnd)
-
-
-
-11413 if((allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity) && m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
-
-11415 for(
size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; )
-
-11417 const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex];
-11418 if(VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
-
-11420 if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
-
-
-
-
-
-
-
-
-
-
-
-
-
-11434 pAllocationRequest->offset = resultOffset;
-11435 pAllocationRequest->sumFreeSize = freeSpaceEnd - resultBaseOffset;
-11436 pAllocationRequest->sumItemSize = 0;
-
-11438 pAllocationRequest->type = VmaAllocationRequestType::EndOf1st;
-11439 pAllocationRequest->itemsToMakeLostCount = 0;
-
-
-
-
-
-
-11446 if(m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
-
-11448 VMA_ASSERT(!suballocations1st.empty());
-
-11450 VkDeviceSize resultBaseOffset = 0;
-11451 if(!suballocations2nd.empty())
-
-11453 const VmaSuballocation& lastSuballoc = suballocations2nd.back();
-11454 resultBaseOffset = lastSuballoc.offset + lastSuballoc.size;
-
+
+11342 pAllocationRequest->offset = resultOffset;
+11343 pAllocationRequest->sumFreeSize = resultBaseOffset + allocSize - endOf1st;
+11344 pAllocationRequest->sumItemSize = 0;
+
+11346 pAllocationRequest->itemsToMakeLostCount = 0;
+11347 pAllocationRequest->type = VmaAllocationRequestType::UpperAddress;
+
+
+
+
+
+
+11354 bool VmaBlockMetadata_Linear::CreateAllocationRequest_LowerAddress(
+11355 uint32_t currentFrameIndex,
+11356 uint32_t frameInUseCount,
+11357 VkDeviceSize bufferImageGranularity,
+11358 VkDeviceSize allocSize,
+11359 VkDeviceSize allocAlignment,
+11360 VmaSuballocationType allocType,
+11361 bool canMakeOtherLost,
+
+11363 VmaAllocationRequest* pAllocationRequest)
+
+11365 const VkDeviceSize size = GetSize();
+11366 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+11367 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+11369 if(m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+
+
+
+11373 VkDeviceSize resultBaseOffset = 0;
+11374 if(!suballocations1st.empty())
+
+11376 const VmaSuballocation& lastSuballoc = suballocations1st.back();
+11377 resultBaseOffset = lastSuballoc.offset + lastSuballoc.size;
+
+
+
+11381 VkDeviceSize resultOffset = resultBaseOffset;
+
+
+11384 if(VMA_DEBUG_MARGIN > 0)
+
+11386 resultOffset += VMA_DEBUG_MARGIN;
+
+
+
+11390 resultOffset = VmaAlignUp(resultOffset, allocAlignment);
+
+
+
+11394 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations1st.empty())
+
+11396 bool bufferImageGranularityConflict =
false;
+11397 for(
size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; )
+
+11399 const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex];
+11400 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
+
+11402 if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
+
+11404 bufferImageGranularityConflict =
true;
+
+
+
+
+
+
+
+11412 if(bufferImageGranularityConflict)
+
+11414 resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity);
+
+
+
+11418 const VkDeviceSize freeSpaceEnd = m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ?
+11419 suballocations2nd.back().offset : size;
+
+
+11422 if(resultOffset + allocSize + VMA_DEBUG_MARGIN <= freeSpaceEnd)
+
+
+
+11426 if((allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity) && m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+
+11428 for(
size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; )
+
+11430 const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex];
+11431 if(VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+
+11433 if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
+
+
+
+
+
+
+
+
+
+
+
+
+
+11447 pAllocationRequest->offset = resultOffset;
+11448 pAllocationRequest->sumFreeSize = freeSpaceEnd - resultBaseOffset;
+11449 pAllocationRequest->sumItemSize = 0;
+
+11451 pAllocationRequest->type = VmaAllocationRequestType::EndOf1st;
+11452 pAllocationRequest->itemsToMakeLostCount = 0;
+
+
+
-
-11458 VkDeviceSize resultOffset = resultBaseOffset;
-
-
-11461 if(VMA_DEBUG_MARGIN > 0)
-
-11463 resultOffset += VMA_DEBUG_MARGIN;
-
-
-
-11467 resultOffset = VmaAlignUp(resultOffset, allocAlignment);
-
-
-
-11471 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty())
-
-11473 bool bufferImageGranularityConflict =
false;
-11474 for(
size_t prevSuballocIndex = suballocations2nd.size(); prevSuballocIndex--; )
-
-11476 const VmaSuballocation& prevSuballoc = suballocations2nd[prevSuballocIndex];
-11477 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
-
-11479 if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
-
-11481 bufferImageGranularityConflict =
true;
-
-
-
-
-
-
-
-11489 if(bufferImageGranularityConflict)
-
-11491 resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity);
-
-
-
-11495 pAllocationRequest->itemsToMakeLostCount = 0;
-11496 pAllocationRequest->sumItemSize = 0;
-11497 size_t index1st = m_1stNullItemsBeginCount;
-
-11499 if(canMakeOtherLost)
-
-11501 while(index1st < suballocations1st.size() &&
-11502 resultOffset + allocSize + VMA_DEBUG_MARGIN > suballocations1st[index1st].offset)
+
+
+11459 if(m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+
+11461 VMA_ASSERT(!suballocations1st.empty());
+
+11463 VkDeviceSize resultBaseOffset = 0;
+11464 if(!suballocations2nd.empty())
+
+11466 const VmaSuballocation& lastSuballoc = suballocations2nd.back();
+11467 resultBaseOffset = lastSuballoc.offset + lastSuballoc.size;
+
+
+
+11471 VkDeviceSize resultOffset = resultBaseOffset;
+
+
+11474 if(VMA_DEBUG_MARGIN > 0)
+
+11476 resultOffset += VMA_DEBUG_MARGIN;
+
+
+
+11480 resultOffset = VmaAlignUp(resultOffset, allocAlignment);
+
+
+
+11484 if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty())
+
+11486 bool bufferImageGranularityConflict =
false;
+11487 for(
size_t prevSuballocIndex = suballocations2nd.size(); prevSuballocIndex--; )
+
+11489 const VmaSuballocation& prevSuballoc = suballocations2nd[prevSuballocIndex];
+11490 if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
+
+11492 if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
+
+11494 bufferImageGranularityConflict =
true;
+
+
+
+
+
+
+
+11502 if(bufferImageGranularityConflict)
-
-11505 const VmaSuballocation& suballoc = suballocations1st[index1st];
-11506 if(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE)
-
-
-
-
-
-11512 VMA_ASSERT(suballoc.hAllocation != VK_NULL_HANDLE);
-11513 if(suballoc.hAllocation->CanBecomeLost() &&
-11514 suballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
-
-11516 ++pAllocationRequest->itemsToMakeLostCount;
-11517 pAllocationRequest->sumItemSize += suballoc.size;
-
-
-
-
-
-
-
-
-
-
-
-11529 if(allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity)
-
-11531 while(index1st < suballocations1st.size())
-
-11533 const VmaSuballocation& suballoc = suballocations1st[index1st];
-11534 if(VmaBlocksOnSamePage(resultOffset, allocSize, suballoc.offset, bufferImageGranularity))
-
-11536 if(suballoc.hAllocation != VK_NULL_HANDLE)
-
-
-11539 if(suballoc.hAllocation->CanBecomeLost() &&
-11540 suballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
-
-11542 ++pAllocationRequest->itemsToMakeLostCount;
-11543 pAllocationRequest->sumItemSize += suballoc.size;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-11561 if(index1st == suballocations1st.size() &&
-11562 resultOffset + allocSize + VMA_DEBUG_MARGIN > size)
-
-
-11565 VMA_DEBUG_LOG(
"Unsupported special case in custom pool with linear allocation algorithm used as ring buffer with allocations that can be lost.");
-
-
-
-
-11570 if((index1st == suballocations1st.size() && resultOffset + allocSize + VMA_DEBUG_MARGIN <= size) ||
-11571 (index1st < suballocations1st.size() && resultOffset + allocSize + VMA_DEBUG_MARGIN <= suballocations1st[index1st].offset))
-
-
-
-11575 if(allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity)
+11504 resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity);
+
+
+
+11508 pAllocationRequest->itemsToMakeLostCount = 0;
+11509 pAllocationRequest->sumItemSize = 0;
+11510 size_t index1st = m_1stNullItemsBeginCount;
+
+11512 if(canMakeOtherLost)
+
+11514 while(index1st < suballocations1st.size() &&
+11515 resultOffset + allocSize + VMA_DEBUG_MARGIN > suballocations1st[index1st].offset)
+
+
+11518 const VmaSuballocation& suballoc = suballocations1st[index1st];
+11519 if(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE)
+
+
+
+
+
+11525 VMA_ASSERT(suballoc.hAllocation != VK_NULL_HANDLE);
+11526 if(suballoc.hAllocation->CanBecomeLost() &&
+11527 suballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+
+11529 ++pAllocationRequest->itemsToMakeLostCount;
+11530 pAllocationRequest->sumItemSize += suballoc.size;
+
+
+
+
+
+
+
+
+
+
+
+11542 if(allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity)
+
+11544 while(index1st < suballocations1st.size())
+
+11546 const VmaSuballocation& suballoc = suballocations1st[index1st];
+11547 if(VmaBlocksOnSamePage(resultOffset, allocSize, suballoc.offset, bufferImageGranularity))
+
+11549 if(suballoc.hAllocation != VK_NULL_HANDLE)
+
+
+11552 if(suballoc.hAllocation->CanBecomeLost() &&
+11553 suballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+
+11555 ++pAllocationRequest->itemsToMakeLostCount;
+11556 pAllocationRequest->sumItemSize += suballoc.size;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11574 if(index1st == suballocations1st.size() &&
+11575 resultOffset + allocSize + VMA_DEBUG_MARGIN > size)
-11577 for(
size_t nextSuballocIndex = index1st;
-11578 nextSuballocIndex < suballocations1st.size();
-11579 nextSuballocIndex++)
-
-11581 const VmaSuballocation& nextSuballoc = suballocations1st[nextSuballocIndex];
-11582 if(VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
-
-11584 if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
-
-
-
-
-
-
-
-
-
-
-
-
-
-11598 pAllocationRequest->offset = resultOffset;
-11599 pAllocationRequest->sumFreeSize =
-11600 (index1st < suballocations1st.size() ? suballocations1st[index1st].offset : size)
-
-11602 - pAllocationRequest->sumItemSize;
-11603 pAllocationRequest->type = VmaAllocationRequestType::EndOf2nd;
-
-
-
-
-
-
-
-
-11612 bool VmaBlockMetadata_Linear::MakeRequestedAllocationsLost(
-11613 uint32_t currentFrameIndex,
-11614 uint32_t frameInUseCount,
-11615 VmaAllocationRequest* pAllocationRequest)
-
-11617 if(pAllocationRequest->itemsToMakeLostCount == 0)
-
-
+
+11578 VMA_DEBUG_LOG(
"Unsupported special case in custom pool with linear allocation algorithm used as ring buffer with allocations that can be lost.");
+
+
+
+
+11583 if((index1st == suballocations1st.size() && resultOffset + allocSize + VMA_DEBUG_MARGIN <= size) ||
+11584 (index1st < suballocations1st.size() && resultOffset + allocSize + VMA_DEBUG_MARGIN <= suballocations1st[index1st].offset))
+
+
+
+11588 if(allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity)
+
+11590 for(
size_t nextSuballocIndex = index1st;
+11591 nextSuballocIndex < suballocations1st.size();
+11592 nextSuballocIndex++)
+
+11594 const VmaSuballocation& nextSuballoc = suballocations1st[nextSuballocIndex];
+11595 if(VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+
+11597 if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
+
+
+
+
+
+
+
+
+
+
+
+
+
+11611 pAllocationRequest->offset = resultOffset;
+11612 pAllocationRequest->sumFreeSize =
+11613 (index1st < suballocations1st.size() ? suballocations1st[index1st].offset : size)
+
+11615 - pAllocationRequest->sumItemSize;
+11616 pAllocationRequest->type = VmaAllocationRequestType::EndOf2nd;
+
+
+
-11622 VMA_ASSERT(m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER);
-
-
-11625 SuballocationVectorType* suballocations = &AccessSuballocations1st();
-11626 size_t index = m_1stNullItemsBeginCount;
-11627 size_t madeLostCount = 0;
-11628 while(madeLostCount < pAllocationRequest->itemsToMakeLostCount)
-
-11630 if(index == suballocations->size())
-
-
-
-11634 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
-
-11636 suballocations = &AccessSuballocations2nd();
-
-
-
-11640 VMA_ASSERT(!suballocations->empty());
-
-11642 VmaSuballocation& suballoc = (*suballocations)[index];
-11643 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
+
+
+
+11625 bool VmaBlockMetadata_Linear::MakeRequestedAllocationsLost(
+11626 uint32_t currentFrameIndex,
+11627 uint32_t frameInUseCount,
+11628 VmaAllocationRequest* pAllocationRequest)
+
+11630 if(pAllocationRequest->itemsToMakeLostCount == 0)
+
+
+
+
+11635 VMA_ASSERT(m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER);
+
+
+11638 SuballocationVectorType* suballocations = &AccessSuballocations1st();
+11639 size_t index = m_1stNullItemsBeginCount;
+11640 size_t madeLostCount = 0;
+11641 while(madeLostCount < pAllocationRequest->itemsToMakeLostCount)
+
+11643 if(index == suballocations->size())
-11645 VMA_ASSERT(suballoc.hAllocation != VK_NULL_HANDLE);
-11646 VMA_ASSERT(suballoc.hAllocation->CanBecomeLost());
-11647 if(suballoc.hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+
+
+11647 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
-11649 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
-11650 suballoc.hAllocation = VK_NULL_HANDLE;
-11651 m_SumFreeSize += suballoc.size;
-11652 if(suballocations == &AccessSuballocations1st())
-
-11654 ++m_1stNullItemsMiddleCount;
-
-
-
-11658 ++m_2ndNullItemsCount;
-
-
-
-
-
-
-
-
-
-
-
-11670 CleanupAfterFree();
-
-
-
-
-
-11676 uint32_t VmaBlockMetadata_Linear::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
-
-11678 uint32_t lostAllocationCount = 0;
-
-11680 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-11681 for(
size_t i = m_1stNullItemsBeginCount, count = suballocations1st.size(); i < count; ++i)
-
-11683 VmaSuballocation& suballoc = suballocations1st[i];
-11684 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE &&
-11685 suballoc.hAllocation->CanBecomeLost() &&
-11686 suballoc.hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
-
-11688 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
-11689 suballoc.hAllocation = VK_NULL_HANDLE;
-11690 ++m_1stNullItemsMiddleCount;
-11691 m_SumFreeSize += suballoc.size;
-11692 ++lostAllocationCount;
-
-
-
-11696 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-11697 for(
size_t i = 0, count = suballocations2nd.size(); i < count; ++i)
-
-11699 VmaSuballocation& suballoc = suballocations2nd[i];
-11700 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE &&
-11701 suballoc.hAllocation->CanBecomeLost() &&
-11702 suballoc.hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
-
-11704 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
-11705 suballoc.hAllocation = VK_NULL_HANDLE;
-11706 ++m_2ndNullItemsCount;
-11707 m_SumFreeSize += suballoc.size;
-11708 ++lostAllocationCount;
-
-
-
-11712 if(lostAllocationCount)
-
-11714 CleanupAfterFree();
-
-
-11717 return lostAllocationCount;
-
-
-11720 VkResult VmaBlockMetadata_Linear::CheckCorruption(
const void* pBlockData)
-
-11722 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-11723 for(
size_t i = m_1stNullItemsBeginCount, count = suballocations1st.size(); i < count; ++i)
-
-11725 const VmaSuballocation& suballoc = suballocations1st[i];
-11726 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
-
-11728 if(!VmaValidateMagicValue(pBlockData, suballoc.offset - VMA_DEBUG_MARGIN))
-
-11730 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED BEFORE VALIDATED ALLOCATION!");
-11731 return VK_ERROR_VALIDATION_FAILED_EXT;
-
-11733 if(!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size))
-
-11735 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
-11736 return VK_ERROR_VALIDATION_FAILED_EXT;
-
-
-
-
-11741 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-11742 for(
size_t i = 0, count = suballocations2nd.size(); i < count; ++i)
-
-11744 const VmaSuballocation& suballoc = suballocations2nd[i];
-11745 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
-
-11747 if(!VmaValidateMagicValue(pBlockData, suballoc.offset - VMA_DEBUG_MARGIN))
-
-11749 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED BEFORE VALIDATED ALLOCATION!");
-11750 return VK_ERROR_VALIDATION_FAILED_EXT;
-
-11752 if(!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size))
-
-11754 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
-11755 return VK_ERROR_VALIDATION_FAILED_EXT;
-
-
-
-
-
-
-
-11763 void VmaBlockMetadata_Linear::Alloc(
-11764 const VmaAllocationRequest& request,
-11765 VmaSuballocationType type,
-11766 VkDeviceSize allocSize,
-
-
-11769 const VmaSuballocation newSuballoc = { request.offset, allocSize, hAllocation, type };
-
-11771 switch(request.type)
-
-11773 case VmaAllocationRequestType::UpperAddress:
-
-11775 VMA_ASSERT(m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER &&
-11776 "CRITICAL ERROR: Trying to use linear allocator as double stack while it was already used as ring buffer.");
-11777 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-11778 suballocations2nd.push_back(newSuballoc);
-11779 m_2ndVectorMode = SECOND_VECTOR_DOUBLE_STACK;
-
-
-11782 case VmaAllocationRequestType::EndOf1st:
-
-11784 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-
-11786 VMA_ASSERT(suballocations1st.empty() ||
-11787 request.offset >= suballocations1st.back().offset + suballocations1st.back().size);
-
-11789 VMA_ASSERT(request.offset + allocSize <= GetSize());
-
-11791 suballocations1st.push_back(newSuballoc);
-
-
-11794 case VmaAllocationRequestType::EndOf2nd:
-
-11796 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-
-11798 VMA_ASSERT(!suballocations1st.empty() &&
-11799 request.offset + allocSize <= suballocations1st[m_1stNullItemsBeginCount].offset);
-11800 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-
-11802 switch(m_2ndVectorMode)
-
-11804 case SECOND_VECTOR_EMPTY:
-
-11806 VMA_ASSERT(suballocations2nd.empty());
-11807 m_2ndVectorMode = SECOND_VECTOR_RING_BUFFER;
-
-11809 case SECOND_VECTOR_RING_BUFFER:
-
-11811 VMA_ASSERT(!suballocations2nd.empty());
-
-11813 case SECOND_VECTOR_DOUBLE_STACK:
-11814 VMA_ASSERT(0 &&
"CRITICAL ERROR: Trying to use linear allocator as ring buffer while it was already used as double stack.");
-
-
-
-
-
-11820 suballocations2nd.push_back(newSuballoc);
-
-
-
-11824 VMA_ASSERT(0 &&
"CRITICAL INTERNAL ERROR.");
-
-
-11827 m_SumFreeSize -= newSuballoc.size;
-
-
-11830 void VmaBlockMetadata_Linear::Free(
const VmaAllocation allocation)
-
-11832 FreeAtOffset(allocation->GetOffset());
-
-
-11835 void VmaBlockMetadata_Linear::FreeAtOffset(VkDeviceSize offset)
-
-11837 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-11838 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+11649 suballocations = &AccessSuballocations2nd();
+
+
+
+11653 VMA_ASSERT(!suballocations->empty());
+
+11655 VmaSuballocation& suballoc = (*suballocations)[index];
+11656 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
+
+11658 VMA_ASSERT(suballoc.hAllocation != VK_NULL_HANDLE);
+11659 VMA_ASSERT(suballoc.hAllocation->CanBecomeLost());
+11660 if(suballoc.hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+
+11662 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+11663 suballoc.hAllocation = VK_NULL_HANDLE;
+11664 m_SumFreeSize += suballoc.size;
+11665 if(suballocations == &AccessSuballocations1st())
+
+11667 ++m_1stNullItemsMiddleCount;
+
+
+
+11671 ++m_2ndNullItemsCount;
+
+
+
+
+
+
+
+
+
+
+
+11683 CleanupAfterFree();
+
+
+
+
+
+11689 uint32_t VmaBlockMetadata_Linear::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
+
+11691 uint32_t lostAllocationCount = 0;
+
+11693 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+11694 for(
size_t i = m_1stNullItemsBeginCount, count = suballocations1st.size(); i < count; ++i)
+
+11696 VmaSuballocation& suballoc = suballocations1st[i];
+11697 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE &&
+11698 suballoc.hAllocation->CanBecomeLost() &&
+11699 suballoc.hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+
+11701 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+11702 suballoc.hAllocation = VK_NULL_HANDLE;
+11703 ++m_1stNullItemsMiddleCount;
+11704 m_SumFreeSize += suballoc.size;
+11705 ++lostAllocationCount;
+
+
+
+11709 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+11710 for(
size_t i = 0, count = suballocations2nd.size(); i < count; ++i)
+
+11712 VmaSuballocation& suballoc = suballocations2nd[i];
+11713 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE &&
+11714 suballoc.hAllocation->CanBecomeLost() &&
+11715 suballoc.hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+
+11717 suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+11718 suballoc.hAllocation = VK_NULL_HANDLE;
+11719 ++m_2ndNullItemsCount;
+11720 m_SumFreeSize += suballoc.size;
+11721 ++lostAllocationCount;
+
+
+
+11725 if(lostAllocationCount)
+
+11727 CleanupAfterFree();
+
+
+11730 return lostAllocationCount;
+
+
+11733 VkResult VmaBlockMetadata_Linear::CheckCorruption(
const void* pBlockData)
+
+11735 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+11736 for(
size_t i = m_1stNullItemsBeginCount, count = suballocations1st.size(); i < count; ++i)
+
+11738 const VmaSuballocation& suballoc = suballocations1st[i];
+11739 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
+
+11741 if(!VmaValidateMagicValue(pBlockData, suballoc.offset - VMA_DEBUG_MARGIN))
+
+11743 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED BEFORE VALIDATED ALLOCATION!");
+11744 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+11746 if(!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size))
+
+11748 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
+11749 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+
+
+
+11754 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+11755 for(
size_t i = 0, count = suballocations2nd.size(); i < count; ++i)
+
+11757 const VmaSuballocation& suballoc = suballocations2nd[i];
+11758 if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
+
+11760 if(!VmaValidateMagicValue(pBlockData, suballoc.offset - VMA_DEBUG_MARGIN))
+
+11762 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED BEFORE VALIDATED ALLOCATION!");
+11763 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+11765 if(!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size))
+
+11767 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
+11768 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+
+
+
+
+
+
+11776 void VmaBlockMetadata_Linear::Alloc(
+11777 const VmaAllocationRequest& request,
+11778 VmaSuballocationType type,
+11779 VkDeviceSize allocSize,
+
+
+11782 const VmaSuballocation newSuballoc = { request.offset, allocSize, hAllocation, type };
+
+11784 switch(request.type)
+
+11786 case VmaAllocationRequestType::UpperAddress:
+
+11788 VMA_ASSERT(m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER &&
+11789 "CRITICAL ERROR: Trying to use linear allocator as double stack while it was already used as ring buffer.");
+11790 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+11791 suballocations2nd.push_back(newSuballoc);
+11792 m_2ndVectorMode = SECOND_VECTOR_DOUBLE_STACK;
+
+
+11795 case VmaAllocationRequestType::EndOf1st:
+
+11797 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+
+11799 VMA_ASSERT(suballocations1st.empty() ||
+11800 request.offset >= suballocations1st.back().offset + suballocations1st.back().size);
+
+11802 VMA_ASSERT(request.offset + allocSize <= GetSize());
+
+11804 suballocations1st.push_back(newSuballoc);
+
+
+11807 case VmaAllocationRequestType::EndOf2nd:
+
+11809 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+
+11811 VMA_ASSERT(!suballocations1st.empty() &&
+11812 request.offset + allocSize <= suballocations1st[m_1stNullItemsBeginCount].offset);
+11813 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+11815 switch(m_2ndVectorMode)
+
+11817 case SECOND_VECTOR_EMPTY:
+
+11819 VMA_ASSERT(suballocations2nd.empty());
+11820 m_2ndVectorMode = SECOND_VECTOR_RING_BUFFER;
+
+11822 case SECOND_VECTOR_RING_BUFFER:
+
+11824 VMA_ASSERT(!suballocations2nd.empty());
+
+11826 case SECOND_VECTOR_DOUBLE_STACK:
+11827 VMA_ASSERT(0 &&
"CRITICAL ERROR: Trying to use linear allocator as ring buffer while it was already used as double stack.");
+
+
+
+
+
+11833 suballocations2nd.push_back(newSuballoc);
+
+
+
+11837 VMA_ASSERT(0 &&
"CRITICAL INTERNAL ERROR.");
+
-11840 if(!suballocations1st.empty())
-
-
-11843 VmaSuballocation& firstSuballoc = suballocations1st[m_1stNullItemsBeginCount];
-11844 if(firstSuballoc.offset == offset)
-
-11846 firstSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
-11847 firstSuballoc.hAllocation = VK_NULL_HANDLE;
-11848 m_SumFreeSize += firstSuballoc.size;
-11849 ++m_1stNullItemsBeginCount;
-11850 CleanupAfterFree();
-
-
-
-
-
-11856 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ||
-11857 m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
-
-11859 VmaSuballocation& lastSuballoc = suballocations2nd.back();
-11860 if(lastSuballoc.offset == offset)
-
-11862 m_SumFreeSize += lastSuballoc.size;
-11863 suballocations2nd.pop_back();
-11864 CleanupAfterFree();
-
-
-
-
-11869 else if(m_2ndVectorMode == SECOND_VECTOR_EMPTY)
-
-11871 VmaSuballocation& lastSuballoc = suballocations1st.back();
-11872 if(lastSuballoc.offset == offset)
-
-11874 m_SumFreeSize += lastSuballoc.size;
-11875 suballocations1st.pop_back();
-11876 CleanupAfterFree();
-
-
-
-
-
-
-11883 VmaSuballocation refSuballoc;
-11884 refSuballoc.offset = offset;
-
-11886 SuballocationVectorType::iterator it = VmaBinaryFindSorted(
-11887 suballocations1st.begin() + m_1stNullItemsBeginCount,
-11888 suballocations1st.end(),
-
-11890 VmaSuballocationOffsetLess());
-11891 if(it != suballocations1st.end())
-
-11893 it->type = VMA_SUBALLOCATION_TYPE_FREE;
-11894 it->hAllocation = VK_NULL_HANDLE;
-11895 ++m_1stNullItemsMiddleCount;
-11896 m_SumFreeSize += it->size;
-11897 CleanupAfterFree();
-
-
-
-
-11902 if(m_2ndVectorMode != SECOND_VECTOR_EMPTY)
-
-
-11905 VmaSuballocation refSuballoc;
-11906 refSuballoc.offset = offset;
-
-11908 SuballocationVectorType::iterator it = m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ?
-11909 VmaBinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, VmaSuballocationOffsetLess()) :
-11910 VmaBinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, VmaSuballocationOffsetGreater());
-11911 if(it != suballocations2nd.end())
-
-11913 it->type = VMA_SUBALLOCATION_TYPE_FREE;
-11914 it->hAllocation = VK_NULL_HANDLE;
-11915 ++m_2ndNullItemsCount;
-11916 m_SumFreeSize += it->size;
-11917 CleanupAfterFree();
-
-
-
-
-11922 VMA_ASSERT(0 &&
"Allocation to free not found in linear allocator!");
-
-
-11925 bool VmaBlockMetadata_Linear::ShouldCompact1st()
const
-
-11927 const size_t nullItemCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount;
-11928 const size_t suballocCount = AccessSuballocations1st().size();
-11929 return suballocCount > 32 && nullItemCount * 2 >= (suballocCount - nullItemCount) * 3;
-
-
-11932 void VmaBlockMetadata_Linear::CleanupAfterFree()
-
-11934 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
-11935 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
-
-
-
-11939 suballocations1st.clear();
-11940 suballocations2nd.clear();
-11941 m_1stNullItemsBeginCount = 0;
-11942 m_1stNullItemsMiddleCount = 0;
-11943 m_2ndNullItemsCount = 0;
-11944 m_2ndVectorMode = SECOND_VECTOR_EMPTY;
-
-
-
-11948 const size_t suballoc1stCount = suballocations1st.size();
-11949 const size_t nullItem1stCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount;
-11950 VMA_ASSERT(nullItem1stCount <= suballoc1stCount);
-
-
-11953 while(m_1stNullItemsBeginCount < suballoc1stCount &&
-11954 suballocations1st[m_1stNullItemsBeginCount].hAllocation == VK_NULL_HANDLE)
-
-11956 ++m_1stNullItemsBeginCount;
-11957 --m_1stNullItemsMiddleCount;
-
-
-
-11961 while(m_1stNullItemsMiddleCount > 0 &&
-11962 suballocations1st.back().hAllocation == VK_NULL_HANDLE)
-
-11964 --m_1stNullItemsMiddleCount;
-11965 suballocations1st.pop_back();
-
-
-
-11969 while(m_2ndNullItemsCount > 0 &&
-11970 suballocations2nd.back().hAllocation == VK_NULL_HANDLE)
-
-11972 --m_2ndNullItemsCount;
-11973 suballocations2nd.pop_back();
-
-
-
-11977 while(m_2ndNullItemsCount > 0 &&
-11978 suballocations2nd[0].hAllocation == VK_NULL_HANDLE)
-
-11980 --m_2ndNullItemsCount;
-11981 VmaVectorRemove(suballocations2nd, 0);
-
-
-11984 if(ShouldCompact1st())
-
-11986 const size_t nonNullItemCount = suballoc1stCount - nullItem1stCount;
-11987 size_t srcIndex = m_1stNullItemsBeginCount;
-11988 for(
size_t dstIndex = 0; dstIndex < nonNullItemCount; ++dstIndex)
-
-11990 while(suballocations1st[srcIndex].hAllocation == VK_NULL_HANDLE)
-
-
-
-11994 if(dstIndex != srcIndex)
-
-11996 suballocations1st[dstIndex] = suballocations1st[srcIndex];
-
-
-
-12000 suballocations1st.resize(nonNullItemCount);
-12001 m_1stNullItemsBeginCount = 0;
-12002 m_1stNullItemsMiddleCount = 0;
-
-
-
-12006 if(suballocations2nd.empty())
-
-12008 m_2ndVectorMode = SECOND_VECTOR_EMPTY;
-
-
-
-12012 if(suballocations1st.size() - m_1stNullItemsBeginCount == 0)
-
-12014 suballocations1st.clear();
-12015 m_1stNullItemsBeginCount = 0;
-
-12017 if(!suballocations2nd.empty() && m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
-
-
-12020 m_2ndVectorMode = SECOND_VECTOR_EMPTY;
-12021 m_1stNullItemsMiddleCount = m_2ndNullItemsCount;
-12022 while(m_1stNullItemsBeginCount < suballocations2nd.size() &&
-12023 suballocations2nd[m_1stNullItemsBeginCount].hAllocation == VK_NULL_HANDLE)
-
-12025 ++m_1stNullItemsBeginCount;
-12026 --m_1stNullItemsMiddleCount;
-
-12028 m_2ndNullItemsCount = 0;
-12029 m_1stVectorIndex ^= 1;
-
-
-
-
-12034 VMA_HEAVY_ASSERT(Validate());
-
-
-
-
-
-12041 VmaBlockMetadata_Buddy::VmaBlockMetadata_Buddy(
VmaAllocator hAllocator) :
-12042 VmaBlockMetadata(hAllocator),
-
-12044 m_AllocationCount(0),
-
-
-
-12048 memset(m_FreeList, 0,
sizeof(m_FreeList));
-
+11840 m_SumFreeSize -= newSuballoc.size;
+
+
+11843 void VmaBlockMetadata_Linear::Free(
const VmaAllocation allocation)
+
+11845 FreeAtOffset(allocation->GetOffset());
+
+
+11848 void VmaBlockMetadata_Linear::FreeAtOffset(VkDeviceSize offset)
+
+11850 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+11851 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+11853 if(!suballocations1st.empty())
+
+
+11856 VmaSuballocation& firstSuballoc = suballocations1st[m_1stNullItemsBeginCount];
+11857 if(firstSuballoc.offset == offset)
+
+11859 firstSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+11860 firstSuballoc.hAllocation = VK_NULL_HANDLE;
+11861 m_SumFreeSize += firstSuballoc.size;
+11862 ++m_1stNullItemsBeginCount;
+11863 CleanupAfterFree();
+
+
+
+
+
+11869 if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ||
+11870 m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+
+11872 VmaSuballocation& lastSuballoc = suballocations2nd.back();
+11873 if(lastSuballoc.offset == offset)
+
+11875 m_SumFreeSize += lastSuballoc.size;
+11876 suballocations2nd.pop_back();
+11877 CleanupAfterFree();
+
+
+
+
+11882 else if(m_2ndVectorMode == SECOND_VECTOR_EMPTY)
+
+11884 VmaSuballocation& lastSuballoc = suballocations1st.back();
+11885 if(lastSuballoc.offset == offset)
+
+11887 m_SumFreeSize += lastSuballoc.size;
+11888 suballocations1st.pop_back();
+11889 CleanupAfterFree();
+
+
+
+
+
+
+11896 VmaSuballocation refSuballoc;
+11897 refSuballoc.offset = offset;
+
+11899 SuballocationVectorType::iterator it = VmaBinaryFindSorted(
+11900 suballocations1st.begin() + m_1stNullItemsBeginCount,
+11901 suballocations1st.end(),
+
+11903 VmaSuballocationOffsetLess());
+11904 if(it != suballocations1st.end())
+
+11906 it->type = VMA_SUBALLOCATION_TYPE_FREE;
+11907 it->hAllocation = VK_NULL_HANDLE;
+11908 ++m_1stNullItemsMiddleCount;
+11909 m_SumFreeSize += it->size;
+11910 CleanupAfterFree();
+
+
+
+
+11915 if(m_2ndVectorMode != SECOND_VECTOR_EMPTY)
+
+
+11918 VmaSuballocation refSuballoc;
+11919 refSuballoc.offset = offset;
+
+11921 SuballocationVectorType::iterator it = m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ?
+11922 VmaBinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, VmaSuballocationOffsetLess()) :
+11923 VmaBinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, VmaSuballocationOffsetGreater());
+11924 if(it != suballocations2nd.end())
+
+11926 it->type = VMA_SUBALLOCATION_TYPE_FREE;
+11927 it->hAllocation = VK_NULL_HANDLE;
+11928 ++m_2ndNullItemsCount;
+11929 m_SumFreeSize += it->size;
+11930 CleanupAfterFree();
+
+
+
+
+11935 VMA_ASSERT(0 &&
"Allocation to free not found in linear allocator!");
+
+
+11938 bool VmaBlockMetadata_Linear::ShouldCompact1st()
const
+
+11940 const size_t nullItemCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount;
+11941 const size_t suballocCount = AccessSuballocations1st().size();
+11942 return suballocCount > 32 && nullItemCount * 2 >= (suballocCount - nullItemCount) * 3;
+
+
+11945 void VmaBlockMetadata_Linear::CleanupAfterFree()
+
+11947 SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+11948 SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+
+
+11952 suballocations1st.clear();
+11953 suballocations2nd.clear();
+11954 m_1stNullItemsBeginCount = 0;
+11955 m_1stNullItemsMiddleCount = 0;
+11956 m_2ndNullItemsCount = 0;
+11957 m_2ndVectorMode = SECOND_VECTOR_EMPTY;
+
+
+
+11961 const size_t suballoc1stCount = suballocations1st.size();
+11962 const size_t nullItem1stCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount;
+11963 VMA_ASSERT(nullItem1stCount <= suballoc1stCount);
+
+
+11966 while(m_1stNullItemsBeginCount < suballoc1stCount &&
+11967 suballocations1st[m_1stNullItemsBeginCount].hAllocation == VK_NULL_HANDLE)
+
+11969 ++m_1stNullItemsBeginCount;
+11970 --m_1stNullItemsMiddleCount;
+
+
+
+11974 while(m_1stNullItemsMiddleCount > 0 &&
+11975 suballocations1st.back().hAllocation == VK_NULL_HANDLE)
+
+11977 --m_1stNullItemsMiddleCount;
+11978 suballocations1st.pop_back();
+
+
+
+11982 while(m_2ndNullItemsCount > 0 &&
+11983 suballocations2nd.back().hAllocation == VK_NULL_HANDLE)
+
+11985 --m_2ndNullItemsCount;
+11986 suballocations2nd.pop_back();
+
+
+
+11990 while(m_2ndNullItemsCount > 0 &&
+11991 suballocations2nd[0].hAllocation == VK_NULL_HANDLE)
+
+11993 --m_2ndNullItemsCount;
+11994 VmaVectorRemove(suballocations2nd, 0);
+
+
+11997 if(ShouldCompact1st())
+
+11999 const size_t nonNullItemCount = suballoc1stCount - nullItem1stCount;
+12000 size_t srcIndex = m_1stNullItemsBeginCount;
+12001 for(
size_t dstIndex = 0; dstIndex < nonNullItemCount; ++dstIndex)
+
+12003 while(suballocations1st[srcIndex].hAllocation == VK_NULL_HANDLE)
+
+
+
+12007 if(dstIndex != srcIndex)
+
+12009 suballocations1st[dstIndex] = suballocations1st[srcIndex];
+
+
+
+12013 suballocations1st.resize(nonNullItemCount);
+12014 m_1stNullItemsBeginCount = 0;
+12015 m_1stNullItemsMiddleCount = 0;
+
+
+
+12019 if(suballocations2nd.empty())
+
+12021 m_2ndVectorMode = SECOND_VECTOR_EMPTY;
+
+
+
+12025 if(suballocations1st.size() - m_1stNullItemsBeginCount == 0)
+
+12027 suballocations1st.clear();
+12028 m_1stNullItemsBeginCount = 0;
+
+12030 if(!suballocations2nd.empty() && m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+
+
+12033 m_2ndVectorMode = SECOND_VECTOR_EMPTY;
+12034 m_1stNullItemsMiddleCount = m_2ndNullItemsCount;
+12035 while(m_1stNullItemsBeginCount < suballocations2nd.size() &&
+12036 suballocations2nd[m_1stNullItemsBeginCount].hAllocation == VK_NULL_HANDLE)
+
+12038 ++m_1stNullItemsBeginCount;
+12039 --m_1stNullItemsMiddleCount;
+
+12041 m_2ndNullItemsCount = 0;
+12042 m_1stVectorIndex ^= 1;
+
+
+
+
+12047 VMA_HEAVY_ASSERT(Validate());
+
+
-12051 VmaBlockMetadata_Buddy::~VmaBlockMetadata_Buddy()
-
-12053 DeleteNode(m_Root);
-
-
-12056 void VmaBlockMetadata_Buddy::Init(VkDeviceSize size)
-
-12058 VmaBlockMetadata::Init(size);
-
-12060 m_UsableSize = VmaPrevPow2(size);
-12061 m_SumFreeSize = m_UsableSize;
-
-
-
-12065 while(m_LevelCount < MAX_LEVELS &&
-12066 LevelToNodeSize(m_LevelCount) >= MIN_NODE_SIZE)
-
-
-
-
-12071 Node* rootNode = vma_new(GetAllocationCallbacks(), Node)();
-12072 rootNode->offset = 0;
-12073 rootNode->type = Node::TYPE_FREE;
-12074 rootNode->parent = VMA_NULL;
-12075 rootNode->buddy = VMA_NULL;
-
-
-12078 AddToFreeListFront(0, rootNode);
-
-
-12081 bool VmaBlockMetadata_Buddy::Validate()
const
-
-
-12084 ValidationContext ctx;
-12085 if(!ValidateNode(ctx, VMA_NULL, m_Root, 0, LevelToNodeSize(0)))
-
-12087 VMA_VALIDATE(
false &&
"ValidateNode failed.");
-
-12089 VMA_VALIDATE(m_AllocationCount == ctx.calculatedAllocationCount);
-12090 VMA_VALIDATE(m_SumFreeSize == ctx.calculatedSumFreeSize);
-
-
-12093 for(uint32_t level = 0; level < m_LevelCount; ++level)
-
-12095 VMA_VALIDATE(m_FreeList[level].front == VMA_NULL ||
-12096 m_FreeList[level].front->free.prev == VMA_NULL);
-
-12098 for(Node* node = m_FreeList[level].front;
-
-12100 node = node->free.next)
-
-12102 VMA_VALIDATE(node->type == Node::TYPE_FREE);
-
-12104 if(node->free.next == VMA_NULL)
-
-12106 VMA_VALIDATE(m_FreeList[level].back == node);
-
-
-
-12110 VMA_VALIDATE(node->free.next->free.prev == node);
-
-
-
-
-
-12116 for(uint32_t level = m_LevelCount; level < MAX_LEVELS; ++level)
-
-12118 VMA_VALIDATE(m_FreeList[level].front == VMA_NULL && m_FreeList[level].back == VMA_NULL);
-
-
-
-
-
-12124 VkDeviceSize VmaBlockMetadata_Buddy::GetUnusedRangeSizeMax()
const
-
-12126 for(uint32_t level = 0; level < m_LevelCount; ++level)
-
-12128 if(m_FreeList[level].front != VMA_NULL)
-
-12130 return LevelToNodeSize(level);
-
+
+
+12054 VmaBlockMetadata_Buddy::VmaBlockMetadata_Buddy(
VmaAllocator hAllocator) :
+12055 VmaBlockMetadata(hAllocator),
+
+12057 m_AllocationCount(0),
+
+
+
+12061 memset(m_FreeList, 0,
sizeof(m_FreeList));
+
+
+12064 VmaBlockMetadata_Buddy::~VmaBlockMetadata_Buddy()
+
+12066 DeleteNode(m_Root);
+
+
+12069 void VmaBlockMetadata_Buddy::Init(VkDeviceSize size)
+
+12071 VmaBlockMetadata::Init(size);
+
+12073 m_UsableSize = VmaPrevPow2(size);
+12074 m_SumFreeSize = m_UsableSize;
+
+
+
+12078 while(m_LevelCount < MAX_LEVELS &&
+12079 LevelToNodeSize(m_LevelCount) >= MIN_NODE_SIZE)
+
+
+
+
+12084 Node* rootNode = vma_new(GetAllocationCallbacks(), Node)();
+12085 rootNode->offset = 0;
+12086 rootNode->type = Node::TYPE_FREE;
+12087 rootNode->parent = VMA_NULL;
+12088 rootNode->buddy = VMA_NULL;
+
+
+12091 AddToFreeListFront(0, rootNode);
+
+
+12094 bool VmaBlockMetadata_Buddy::Validate()
const
+
+
+12097 ValidationContext ctx;
+12098 if(!ValidateNode(ctx, VMA_NULL, m_Root, 0, LevelToNodeSize(0)))
+
+12100 VMA_VALIDATE(
false &&
"ValidateNode failed.");
+
+12102 VMA_VALIDATE(m_AllocationCount == ctx.calculatedAllocationCount);
+12103 VMA_VALIDATE(m_SumFreeSize == ctx.calculatedSumFreeSize);
+
+
+12106 for(uint32_t level = 0; level < m_LevelCount; ++level)
+
+12108 VMA_VALIDATE(m_FreeList[level].front == VMA_NULL ||
+12109 m_FreeList[level].front->free.prev == VMA_NULL);
+
+12111 for(Node* node = m_FreeList[level].front;
+
+12113 node = node->free.next)
+
+12115 VMA_VALIDATE(node->type == Node::TYPE_FREE);
+
+12117 if(node->free.next == VMA_NULL)
+
+12119 VMA_VALIDATE(m_FreeList[level].back == node);
+
+
+
+12123 VMA_VALIDATE(node->free.next->free.prev == node);
+
+
+
+
+
+12129 for(uint32_t level = m_LevelCount; level < MAX_LEVELS; ++level)
+
+12131 VMA_VALIDATE(m_FreeList[level].front == VMA_NULL && m_FreeList[level].back == VMA_NULL);
-
-
-
-12136 void VmaBlockMetadata_Buddy::CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const
-
-12138 const VkDeviceSize unusableSize = GetUnusableSize();
-
-
-
-
-
-
-
-
-
+
+
+
+
+12137 VkDeviceSize VmaBlockMetadata_Buddy::GetUnusedRangeSizeMax()
const
+
+12139 for(uint32_t level = 0; level < m_LevelCount; ++level)
+
+12141 if(m_FreeList[level].front != VMA_NULL)
+
+12143 return LevelToNodeSize(level);
+
+
+
+
-12149 CalcAllocationStatInfoNode(outInfo, m_Root, LevelToNodeSize(0));
-
-12151 if(unusableSize > 0)
-
-
-
-
-
-
-
-
-12160 void VmaBlockMetadata_Buddy::AddPoolStats(
VmaPoolStats& inoutStats)
const
-
-12162 const VkDeviceSize unusableSize = GetUnusableSize();
+12149 void VmaBlockMetadata_Buddy::CalcAllocationStatInfo(
VmaStatInfo& outInfo)
const
+
+12151 const VkDeviceSize unusableSize = GetUnusableSize();
+
+
+
+
+
+
+
+
+
+
+12162 CalcAllocationStatInfoNode(outInfo, m_Root, LevelToNodeSize(0));
-12164 inoutStats.
size += GetSize();
-12165 inoutStats.
unusedSize += m_SumFreeSize + unusableSize;
-
-
-
-
-12170 if(unusableSize > 0)
-
-
-
-
-
+12164 if(unusableSize > 0)
+
+
+
+
+
+
+
+
+12173 void VmaBlockMetadata_Buddy::AddPoolStats(
VmaPoolStats& inoutStats)
const
+
+12175 const VkDeviceSize unusableSize = GetUnusableSize();
-12177 #if VMA_STATS_STRING_ENABLED
-
-12179 void VmaBlockMetadata_Buddy::PrintDetailedMap(
class VmaJsonWriter& json)
const
-
-
-
-12183 CalcAllocationStatInfo(stat);
-
-12185 PrintDetailedMap_Begin(
-
-
-
-
-
-12191 PrintDetailedMapNode(json, m_Root, LevelToNodeSize(0));
-
-12193 const VkDeviceSize unusableSize = GetUnusableSize();
-12194 if(unusableSize > 0)
-
-12196 PrintDetailedMap_UnusedRange(json,
-
-
-
-
-12201 PrintDetailedMap_End(json);
-
+12177 inoutStats.
size += GetSize();
+12178 inoutStats.
unusedSize += m_SumFreeSize + unusableSize;
+
+
+
+
+12183 if(unusableSize > 0)
+
+
+
+
+
+
+12190 #if VMA_STATS_STRING_ENABLED
+
+12192 void VmaBlockMetadata_Buddy::PrintDetailedMap(
class VmaJsonWriter& json)
const
+
+
+
+12196 CalcAllocationStatInfo(stat);
+
+12198 PrintDetailedMap_Begin(
+
+
+
+
-
+12204 PrintDetailedMapNode(json, m_Root, LevelToNodeSize(0));
-12206 bool VmaBlockMetadata_Buddy::CreateAllocationRequest(
-12207 uint32_t currentFrameIndex,
-12208 uint32_t frameInUseCount,
-12209 VkDeviceSize bufferImageGranularity,
-12210 VkDeviceSize allocSize,
-12211 VkDeviceSize allocAlignment,
-
-12213 VmaSuballocationType allocType,
-12214 bool canMakeOtherLost,
-
-12216 VmaAllocationRequest* pAllocationRequest)
-
-12218 VMA_ASSERT(!upperAddress &&
"VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT can be used only with linear algorithm.");
-
-
-
-12222 if(allocType == VMA_SUBALLOCATION_TYPE_UNKNOWN ||
-12223 allocType == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
-12224 allocType == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL)
-
-12226 allocAlignment = VMA_MAX(allocAlignment, bufferImageGranularity);
-12227 allocSize = VMA_MAX(allocSize, bufferImageGranularity);
-
-
-12230 if(allocSize > m_UsableSize)
-
-
-
-
-12235 const uint32_t targetLevel = AllocSizeToLevel(allocSize);
-12236 for(uint32_t level = targetLevel + 1; level--; )
-
-12238 for(Node* freeNode = m_FreeList[level].front;
-12239 freeNode != VMA_NULL;
-12240 freeNode = freeNode->free.next)
-
-12242 if(freeNode->offset % allocAlignment == 0)
-
-12244 pAllocationRequest->type = VmaAllocationRequestType::Normal;
-12245 pAllocationRequest->offset = freeNode->offset;
-12246 pAllocationRequest->sumFreeSize = LevelToNodeSize(level);
-12247 pAllocationRequest->sumItemSize = 0;
-12248 pAllocationRequest->itemsToMakeLostCount = 0;
-12249 pAllocationRequest->customData = (
void*)(uintptr_t)level;
-
-
-
-
-
-
-
-
-12258 bool VmaBlockMetadata_Buddy::MakeRequestedAllocationsLost(
-12259 uint32_t currentFrameIndex,
-12260 uint32_t frameInUseCount,
-12261 VmaAllocationRequest* pAllocationRequest)
-
-
-
-
-
-12267 return pAllocationRequest->itemsToMakeLostCount == 0;
-
-
-12270 uint32_t VmaBlockMetadata_Buddy::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
-
-
-
-
-
-
-
-
-12279 void VmaBlockMetadata_Buddy::Alloc(
-12280 const VmaAllocationRequest& request,
-12281 VmaSuballocationType type,
-12282 VkDeviceSize allocSize,
-
+12206 const VkDeviceSize unusableSize = GetUnusableSize();
+12207 if(unusableSize > 0)
+
+12209 PrintDetailedMap_UnusedRange(json,
+
+
+
+
+12214 PrintDetailedMap_End(json);
+
+
+
+
+12219 bool VmaBlockMetadata_Buddy::CreateAllocationRequest(
+12220 uint32_t currentFrameIndex,
+12221 uint32_t frameInUseCount,
+12222 VkDeviceSize bufferImageGranularity,
+12223 VkDeviceSize allocSize,
+12224 VkDeviceSize allocAlignment,
+
+12226 VmaSuballocationType allocType,
+12227 bool canMakeOtherLost,
+
+12229 VmaAllocationRequest* pAllocationRequest)
+
+12231 VMA_ASSERT(!upperAddress &&
"VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT can be used only with linear algorithm.");
+
+
+
+12235 if(allocType == VMA_SUBALLOCATION_TYPE_UNKNOWN ||
+12236 allocType == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
+12237 allocType == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL)
+
+12239 allocAlignment = VMA_MAX(allocAlignment, bufferImageGranularity);
+12240 allocSize = VMA_MAX(allocSize, bufferImageGranularity);
+
+
+12243 if(allocSize > m_UsableSize)
+
+
+
+
+12248 const uint32_t targetLevel = AllocSizeToLevel(allocSize);
+12249 for(uint32_t level = targetLevel + 1; level--; )
+
+12251 for(Node* freeNode = m_FreeList[level].front;
+12252 freeNode != VMA_NULL;
+12253 freeNode = freeNode->free.next)
+
+12255 if(freeNode->offset % allocAlignment == 0)
+
+12257 pAllocationRequest->type = VmaAllocationRequestType::Normal;
+12258 pAllocationRequest->offset = freeNode->offset;
+12259 pAllocationRequest->sumFreeSize = LevelToNodeSize(level);
+12260 pAllocationRequest->sumItemSize = 0;
+12261 pAllocationRequest->itemsToMakeLostCount = 0;
+12262 pAllocationRequest->customData = (
void*)(uintptr_t)level;
+
+
+
+
+
+
+
+
+12271 bool VmaBlockMetadata_Buddy::MakeRequestedAllocationsLost(
+12272 uint32_t currentFrameIndex,
+12273 uint32_t frameInUseCount,
+12274 VmaAllocationRequest* pAllocationRequest)
+
+
+
+
+
+12280 return pAllocationRequest->itemsToMakeLostCount == 0;
+
+
+12283 uint32_t VmaBlockMetadata_Buddy::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
-12285 VMA_ASSERT(request.type == VmaAllocationRequestType::Normal);
-
-12287 const uint32_t targetLevel = AllocSizeToLevel(allocSize);
-12288 uint32_t currLevel = (uint32_t)(uintptr_t)request.customData;
-
-12290 Node* currNode = m_FreeList[currLevel].front;
-12291 VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE);
-12292 while(currNode->offset != request.offset)
-
-12294 currNode = currNode->free.next;
-12295 VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE);
-
-
-
-12299 while(currLevel < targetLevel)
-
-
-
-12303 RemoveFromFreeList(currLevel, currNode);
-
-12305 const uint32_t childrenLevel = currLevel + 1;
-
-
-12308 Node* leftChild = vma_new(GetAllocationCallbacks(), Node)();
-12309 Node* rightChild = vma_new(GetAllocationCallbacks(), Node)();
+
+
+
+
+
+
+
+12292 void VmaBlockMetadata_Buddy::Alloc(
+12293 const VmaAllocationRequest& request,
+12294 VmaSuballocationType type,
+12295 VkDeviceSize allocSize,
+
+
+12298 VMA_ASSERT(request.type == VmaAllocationRequestType::Normal);
+
+12300 const uint32_t targetLevel = AllocSizeToLevel(allocSize);
+12301 uint32_t currLevel = (uint32_t)(uintptr_t)request.customData;
+
+12303 Node* currNode = m_FreeList[currLevel].front;
+12304 VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE);
+12305 while(currNode->offset != request.offset)
+
+12307 currNode = currNode->free.next;
+12308 VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE);
+
-12311 leftChild->offset = currNode->offset;
-12312 leftChild->type = Node::TYPE_FREE;
-12313 leftChild->parent = currNode;
-12314 leftChild->buddy = rightChild;
-
-12316 rightChild->offset = currNode->offset + LevelToNodeSize(childrenLevel);
-12317 rightChild->type = Node::TYPE_FREE;
-12318 rightChild->parent = currNode;
-12319 rightChild->buddy = leftChild;
-
-
-12322 currNode->type = Node::TYPE_SPLIT;
-12323 currNode->split.leftChild = leftChild;
-
-
-12326 AddToFreeListFront(childrenLevel, rightChild);
-12327 AddToFreeListFront(childrenLevel, leftChild);
+
+12312 while(currLevel < targetLevel)
+
+
+
+12316 RemoveFromFreeList(currLevel, currNode);
+
+12318 const uint32_t childrenLevel = currLevel + 1;
+
+
+12321 Node* leftChild = vma_new(GetAllocationCallbacks(), Node)();
+12322 Node* rightChild = vma_new(GetAllocationCallbacks(), Node)();
+
+12324 leftChild->offset = currNode->offset;
+12325 leftChild->type = Node::TYPE_FREE;
+12326 leftChild->parent = currNode;
+12327 leftChild->buddy = rightChild;
-
-
-
-12332 currNode = m_FreeList[currLevel].front;
+12329 rightChild->offset = currNode->offset + LevelToNodeSize(childrenLevel);
+12330 rightChild->type = Node::TYPE_FREE;
+12331 rightChild->parent = currNode;
+12332 rightChild->buddy = leftChild;
-
-
-
-
-
-
-
-12341 VMA_ASSERT(currLevel == targetLevel &&
-12342 currNode != VMA_NULL &&
-12343 currNode->type == Node::TYPE_FREE);
-12344 RemoveFromFreeList(currLevel, currNode);
-
-
-12347 currNode->type = Node::TYPE_ALLOCATION;
-12348 currNode->allocation.alloc = hAllocation;
-
-12350 ++m_AllocationCount;
-
-12352 m_SumFreeSize -= allocSize;
-
-
-12355 void VmaBlockMetadata_Buddy::DeleteNode(Node* node)
-
-12357 if(node->type == Node::TYPE_SPLIT)
-
-12359 DeleteNode(node->split.leftChild->buddy);
-12360 DeleteNode(node->split.leftChild);
-
+
+12335 currNode->type = Node::TYPE_SPLIT;
+12336 currNode->split.leftChild = leftChild;
+
+
+12339 AddToFreeListFront(childrenLevel, rightChild);
+12340 AddToFreeListFront(childrenLevel, leftChild);
+
+
+
+
+12345 currNode = m_FreeList[currLevel].front;
+
+
+
+
+
+
+
+
+12354 VMA_ASSERT(currLevel == targetLevel &&
+12355 currNode != VMA_NULL &&
+12356 currNode->type == Node::TYPE_FREE);
+12357 RemoveFromFreeList(currLevel, currNode);
+
+
+12360 currNode->type = Node::TYPE_ALLOCATION;
+12361 currNode->allocation.alloc = hAllocation;
-12363 vma_delete(GetAllocationCallbacks(), node);
-
-
-12366 bool VmaBlockMetadata_Buddy::ValidateNode(ValidationContext& ctx,
const Node* parent,
const Node* curr, uint32_t level, VkDeviceSize levelNodeSize)
const
-
-12368 VMA_VALIDATE(level < m_LevelCount);
-12369 VMA_VALIDATE(curr->parent == parent);
-12370 VMA_VALIDATE((curr->buddy == VMA_NULL) == (parent == VMA_NULL));
-12371 VMA_VALIDATE(curr->buddy == VMA_NULL || curr->buddy->buddy == curr);
-
-
-12374 case Node::TYPE_FREE:
-
-12376 ctx.calculatedSumFreeSize += levelNodeSize;
-12377 ++ctx.calculatedFreeCount;
-
-12379 case Node::TYPE_ALLOCATION:
-12380 ++ctx.calculatedAllocationCount;
-12381 ctx.calculatedSumFreeSize += levelNodeSize - curr->allocation.alloc->GetSize();
-12382 VMA_VALIDATE(curr->allocation.alloc != VK_NULL_HANDLE);
-
-12384 case Node::TYPE_SPLIT:
-
-12386 const uint32_t childrenLevel = level + 1;
-12387 const VkDeviceSize childrenLevelNodeSize = levelNodeSize / 2;
-12388 const Node*
const leftChild = curr->split.leftChild;
-12389 VMA_VALIDATE(leftChild != VMA_NULL);
-12390 VMA_VALIDATE(leftChild->offset == curr->offset);
-12391 if(!ValidateNode(ctx, curr, leftChild, childrenLevel, childrenLevelNodeSize))
-
-12393 VMA_VALIDATE(
false &&
"ValidateNode for left child failed.");
-
-12395 const Node*
const rightChild = leftChild->buddy;
-12396 VMA_VALIDATE(rightChild->offset == curr->offset + childrenLevelNodeSize);
-12397 if(!ValidateNode(ctx, curr, rightChild, childrenLevel, childrenLevelNodeSize))
-
-12399 VMA_VALIDATE(
false &&
"ValidateNode for right child failed.");
-
-
-
-
-
-
-
-
-
-
-12410 uint32_t VmaBlockMetadata_Buddy::AllocSizeToLevel(VkDeviceSize allocSize)
const
-
-
-12413 uint32_t level = 0;
-12414 VkDeviceSize currLevelNodeSize = m_UsableSize;
-12415 VkDeviceSize nextLevelNodeSize = currLevelNodeSize >> 1;
-12416 while(allocSize <= nextLevelNodeSize && level + 1 < m_LevelCount)
-
-
-12419 currLevelNodeSize = nextLevelNodeSize;
-12420 nextLevelNodeSize = currLevelNodeSize >> 1;
-
-
-
-
-12425 void VmaBlockMetadata_Buddy::FreeAtOffset(
VmaAllocation alloc, VkDeviceSize offset)
-
-
-12428 Node* node = m_Root;
-12429 VkDeviceSize nodeOffset = 0;
-12430 uint32_t level = 0;
-12431 VkDeviceSize levelNodeSize = LevelToNodeSize(0);
-12432 while(node->type == Node::TYPE_SPLIT)
-
-12434 const VkDeviceSize nextLevelSize = levelNodeSize >> 1;
-12435 if(offset < nodeOffset + nextLevelSize)
-
-12437 node = node->split.leftChild;
-
-
-
-12441 node = node->split.leftChild->buddy;
-12442 nodeOffset += nextLevelSize;
-
-
-12445 levelNodeSize = nextLevelSize;
-
-
-12448 VMA_ASSERT(node != VMA_NULL && node->type == Node::TYPE_ALLOCATION);
-12449 VMA_ASSERT(alloc == VK_NULL_HANDLE || node->allocation.alloc == alloc);
-
-
-12452 --m_AllocationCount;
-12453 m_SumFreeSize += alloc->GetSize();
-
-12455 node->type = Node::TYPE_FREE;
-
-
-12458 while(level > 0 && node->buddy->type == Node::TYPE_FREE)
-
-12460 RemoveFromFreeList(level, node->buddy);
-12461 Node*
const parent = node->parent;
-
-12463 vma_delete(GetAllocationCallbacks(), node->buddy);
-12464 vma_delete(GetAllocationCallbacks(), node);
-12465 parent->type = Node::TYPE_FREE;
-
-
-
-
-
-
-
-12473 AddToFreeListFront(level, node);
-
+12363 ++m_AllocationCount;
+
+12365 m_SumFreeSize -= allocSize;
+
+
+12368 void VmaBlockMetadata_Buddy::DeleteNode(Node* node)
+
+12370 if(node->type == Node::TYPE_SPLIT)
+
+12372 DeleteNode(node->split.leftChild->buddy);
+12373 DeleteNode(node->split.leftChild);
+
+
+12376 vma_delete(GetAllocationCallbacks(), node);
+
+
+12379 bool VmaBlockMetadata_Buddy::ValidateNode(ValidationContext& ctx,
const Node* parent,
const Node* curr, uint32_t level, VkDeviceSize levelNodeSize)
const
+
+12381 VMA_VALIDATE(level < m_LevelCount);
+12382 VMA_VALIDATE(curr->parent == parent);
+12383 VMA_VALIDATE((curr->buddy == VMA_NULL) == (parent == VMA_NULL));
+12384 VMA_VALIDATE(curr->buddy == VMA_NULL || curr->buddy->buddy == curr);
+
+
+12387 case Node::TYPE_FREE:
+
+12389 ctx.calculatedSumFreeSize += levelNodeSize;
+12390 ++ctx.calculatedFreeCount;
+
+12392 case Node::TYPE_ALLOCATION:
+12393 ++ctx.calculatedAllocationCount;
+12394 ctx.calculatedSumFreeSize += levelNodeSize - curr->allocation.alloc->GetSize();
+12395 VMA_VALIDATE(curr->allocation.alloc != VK_NULL_HANDLE);
+
+12397 case Node::TYPE_SPLIT:
+
+12399 const uint32_t childrenLevel = level + 1;
+12400 const VkDeviceSize childrenLevelNodeSize = levelNodeSize / 2;
+12401 const Node*
const leftChild = curr->split.leftChild;
+12402 VMA_VALIDATE(leftChild != VMA_NULL);
+12403 VMA_VALIDATE(leftChild->offset == curr->offset);
+12404 if(!ValidateNode(ctx, curr, leftChild, childrenLevel, childrenLevelNodeSize))
+
+12406 VMA_VALIDATE(
false &&
"ValidateNode for left child failed.");
+
+12408 const Node*
const rightChild = leftChild->buddy;
+12409 VMA_VALIDATE(rightChild->offset == curr->offset + childrenLevelNodeSize);
+12410 if(!ValidateNode(ctx, curr, rightChild, childrenLevel, childrenLevelNodeSize))
+
+12412 VMA_VALIDATE(
false &&
"ValidateNode for right child failed.");
+
+
+
+
+
+
+
+
+
+
+12423 uint32_t VmaBlockMetadata_Buddy::AllocSizeToLevel(VkDeviceSize allocSize)
const
+
+
+12426 uint32_t level = 0;
+12427 VkDeviceSize currLevelNodeSize = m_UsableSize;
+12428 VkDeviceSize nextLevelNodeSize = currLevelNodeSize >> 1;
+12429 while(allocSize <= nextLevelNodeSize && level + 1 < m_LevelCount)
+
+
+12432 currLevelNodeSize = nextLevelNodeSize;
+12433 nextLevelNodeSize = currLevelNodeSize >> 1;
+
+
+
+
+12438 void VmaBlockMetadata_Buddy::FreeAtOffset(
VmaAllocation alloc, VkDeviceSize offset)
+
+
+12441 Node* node = m_Root;
+12442 VkDeviceSize nodeOffset = 0;
+12443 uint32_t level = 0;
+12444 VkDeviceSize levelNodeSize = LevelToNodeSize(0);
+12445 while(node->type == Node::TYPE_SPLIT)
+
+12447 const VkDeviceSize nextLevelSize = levelNodeSize >> 1;
+12448 if(offset < nodeOffset + nextLevelSize)
+
+12450 node = node->split.leftChild;
+
+
+
+12454 node = node->split.leftChild->buddy;
+12455 nodeOffset += nextLevelSize;
+
+
+12458 levelNodeSize = nextLevelSize;
+
+
+12461 VMA_ASSERT(node != VMA_NULL && node->type == Node::TYPE_ALLOCATION);
+12462 VMA_ASSERT(alloc == VK_NULL_HANDLE || node->allocation.alloc == alloc);
+
+
+12465 --m_AllocationCount;
+12466 m_SumFreeSize += alloc->GetSize();
+
+12468 node->type = Node::TYPE_FREE;
+
+
+12471 while(level > 0 && node->buddy->type == Node::TYPE_FREE)
+
+12473 RemoveFromFreeList(level, node->buddy);
+12474 Node*
const parent = node->parent;
-12476 void VmaBlockMetadata_Buddy::CalcAllocationStatInfoNode(
VmaStatInfo& outInfo,
const Node* node, VkDeviceSize levelNodeSize)
const
-
-
-
-12480 case Node::TYPE_FREE:
-
-
-
-
-
-12486 case Node::TYPE_ALLOCATION:
-
-12488 const VkDeviceSize allocSize = node->allocation.alloc->GetSize();
-
-
-
-
-
-12494 const VkDeviceSize unusedRangeSize = levelNodeSize - allocSize;
-12495 if(unusedRangeSize > 0)
-
-
-
-
-
-
-
-
-12504 case Node::TYPE_SPLIT:
-
-12506 const VkDeviceSize childrenNodeSize = levelNodeSize / 2;
-12507 const Node*
const leftChild = node->split.leftChild;
-12508 CalcAllocationStatInfoNode(outInfo, leftChild, childrenNodeSize);
-12509 const Node*
const rightChild = leftChild->buddy;
-12510 CalcAllocationStatInfoNode(outInfo, rightChild, childrenNodeSize);
-
-
-
-
-
-
-
-12518 void VmaBlockMetadata_Buddy::AddToFreeListFront(uint32_t level, Node* node)
-
-12520 VMA_ASSERT(node->type == Node::TYPE_FREE);
-
-
-12523 Node*
const frontNode = m_FreeList[level].front;
-12524 if(frontNode == VMA_NULL)
-
-12526 VMA_ASSERT(m_FreeList[level].back == VMA_NULL);
-12527 node->free.prev = node->free.next = VMA_NULL;
-12528 m_FreeList[level].front = m_FreeList[level].back = node;
-
-
-
-12532 VMA_ASSERT(frontNode->free.prev == VMA_NULL);
-12533 node->free.prev = VMA_NULL;
-12534 node->free.next = frontNode;
-12535 frontNode->free.prev = node;
-12536 m_FreeList[level].front = node;
-
-
-
-12540 void VmaBlockMetadata_Buddy::RemoveFromFreeList(uint32_t level, Node* node)
-
-12542 VMA_ASSERT(m_FreeList[level].front != VMA_NULL);
-
-
-12545 if(node->free.prev == VMA_NULL)
-
-12547 VMA_ASSERT(m_FreeList[level].front == node);
-12548 m_FreeList[level].front = node->free.next;
-
-
-
-12552 Node*
const prevFreeNode = node->free.prev;
-12553 VMA_ASSERT(prevFreeNode->free.next == node);
-12554 prevFreeNode->free.next = node->free.next;
-
+12476 vma_delete(GetAllocationCallbacks(), node->buddy);
+12477 vma_delete(GetAllocationCallbacks(), node);
+12478 parent->type = Node::TYPE_FREE;
+
+
+
+
+
+
+
+12486 AddToFreeListFront(level, node);
+
+
+12489 void VmaBlockMetadata_Buddy::CalcAllocationStatInfoNode(
VmaStatInfo& outInfo,
const Node* node, VkDeviceSize levelNodeSize)
const
+
+
+
+12493 case Node::TYPE_FREE:
+
+
+
+
+
+12499 case Node::TYPE_ALLOCATION:
+
+12501 const VkDeviceSize allocSize = node->allocation.alloc->GetSize();
+
+
+
+
+
+12507 const VkDeviceSize unusedRangeSize = levelNodeSize - allocSize;
+12508 if(unusedRangeSize > 0)
+
+
+
+
+
+
+
+
+12517 case Node::TYPE_SPLIT:
+
+12519 const VkDeviceSize childrenNodeSize = levelNodeSize / 2;
+12520 const Node*
const leftChild = node->split.leftChild;
+12521 CalcAllocationStatInfoNode(outInfo, leftChild, childrenNodeSize);
+12522 const Node*
const rightChild = leftChild->buddy;
+12523 CalcAllocationStatInfoNode(outInfo, rightChild, childrenNodeSize);
+
+
+
+
+
+
+
+12531 void VmaBlockMetadata_Buddy::AddToFreeListFront(uint32_t level, Node* node)
+
+12533 VMA_ASSERT(node->type == Node::TYPE_FREE);
+
+
+12536 Node*
const frontNode = m_FreeList[level].front;
+12537 if(frontNode == VMA_NULL)
+
+12539 VMA_ASSERT(m_FreeList[level].back == VMA_NULL);
+12540 node->free.prev = node->free.next = VMA_NULL;
+12541 m_FreeList[level].front = m_FreeList[level].back = node;
+
+
+
+12545 VMA_ASSERT(frontNode->free.prev == VMA_NULL);
+12546 node->free.prev = VMA_NULL;
+12547 node->free.next = frontNode;
+12548 frontNode->free.prev = node;
+12549 m_FreeList[level].front = node;
+
+
+
+12553 void VmaBlockMetadata_Buddy::RemoveFromFreeList(uint32_t level, Node* node)
+
+12555 VMA_ASSERT(m_FreeList[level].front != VMA_NULL);
-
-12558 if(node->free.next == VMA_NULL)
+
+12558 if(node->free.prev == VMA_NULL)
-12560 VMA_ASSERT(m_FreeList[level].back == node);
-12561 m_FreeList[level].back = node->free.prev;
+12560 VMA_ASSERT(m_FreeList[level].front == node);
+12561 m_FreeList[level].front = node->free.next;
-12565 Node*
const nextFreeNode = node->free.next;
-12566 VMA_ASSERT(nextFreeNode->free.prev == node);
-12567 nextFreeNode->free.prev = node->free.prev;
+12565 Node*
const prevFreeNode = node->free.prev;
+12566 VMA_ASSERT(prevFreeNode->free.next == node);
+12567 prevFreeNode->free.next = node->free.next;
-
-
-12571 #if VMA_STATS_STRING_ENABLED
-12572 void VmaBlockMetadata_Buddy::PrintDetailedMapNode(
class VmaJsonWriter& json,
const Node* node, VkDeviceSize levelNodeSize)
const
-
-
-
-12576 case Node::TYPE_FREE:
-12577 PrintDetailedMap_UnusedRange(json, node->offset, levelNodeSize);
-
-12579 case Node::TYPE_ALLOCATION:
-
-12581 PrintDetailedMap_Allocation(json, node->offset, node->allocation.alloc);
-12582 const VkDeviceSize allocSize = node->allocation.alloc->GetSize();
-12583 if(allocSize < levelNodeSize)
-
-12585 PrintDetailedMap_UnusedRange(json, node->offset + allocSize, levelNodeSize - allocSize);
-
-
-
-12589 case Node::TYPE_SPLIT:
-
-12591 const VkDeviceSize childrenNodeSize = levelNodeSize / 2;
-12592 const Node*
const leftChild = node->split.leftChild;
-12593 PrintDetailedMapNode(json, leftChild, childrenNodeSize);
-12594 const Node*
const rightChild = leftChild->buddy;
-12595 PrintDetailedMapNode(json, rightChild, childrenNodeSize);
-
-
-
-
-
-
-
-
-
-
-
-12608 VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(
VmaAllocator hAllocator) :
-12609 m_pMetadata(VMA_NULL),
-12610 m_MemoryTypeIndex(UINT32_MAX),
-
-12612 m_hMemory(VK_NULL_HANDLE),
-
-12614 m_pMappedData(VMA_NULL)
-
-
+
+
+12571 if(node->free.next == VMA_NULL)
+
+12573 VMA_ASSERT(m_FreeList[level].back == node);
+12574 m_FreeList[level].back = node->free.prev;
+
+
+
+12578 Node*
const nextFreeNode = node->free.next;
+12579 VMA_ASSERT(nextFreeNode->free.prev == node);
+12580 nextFreeNode->free.prev = node->free.prev;
+
+
+
+12584 #if VMA_STATS_STRING_ENABLED
+12585 void VmaBlockMetadata_Buddy::PrintDetailedMapNode(
class VmaJsonWriter& json,
const Node* node, VkDeviceSize levelNodeSize)
const
+
+
+
+12589 case Node::TYPE_FREE:
+12590 PrintDetailedMap_UnusedRange(json, node->offset, levelNodeSize);
+
+12592 case Node::TYPE_ALLOCATION:
+
+12594 PrintDetailedMap_Allocation(json, node->offset, node->allocation.alloc);
+12595 const VkDeviceSize allocSize = node->allocation.alloc->GetSize();
+12596 if(allocSize < levelNodeSize)
+
+12598 PrintDetailedMap_UnusedRange(json, node->offset + allocSize, levelNodeSize - allocSize);
+
+
+
+12602 case Node::TYPE_SPLIT:
+
+12604 const VkDeviceSize childrenNodeSize = levelNodeSize / 2;
+12605 const Node*
const leftChild = node->split.leftChild;
+12606 PrintDetailedMapNode(json, leftChild, childrenNodeSize);
+12607 const Node*
const rightChild = leftChild->buddy;
+12608 PrintDetailedMapNode(json, rightChild, childrenNodeSize);
+
+
+
+
+
+
+
+
-12618 void VmaDeviceMemoryBlock::Init(
-
-
-12621 uint32_t newMemoryTypeIndex,
-12622 VkDeviceMemory newMemory,
-12623 VkDeviceSize newSize,
-
-12625 uint32_t algorithm)
-
-12627 VMA_ASSERT(m_hMemory == VK_NULL_HANDLE);
-
-12629 m_hParentPool = hParentPool;
-12630 m_MemoryTypeIndex = newMemoryTypeIndex;
-
-12632 m_hMemory = newMemory;
-
-
-
-
-12637 m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Linear)(hAllocator);
-
-
-12640 m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Buddy)(hAllocator);
-
-
-
-
-
-12646 m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Generic)(hAllocator);
-
-12648 m_pMetadata->Init(newSize);
-
-
-12651 void VmaDeviceMemoryBlock::Destroy(
VmaAllocator allocator)
-
-
-
-12655 VMA_ASSERT(m_pMetadata->IsEmpty() &&
"Some allocations were not freed before destruction of this memory block!");
-
-12657 VMA_ASSERT(m_hMemory != VK_NULL_HANDLE);
-12658 allocator->FreeVulkanMemory(m_MemoryTypeIndex, m_pMetadata->GetSize(), m_hMemory);
-12659 m_hMemory = VK_NULL_HANDLE;
-
-12661 vma_delete(allocator, m_pMetadata);
-12662 m_pMetadata = VMA_NULL;
-
-
-12665 bool VmaDeviceMemoryBlock::Validate()
const
-
-12667 VMA_VALIDATE((m_hMemory != VK_NULL_HANDLE) &&
-12668 (m_pMetadata->GetSize() != 0));
+
+
+12621 VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(
VmaAllocator hAllocator) :
+12622 m_pMetadata(VMA_NULL),
+12623 m_MemoryTypeIndex(UINT32_MAX),
+
+12625 m_hMemory(VK_NULL_HANDLE),
+
+12627 m_pMappedData(VMA_NULL)
+
+
+
+12631 void VmaDeviceMemoryBlock::Init(
+
+
+12634 uint32_t newMemoryTypeIndex,
+12635 VkDeviceMemory newMemory,
+12636 VkDeviceSize newSize,
+
+12638 uint32_t algorithm)
+
+12640 VMA_ASSERT(m_hMemory == VK_NULL_HANDLE);
+
+12642 m_hParentPool = hParentPool;
+12643 m_MemoryTypeIndex = newMemoryTypeIndex;
+
+12645 m_hMemory = newMemory;
+
+
+
+
+12650 m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Linear)(hAllocator);
+
+
+12653 m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Buddy)(hAllocator);
+
+
+
+
+
+12659 m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Generic)(hAllocator);
+
+12661 m_pMetadata->Init(newSize);
+
+
+12664 void VmaDeviceMemoryBlock::Destroy(
VmaAllocator allocator)
+
+
+
+12668 VMA_ASSERT(m_pMetadata->IsEmpty() &&
"Some allocations were not freed before destruction of this memory block!");
-12670 return m_pMetadata->Validate();
-
-
-12673 VkResult VmaDeviceMemoryBlock::CheckCorruption(
VmaAllocator hAllocator)
-
-12675 void* pData =
nullptr;
-12676 VkResult res = Map(hAllocator, 1, &pData);
-12677 if(res != VK_SUCCESS)
-
-
-
-
-12682 res = m_pMetadata->CheckCorruption(pData);
-
-12684 Unmap(hAllocator, 1);
+12670 VMA_ASSERT(m_hMemory != VK_NULL_HANDLE);
+12671 allocator->FreeVulkanMemory(m_MemoryTypeIndex, m_pMetadata->GetSize(), m_hMemory);
+12672 m_hMemory = VK_NULL_HANDLE;
+
+12674 vma_delete(allocator, m_pMetadata);
+12675 m_pMetadata = VMA_NULL;
+
+
+12678 bool VmaDeviceMemoryBlock::Validate()
const
+
+12680 VMA_VALIDATE((m_hMemory != VK_NULL_HANDLE) &&
+12681 (m_pMetadata->GetSize() != 0));
+
+12683 return m_pMetadata->Validate();
+
-
-
-
-12689 VkResult VmaDeviceMemoryBlock::Map(
VmaAllocator hAllocator, uint32_t count,
void** ppData)
-
-
-
-
-
-
-12696 VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
-12697 if(m_MapCount != 0)
-
-12699 m_MapCount += count;
-12700 VMA_ASSERT(m_pMappedData != VMA_NULL);
-12701 if(ppData != VMA_NULL)
-
-12703 *ppData = m_pMappedData;
-
-
-
-
-
-12709 VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)(
-12710 hAllocator->m_hDevice,
-
-
-
-
-
-12716 if(result == VK_SUCCESS)
-
-12718 if(ppData != VMA_NULL)
-
-12720 *ppData = m_pMappedData;
-
-12722 m_MapCount = count;
-
-
-
-
-
-12728 void VmaDeviceMemoryBlock::Unmap(
VmaAllocator hAllocator, uint32_t count)
-
-
-
-
-
-
-12735 VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
-12736 if(m_MapCount >= count)
-
-12738 m_MapCount -= count;
-12739 if(m_MapCount == 0)
-
-12741 m_pMappedData = VMA_NULL;
-12742 (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(hAllocator->m_hDevice, m_hMemory);
-
-
-
-
-12747 VMA_ASSERT(0 &&
"VkDeviceMemory block is being unmapped while it was not previously mapped.");
-
-
-
-12751 VkResult VmaDeviceMemoryBlock::WriteMagicValueAroundAllocation(
VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
-
-12753 VMA_ASSERT(VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_MARGIN % 4 == 0 && VMA_DEBUG_DETECT_CORRUPTION);
-12754 VMA_ASSERT(allocOffset >= VMA_DEBUG_MARGIN);
-
-
-12757 VkResult res = Map(hAllocator, 1, &pData);
-12758 if(res != VK_SUCCESS)
+12686 VkResult VmaDeviceMemoryBlock::CheckCorruption(
VmaAllocator hAllocator)
+
+12688 void* pData =
nullptr;
+12689 VkResult res = Map(hAllocator, 1, &pData);
+12690 if(res != VK_SUCCESS)
+
+
+
+
+12695 res = m_pMetadata->CheckCorruption(pData);
+
+12697 Unmap(hAllocator, 1);
+
+
+
+
+12702 VkResult VmaDeviceMemoryBlock::Map(
VmaAllocator hAllocator, uint32_t count,
void** ppData)
+
+
+
+
+
+
+12709 VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
+12710 if(m_MapCount != 0)
+
+12712 m_MapCount += count;
+12713 VMA_ASSERT(m_pMappedData != VMA_NULL);
+12714 if(ppData != VMA_NULL)
+
+12716 *ppData = m_pMappedData;
+
+
+
+
+
+12722 VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)(
+12723 hAllocator->m_hDevice,
+
+
+
+
+
+12729 if(result == VK_SUCCESS)
+
+12731 if(ppData != VMA_NULL)
+
+12733 *ppData = m_pMappedData;
+
+12735 m_MapCount = count;
+
+
+
+
+
+12741 void VmaDeviceMemoryBlock::Unmap(
VmaAllocator hAllocator, uint32_t count)
+
+
+
+
+
+
+12748 VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
+12749 if(m_MapCount >= count)
+
+12751 m_MapCount -= count;
+12752 if(m_MapCount == 0)
+
+12754 m_pMappedData = VMA_NULL;
+12755 (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(hAllocator->m_hDevice, m_hMemory);
+
+
+
-
+12760 VMA_ASSERT(0 &&
"VkDeviceMemory block is being unmapped while it was not previously mapped.");
-
-12763 VmaWriteMagicValue(pData, allocOffset - VMA_DEBUG_MARGIN);
-12764 VmaWriteMagicValue(pData, allocOffset + allocSize);
-
-12766 Unmap(hAllocator, 1);
-
-
-
-
-12771 VkResult VmaDeviceMemoryBlock::ValidateMagicValueAroundAllocation(
VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
-
-12773 VMA_ASSERT(VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_MARGIN % 4 == 0 && VMA_DEBUG_DETECT_CORRUPTION);
-12774 VMA_ASSERT(allocOffset >= VMA_DEBUG_MARGIN);
+
+
+12764 VkResult VmaDeviceMemoryBlock::WriteMagicValueAroundAllocation(
VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
+
+12766 VMA_ASSERT(VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_MARGIN % 4 == 0 && VMA_DEBUG_DETECT_CORRUPTION);
+12767 VMA_ASSERT(allocOffset >= VMA_DEBUG_MARGIN);
+
+
+12770 VkResult res = Map(hAllocator, 1, &pData);
+12771 if(res != VK_SUCCESS)
+
+
+
-
-12777 VkResult res = Map(hAllocator, 1, &pData);
-12778 if(res != VK_SUCCESS)
-
-
-
-
-12783 if(!VmaValidateMagicValue(pData, allocOffset - VMA_DEBUG_MARGIN))
-
-12785 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED BEFORE FREED ALLOCATION!");
-
-12787 else if(!VmaValidateMagicValue(pData, allocOffset + allocSize))
-
-12789 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED AFTER FREED ALLOCATION!");
-
-
-12792 Unmap(hAllocator, 1);
-
-
-
-
-12797 VkResult VmaDeviceMemoryBlock::BindBufferMemory(
-
-
-12800 VkDeviceSize allocationLocalOffset,
-
-
-
-12804 VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
-12805 hAllocation->GetBlock() ==
this);
-12806 VMA_ASSERT(allocationLocalOffset < hAllocation->GetSize() &&
-12807 "Invalid allocationLocalOffset. Did you forget that this offset is relative to the beginning of the allocation, not the whole memory block?");
-12808 const VkDeviceSize memoryOffset = hAllocation->GetOffset() + allocationLocalOffset;
-
-12810 VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
-12811 return hAllocator->BindVulkanBuffer(m_hMemory, memoryOffset, hBuffer, pNext);
-
-
-12814 VkResult VmaDeviceMemoryBlock::BindImageMemory(
-
-
-12817 VkDeviceSize allocationLocalOffset,
-
-
-
-12821 VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
-12822 hAllocation->GetBlock() ==
this);
-12823 VMA_ASSERT(allocationLocalOffset < hAllocation->GetSize() &&
-12824 "Invalid allocationLocalOffset. Did you forget that this offset is relative to the beginning of the allocation, not the whole memory block?");
-12825 const VkDeviceSize memoryOffset = hAllocation->GetOffset() + allocationLocalOffset;
-
-12827 VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
-12828 return hAllocator->BindVulkanImage(m_hMemory, memoryOffset, hImage, pNext);
-
-
-
-
-12833 memset(&outInfo, 0,
sizeof(outInfo));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-12852 static void VmaPostprocessCalcStatInfo(
VmaStatInfo& inoutInfo)
+12776 VmaWriteMagicValue(pData, allocOffset - VMA_DEBUG_MARGIN);
+12777 VmaWriteMagicValue(pData, allocOffset + allocSize);
+
+12779 Unmap(hAllocator, 1);
+
+
+
+
+12784 VkResult VmaDeviceMemoryBlock::ValidateMagicValueAroundAllocation(
VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
+
+12786 VMA_ASSERT(VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_MARGIN % 4 == 0 && VMA_DEBUG_DETECT_CORRUPTION);
+12787 VMA_ASSERT(allocOffset >= VMA_DEBUG_MARGIN);
+
+
+12790 VkResult res = Map(hAllocator, 1, &pData);
+12791 if(res != VK_SUCCESS)
+
+
+
+
+12796 if(!VmaValidateMagicValue(pData, allocOffset - VMA_DEBUG_MARGIN))
+
+12798 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED BEFORE FREED ALLOCATION!");
+
+12800 else if(!VmaValidateMagicValue(pData, allocOffset + allocSize))
+
+12802 VMA_ASSERT(0 &&
"MEMORY CORRUPTION DETECTED AFTER FREED ALLOCATION!");
+
+
+12805 Unmap(hAllocator, 1);
+
+
+
+
+12810 VkResult VmaDeviceMemoryBlock::BindBufferMemory(
+
+
+12813 VkDeviceSize allocationLocalOffset,
+
+
+
+12817 VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
+12818 hAllocation->GetBlock() ==
this);
+12819 VMA_ASSERT(allocationLocalOffset < hAllocation->GetSize() &&
+12820 "Invalid allocationLocalOffset. Did you forget that this offset is relative to the beginning of the allocation, not the whole memory block?");
+12821 const VkDeviceSize memoryOffset = hAllocation->GetOffset() + allocationLocalOffset;
+
+12823 VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
+12824 return hAllocator->BindVulkanBuffer(m_hMemory, memoryOffset, hBuffer, pNext);
+
+
+12827 VkResult VmaDeviceMemoryBlock::BindImageMemory(
+
+
+12830 VkDeviceSize allocationLocalOffset,
+
+
+
+12834 VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
+12835 hAllocation->GetBlock() ==
this);
+12836 VMA_ASSERT(allocationLocalOffset < hAllocation->GetSize() &&
+12837 "Invalid allocationLocalOffset. Did you forget that this offset is relative to the beginning of the allocation, not the whole memory block?");
+12838 const VkDeviceSize memoryOffset = hAllocation->GetOffset() + allocationLocalOffset;
+
+12840 VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
+12841 return hAllocator->BindVulkanImage(m_hMemory, memoryOffset, hImage, pNext);
+
+
+
+
+12846 memset(&outInfo, 0,
sizeof(outInfo));
+
+
+
+
+
+
-
-
-
-
-
-
-12860 VmaPool_T::VmaPool_T(
-
-
-12863 VkDeviceSize preferredBlockSize) :
-
-
-
-12867 createInfo.memoryTypeIndex,
-12868 createInfo.blockSize != 0 ? createInfo.blockSize : preferredBlockSize,
-12869 createInfo.minBlockCount,
-12870 createInfo.maxBlockCount,
-
-12872 createInfo.frameInUseCount,
-12873 createInfo.blockSize != 0,
-
-12875 createInfo.priority),
-
-
-
-
-
-12881 VmaPool_T::~VmaPool_T()
-
-12883 VMA_ASSERT(m_PrevPool == VMA_NULL && m_NextPool == VMA_NULL);
-
-
-12886 void VmaPool_T::SetName(
const char* pName)
-
-12888 const VkAllocationCallbacks* allocs = m_BlockVector.GetAllocator()->GetAllocationCallbacks();
-12889 VmaFreeString(allocs, m_Name);
-
-12891 if(pName != VMA_NULL)
-
-12893 m_Name = VmaCreateStringCopy(allocs, pName);
-
-
-
-
-
-
-
-12901 #if VMA_STATS_STRING_ENABLED
-
-
+
+
+
+
+
+
+
+
+
+
+
+12865 static void VmaPostprocessCalcStatInfo(
VmaStatInfo& inoutInfo)
+
+
+
+
+
+
+
+12873 VmaPool_T::VmaPool_T(
+
+
+12876 VkDeviceSize preferredBlockSize) :
+
+
+
+12880 createInfo.memoryTypeIndex,
+12881 createInfo.blockSize != 0 ? createInfo.blockSize : preferredBlockSize,
+12882 createInfo.minBlockCount,
+12883 createInfo.maxBlockCount,
+
+12885 createInfo.frameInUseCount,
+12886 createInfo.blockSize != 0,
+
+12888 createInfo.priority,
+12889 VMA_MAX(hAllocator->GetMemoryTypeMinAlignment(createInfo.memoryTypeIndex), createInfo.minAllocationAlignment)),
+
+
+
+
+
+12895 VmaPool_T::~VmaPool_T()
+
+12897 VMA_ASSERT(m_PrevPool == VMA_NULL && m_NextPool == VMA_NULL);
+
+
+12900 void VmaPool_T::SetName(
const char* pName)
+
+12902 const VkAllocationCallbacks* allocs = m_BlockVector.GetAllocator()->GetAllocationCallbacks();
+12903 VmaFreeString(allocs, m_Name);
-12905 VmaBlockVector::VmaBlockVector(
-
-
-12908 uint32_t memoryTypeIndex,
-12909 VkDeviceSize preferredBlockSize,
-12910 size_t minBlockCount,
-12911 size_t maxBlockCount,
-12912 VkDeviceSize bufferImageGranularity,
-12913 uint32_t frameInUseCount,
-12914 bool explicitBlockSize,
-12915 uint32_t algorithm,
-
-12917 m_hAllocator(hAllocator),
-12918 m_hParentPool(hParentPool),
-12919 m_MemoryTypeIndex(memoryTypeIndex),
-12920 m_PreferredBlockSize(preferredBlockSize),
-12921 m_MinBlockCount(minBlockCount),
-12922 m_MaxBlockCount(maxBlockCount),
-12923 m_BufferImageGranularity(bufferImageGranularity),
-12924 m_FrameInUseCount(frameInUseCount),
-12925 m_ExplicitBlockSize(explicitBlockSize),
-12926 m_Algorithm(algorithm),
-12927 m_Priority(priority),
-12928 m_HasEmptyBlock(false),
-12929 m_Blocks(VmaStlAllocator<VmaDeviceMemoryBlock*>(hAllocator->GetAllocationCallbacks())),
-
-
-
-
-12934 VmaBlockVector::~VmaBlockVector()
-
-12936 for(
size_t i = m_Blocks.size(); i--; )
-
-12938 m_Blocks[i]->Destroy(m_hAllocator);
-12939 vma_delete(m_hAllocator, m_Blocks[i]);
-
-
-
-12943 VkResult VmaBlockVector::CreateMinBlocks()
-
-12945 for(
size_t i = 0; i < m_MinBlockCount; ++i)
-
-12947 VkResult res = CreateBlock(m_PreferredBlockSize, VMA_NULL);
-12948 if(res != VK_SUCCESS)
-
-
-
-
-
-
-
-12956 void VmaBlockVector::GetPoolStats(
VmaPoolStats* pStats)
-
-12958 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
-
-12960 const size_t blockCount = m_Blocks.size();
-
-
-
-
-
-
-
-
-12969 for(uint32_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
-
-12971 const VmaDeviceMemoryBlock*
const pBlock = m_Blocks[blockIndex];
-12972 VMA_ASSERT(pBlock);
-12973 VMA_HEAVY_ASSERT(pBlock->Validate());
-12974 pBlock->m_pMetadata->AddPoolStats(*pStats);
-
-
+12905 if(pName != VMA_NULL)
+
+12907 m_Name = VmaCreateStringCopy(allocs, pName);
+
+
+
+
+
+
+
+12915 #if VMA_STATS_STRING_ENABLED
+
+
+
+12919 VmaBlockVector::VmaBlockVector(
+
+
+12922 uint32_t memoryTypeIndex,
+12923 VkDeviceSize preferredBlockSize,
+12924 size_t minBlockCount,
+12925 size_t maxBlockCount,
+12926 VkDeviceSize bufferImageGranularity,
+12927 uint32_t frameInUseCount,
+12928 bool explicitBlockSize,
+12929 uint32_t algorithm,
+
+12931 VkDeviceSize minAllocationAlignment) :
+12932 m_hAllocator(hAllocator),
+12933 m_hParentPool(hParentPool),
+12934 m_MemoryTypeIndex(memoryTypeIndex),
+12935 m_PreferredBlockSize(preferredBlockSize),
+12936 m_MinBlockCount(minBlockCount),
+12937 m_MaxBlockCount(maxBlockCount),
+12938 m_BufferImageGranularity(bufferImageGranularity),
+12939 m_FrameInUseCount(frameInUseCount),
+12940 m_ExplicitBlockSize(explicitBlockSize),
+12941 m_Algorithm(algorithm),
+12942 m_Priority(priority),
+12943 m_MinAllocationAlignment(minAllocationAlignment),
+12944 m_HasEmptyBlock(false),
+12945 m_Blocks(VmaStlAllocator<VmaDeviceMemoryBlock*>(hAllocator->GetAllocationCallbacks())),
+
+
+
+
+12950 VmaBlockVector::~VmaBlockVector()
+
+12952 for(
size_t i = m_Blocks.size(); i--; )
+
+12954 m_Blocks[i]->Destroy(m_hAllocator);
+12955 vma_delete(m_hAllocator, m_Blocks[i]);
+
+
+
+12959 VkResult VmaBlockVector::CreateMinBlocks()
+
+12961 for(
size_t i = 0; i < m_MinBlockCount; ++i)
+
+12963 VkResult res = CreateBlock(m_PreferredBlockSize, VMA_NULL);
+12964 if(res != VK_SUCCESS)
+
+
+
+
+
+
+
+12972 void VmaBlockVector::GetPoolStats(
VmaPoolStats* pStats)
+
+12974 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
+
+12976 const size_t blockCount = m_Blocks.size();
-12978 bool VmaBlockVector::IsEmpty()
-
-12980 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
-12981 return m_Blocks.empty();
-
-
-12984 bool VmaBlockVector::IsCorruptionDetectionEnabled()
const
-
-12986 const uint32_t requiredMemFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
-12987 return (VMA_DEBUG_DETECT_CORRUPTION != 0) &&
-12988 (VMA_DEBUG_MARGIN > 0) &&
-
-12990 (m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags & requiredMemFlags) == requiredMemFlags;
-
-
-12993 static const uint32_t VMA_ALLOCATION_TRY_COUNT = 32;
-
-12995 VkResult VmaBlockVector::Allocate(
-12996 uint32_t currentFrameIndex,
-
-12998 VkDeviceSize alignment,
-
-13000 VmaSuballocationType suballocType,
-13001 size_t allocationCount,
-
-
-
-13005 VkResult res = VK_SUCCESS;
-
-13007 if(IsCorruptionDetectionEnabled())
-
-13009 size = VmaAlignUp<VkDeviceSize>(size,
sizeof(VMA_CORRUPTION_DETECTION_MAGIC_VALUE));
-13010 alignment = VmaAlignUp<VkDeviceSize>(alignment,
sizeof(VMA_CORRUPTION_DETECTION_MAGIC_VALUE));
-
-
-
-13014 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
-13015 for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
-
-13017 res = AllocatePage(
-
-
-
-
-
-13023 pAllocations + allocIndex);
-13024 if(res != VK_SUCCESS)
-
-
-
-
+
+
+
+
+
+
+
+12985 for(uint32_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+
+12987 const VmaDeviceMemoryBlock*
const pBlock = m_Blocks[blockIndex];
+12988 VMA_ASSERT(pBlock);
+12989 VMA_HEAVY_ASSERT(pBlock->Validate());
+12990 pBlock->m_pMetadata->AddPoolStats(*pStats);
+
+
+
+12994 bool VmaBlockVector::IsEmpty()
+
+12996 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
+12997 return m_Blocks.empty();
+
+
+13000 bool VmaBlockVector::IsCorruptionDetectionEnabled()
const
+
+13002 const uint32_t requiredMemFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
+13003 return (VMA_DEBUG_DETECT_CORRUPTION != 0) &&
+13004 (VMA_DEBUG_MARGIN > 0) &&
+
+13006 (m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags & requiredMemFlags) == requiredMemFlags;
+
+
+13009 static const uint32_t VMA_ALLOCATION_TRY_COUNT = 32;
+
+13011 VkResult VmaBlockVector::Allocate(
+13012 uint32_t currentFrameIndex,
+
+13014 VkDeviceSize alignment,
+
+13016 VmaSuballocationType suballocType,
+13017 size_t allocationCount,
+
+
+
+13021 VkResult res = VK_SUCCESS;
+
+13023 alignment = VMA_MAX(alignment, m_MinAllocationAlignment);
+
+13025 if(IsCorruptionDetectionEnabled())
+
+13027 size = VmaAlignUp<VkDeviceSize>(size,
sizeof(VMA_CORRUPTION_DETECTION_MAGIC_VALUE));
+13028 alignment = VmaAlignUp<VkDeviceSize>(alignment,
sizeof(VMA_CORRUPTION_DETECTION_MAGIC_VALUE));
-13031 if(res != VK_SUCCESS)
-
-
-13034 const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
-13035 while(allocIndex--)
-
-13037 VmaAllocation_T*
const alloc = pAllocations[allocIndex];
-13038 const VkDeviceSize allocSize = alloc->GetSize();
-
-13040 m_hAllocator->m_Budget.RemoveAllocation(heapIndex, allocSize);
-
-13042 memset(pAllocations, 0,
sizeof(
VmaAllocation) * allocationCount);
-
-
-
-
-
-13048 VkResult VmaBlockVector::AllocatePage(
-13049 uint32_t currentFrameIndex,
-
-13051 VkDeviceSize alignment,
-
-13053 VmaSuballocationType suballocType,
-
-
-
-
-
-
-
-13061 VkDeviceSize freeMemory;
-
-13063 const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
-
-13065 m_hAllocator->GetBudget(&heapBudget, heapIndex, 1);
-
-
-
-13069 const bool canFallbackToDedicated = !IsCustomPool();
-13070 const bool canCreateNewBlock =
-
-13072 (m_Blocks.size() < m_MaxBlockCount) &&
-13073 (freeMemory >= size || !canFallbackToDedicated);
-
-
-
-
-
-
-13080 canMakeOtherLost =
false;
-
-
-
-13084 if(isUpperAddress &&
-
-
-13087 return VK_ERROR_FEATURE_NOT_PRESENT;
-
-
-
-
-
-
-
-
-
-
-
-
-
-13101 return VK_ERROR_FEATURE_NOT_PRESENT;
-
-
-
-13105 if(size + 2 * VMA_DEBUG_MARGIN > m_PreferredBlockSize)
-
-13107 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-
-
-
-
-
-13115 if(!canMakeOtherLost || canCreateNewBlock)
-
-
-
-
-
-
-
-
-13124 if(!m_Blocks.empty())
-
-13126 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks.back();
-13127 VMA_ASSERT(pCurrBlock);
-13128 VkResult res = AllocateFromBlock(
-
-
-
-
-
-
-
-
-
-13138 if(res == VK_SUCCESS)
-
-13140 VMA_DEBUG_LOG(
" Returned from last block #%u", pCurrBlock->GetId());
-
-
-
-
-
-
-
-
-
-13150 for(
size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex )
-
-13152 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks[blockIndex];
-13153 VMA_ASSERT(pCurrBlock);
-13154 VkResult res = AllocateFromBlock(
-
-
-
-
-
-
-
-
-
-13164 if(res == VK_SUCCESS)
-
-13166 VMA_DEBUG_LOG(
" Returned from existing block #%u", pCurrBlock->GetId());
-
-
-
-
-
-
-
-13174 for(
size_t blockIndex = m_Blocks.size(); blockIndex--; )
-
-13176 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks[blockIndex];
-13177 VMA_ASSERT(pCurrBlock);
-13178 VkResult res = AllocateFromBlock(
-
-
-
-
-
-
-
-
-
-13188 if(res == VK_SUCCESS)
-
-13190 VMA_DEBUG_LOG(
" Returned from existing block #%u", pCurrBlock->GetId());
-
-
-
-
-
-
-
-13198 if(canCreateNewBlock)
-
-
-13201 VkDeviceSize newBlockSize = m_PreferredBlockSize;
-13202 uint32_t newBlockSizeShift = 0;
-13203 const uint32_t NEW_BLOCK_SIZE_SHIFT_MAX = 3;
-
-13205 if(!m_ExplicitBlockSize)
-
-
-13208 const VkDeviceSize maxExistingBlockSize = CalcMaxBlockSize();
-13209 for(uint32_t i = 0; i < NEW_BLOCK_SIZE_SHIFT_MAX; ++i)
-
-13211 const VkDeviceSize smallerNewBlockSize = newBlockSize / 2;
-13212 if(smallerNewBlockSize > maxExistingBlockSize && smallerNewBlockSize >= size * 2)
-
-13214 newBlockSize = smallerNewBlockSize;
-13215 ++newBlockSizeShift;
-
-
-
-
-
-
-
-
-13224 size_t newBlockIndex = 0;
-13225 VkResult res = (newBlockSize <= freeMemory || !canFallbackToDedicated) ?
-13226 CreateBlock(newBlockSize, &newBlockIndex) : VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-13228 if(!m_ExplicitBlockSize)
-
-13230 while(res < 0 && newBlockSizeShift < NEW_BLOCK_SIZE_SHIFT_MAX)
-
-13232 const VkDeviceSize smallerNewBlockSize = newBlockSize / 2;
-13233 if(smallerNewBlockSize >= size)
-
-13235 newBlockSize = smallerNewBlockSize;
-13236 ++newBlockSizeShift;
-13237 res = (newBlockSize <= freeMemory || !canFallbackToDedicated) ?
-13238 CreateBlock(newBlockSize, &newBlockIndex) : VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-
-
-
-
-
-
-13247 if(res == VK_SUCCESS)
-
-13249 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[newBlockIndex];
-13250 VMA_ASSERT(pBlock->m_pMetadata->GetSize() >= size);
-
-13252 res = AllocateFromBlock(
-
-
-
-
-
-
-
-
-
-13262 if(res == VK_SUCCESS)
-
-13264 VMA_DEBUG_LOG(
" Created new block #%u Size=%llu", pBlock->GetId(), newBlockSize);
-
-
-
-
-
-13270 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-
-
-
-
-13277 if(canMakeOtherLost)
-
-13279 uint32_t tryIndex = 0;
-13280 for(; tryIndex < VMA_ALLOCATION_TRY_COUNT; ++tryIndex)
-
-13282 VmaDeviceMemoryBlock* pBestRequestBlock = VMA_NULL;
-13283 VmaAllocationRequest bestRequest = {};
-13284 VkDeviceSize bestRequestCost = VK_WHOLE_SIZE;
-
-
-
-
-
-13290 for(
size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex )
-
-13292 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks[blockIndex];
-13293 VMA_ASSERT(pCurrBlock);
-13294 VmaAllocationRequest currRequest = {};
-13295 if(pCurrBlock->m_pMetadata->CreateAllocationRequest(
-
-
-13298 m_BufferImageGranularity,
-
-
-
-
-
-
-
-
-13307 const VkDeviceSize currRequestCost = currRequest.CalcCost();
-13308 if(pBestRequestBlock == VMA_NULL ||
-13309 currRequestCost < bestRequestCost)
-
-13311 pBestRequestBlock = pCurrBlock;
-13312 bestRequest = currRequest;
-13313 bestRequestCost = currRequestCost;
-
-13315 if(bestRequestCost == 0)
-
-
-
-
-
-
-
-
-
-
-13326 for(
size_t blockIndex = m_Blocks.size(); blockIndex--; )
-
-13328 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks[blockIndex];
-13329 VMA_ASSERT(pCurrBlock);
-13330 VmaAllocationRequest currRequest = {};
-13331 if(pCurrBlock->m_pMetadata->CreateAllocationRequest(
-
-
-13334 m_BufferImageGranularity,
-
-
-
-
-
-
-
-
-13343 const VkDeviceSize currRequestCost = currRequest.CalcCost();
-13344 if(pBestRequestBlock == VMA_NULL ||
-13345 currRequestCost < bestRequestCost ||
-
-
-13348 pBestRequestBlock = pCurrBlock;
-13349 bestRequest = currRequest;
-13350 bestRequestCost = currRequestCost;
-
-13352 if(bestRequestCost == 0 ||
-
-
-
-
-
-
-
-
-
-13362 if(pBestRequestBlock != VMA_NULL)
-
-
-
-13366 VkResult res = pBestRequestBlock->Map(m_hAllocator, 1, VMA_NULL);
-13367 if(res != VK_SUCCESS)
-
-
-
-
-
-13373 if(pBestRequestBlock->m_pMetadata->MakeRequestedAllocationsLost(
-
-
-
-
-
-13379 *pAllocation = m_hAllocator->m_AllocationObjectAllocator.Allocate(currentFrameIndex, isUserDataString);
-13380 pBestRequestBlock->m_pMetadata->Alloc(bestRequest, suballocType, size, *pAllocation);
-13381 UpdateHasEmptyBlock();
-13382 (*pAllocation)->InitBlockAllocation(
-
-13384 bestRequest.offset,
-
-
-
-
-
-
-13391 VMA_HEAVY_ASSERT(pBestRequestBlock->Validate());
-13392 VMA_DEBUG_LOG(
" Returned from existing block");
-13393 (*pAllocation)->SetUserData(m_hAllocator, createInfo.
pUserData);
-13394 m_hAllocator->m_Budget.AddAllocation(m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex), size);
-13395 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
-
-13397 m_hAllocator->FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
-
-13399 if(IsCorruptionDetectionEnabled())
-
-13401 VkResult res = pBestRequestBlock->WriteMagicValueAroundAllocation(m_hAllocator, bestRequest.offset, size);
-13402 VMA_ASSERT(res == VK_SUCCESS &&
"Couldn't map block memory to write magic value.");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-13417 if(tryIndex == VMA_ALLOCATION_TRY_COUNT)
-
-13419 return VK_ERROR_TOO_MANY_OBJECTS;
-
-
-
-13423 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-13426 void VmaBlockVector::Free(
-
-
-13429 VmaDeviceMemoryBlock* pBlockToDelete = VMA_NULL;
-
-13431 bool budgetExceeded =
false;
-
-13433 const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
-
-13435 m_hAllocator->GetBudget(&heapBudget, heapIndex, 1);
-13436 budgetExceeded = heapBudget.
usage >= heapBudget.
budget;
-
-
-
-
-13441 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
-
-13443 VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock();
-
-13445 if(IsCorruptionDetectionEnabled())
-
-13447 VkResult res = pBlock->ValidateMagicValueAroundAllocation(m_hAllocator, hAllocation->GetOffset(), hAllocation->GetSize());
-13448 VMA_ASSERT(res == VK_SUCCESS &&
"Couldn't map block memory to validate magic value.");
-
-
-13451 if(hAllocation->IsPersistentMap())
-
-13453 pBlock->Unmap(m_hAllocator, 1);
-
-
-13456 pBlock->m_pMetadata->Free(hAllocation);
-13457 VMA_HEAVY_ASSERT(pBlock->Validate());
-
-13459 VMA_DEBUG_LOG(
" Freed from MemoryTypeIndex=%u", m_MemoryTypeIndex);
+
+13032 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
+13033 for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+
+13035 res = AllocatePage(
+
+
+
+
+
+13041 pAllocations + allocIndex);
+13042 if(res != VK_SUCCESS)
+
+
+
+
+
+
+13049 if(res != VK_SUCCESS)
+
+
+13052 const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
+13053 while(allocIndex--)
+
+13055 VmaAllocation_T*
const alloc = pAllocations[allocIndex];
+13056 const VkDeviceSize allocSize = alloc->GetSize();
+
+13058 m_hAllocator->m_Budget.RemoveAllocation(heapIndex, allocSize);
+
+13060 memset(pAllocations, 0,
sizeof(
VmaAllocation) * allocationCount);
+
+
+
+
+
+13066 VkResult VmaBlockVector::AllocatePage(
+13067 uint32_t currentFrameIndex,
+
+13069 VkDeviceSize alignment,
+
+13071 VmaSuballocationType suballocType,
+
+
+
+
+
+
+
+13079 VkDeviceSize freeMemory;
+
+13081 const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
+
+13083 m_hAllocator->GetBudget(&heapBudget, heapIndex, 1);
+
+
+
+13087 const bool canFallbackToDedicated = !IsCustomPool();
+13088 const bool canCreateNewBlock =
+
+13090 (m_Blocks.size() < m_MaxBlockCount) &&
+13091 (freeMemory >= size || !canFallbackToDedicated);
+
+
+
+
+
+
+13098 canMakeOtherLost =
false;
+
+
+
+13102 if(isUpperAddress &&
+
+
+13105 return VK_ERROR_FEATURE_NOT_PRESENT;
+
+
+
+
+
+
+
+
+
+
+
+
+
+13119 return VK_ERROR_FEATURE_NOT_PRESENT;
+
+
+
+13123 if(size + 2 * VMA_DEBUG_MARGIN > m_PreferredBlockSize)
+
+13125 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+
+
+
+
+
+13133 if(!canMakeOtherLost || canCreateNewBlock)
+
+
+
+
+
+
+
+
+13142 if(!m_Blocks.empty())
+
+13144 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks.back();
+13145 VMA_ASSERT(pCurrBlock);
+13146 VkResult res = AllocateFromBlock(
+
+
+
+
+
+
+
+
+
+13156 if(res == VK_SUCCESS)
+
+13158 VMA_DEBUG_LOG(
" Returned from last block #%u", pCurrBlock->GetId());
+
+
+
+
+
+
+
+
+
+13168 for(
size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex )
+
+13170 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks[blockIndex];
+13171 VMA_ASSERT(pCurrBlock);
+13172 VkResult res = AllocateFromBlock(
+
+
+
+
+
+
+
+
+
+13182 if(res == VK_SUCCESS)
+
+13184 VMA_DEBUG_LOG(
" Returned from existing block #%u", pCurrBlock->GetId());
+
+
+
+
+
+
+
+13192 for(
size_t blockIndex = m_Blocks.size(); blockIndex--; )
+
+13194 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks[blockIndex];
+13195 VMA_ASSERT(pCurrBlock);
+13196 VkResult res = AllocateFromBlock(
+
+
+
+
+
+
+
+
+
+13206 if(res == VK_SUCCESS)
+
+13208 VMA_DEBUG_LOG(
" Returned from existing block #%u", pCurrBlock->GetId());
+
+
+
+
+
+
+
+13216 if(canCreateNewBlock)
+
+
+13219 VkDeviceSize newBlockSize = m_PreferredBlockSize;
+13220 uint32_t newBlockSizeShift = 0;
+13221 const uint32_t NEW_BLOCK_SIZE_SHIFT_MAX = 3;
+
+13223 if(!m_ExplicitBlockSize)
+
+
+13226 const VkDeviceSize maxExistingBlockSize = CalcMaxBlockSize();
+13227 for(uint32_t i = 0; i < NEW_BLOCK_SIZE_SHIFT_MAX; ++i)
+
+13229 const VkDeviceSize smallerNewBlockSize = newBlockSize / 2;
+13230 if(smallerNewBlockSize > maxExistingBlockSize && smallerNewBlockSize >= size * 2)
+
+13232 newBlockSize = smallerNewBlockSize;
+13233 ++newBlockSizeShift;
+
+
+
+
+
+
+
+
+13242 size_t newBlockIndex = 0;
+13243 VkResult res = (newBlockSize <= freeMemory || !canFallbackToDedicated) ?
+13244 CreateBlock(newBlockSize, &newBlockIndex) : VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+13246 if(!m_ExplicitBlockSize)
+
+13248 while(res < 0 && newBlockSizeShift < NEW_BLOCK_SIZE_SHIFT_MAX)
+
+13250 const VkDeviceSize smallerNewBlockSize = newBlockSize / 2;
+13251 if(smallerNewBlockSize >= size)
+
+13253 newBlockSize = smallerNewBlockSize;
+13254 ++newBlockSizeShift;
+13255 res = (newBlockSize <= freeMemory || !canFallbackToDedicated) ?
+13256 CreateBlock(newBlockSize, &newBlockIndex) : VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+
+
+
+
+
+
+13265 if(res == VK_SUCCESS)
+
+13267 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[newBlockIndex];
+13268 VMA_ASSERT(pBlock->m_pMetadata->GetSize() >= size);
+
+13270 res = AllocateFromBlock(
+
+
+
+
+
+
+
+
+
+13280 if(res == VK_SUCCESS)
+
+13282 VMA_DEBUG_LOG(
" Created new block #%u Size=%llu", pBlock->GetId(), newBlockSize);
+
+
+
+
+
+13288 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+
+
+
+
+13295 if(canMakeOtherLost)
+
+13297 uint32_t tryIndex = 0;
+13298 for(; tryIndex < VMA_ALLOCATION_TRY_COUNT; ++tryIndex)
+
+13300 VmaDeviceMemoryBlock* pBestRequestBlock = VMA_NULL;
+13301 VmaAllocationRequest bestRequest = {};
+13302 VkDeviceSize bestRequestCost = VK_WHOLE_SIZE;
+
+
+
+
+
+13308 for(
size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex )
+
+13310 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks[blockIndex];
+13311 VMA_ASSERT(pCurrBlock);
+13312 VmaAllocationRequest currRequest = {};
+13313 if(pCurrBlock->m_pMetadata->CreateAllocationRequest(
+
+
+13316 m_BufferImageGranularity,
+
+
+
+
+
+
+
+
+13325 const VkDeviceSize currRequestCost = currRequest.CalcCost();
+13326 if(pBestRequestBlock == VMA_NULL ||
+13327 currRequestCost < bestRequestCost)
+
+13329 pBestRequestBlock = pCurrBlock;
+13330 bestRequest = currRequest;
+13331 bestRequestCost = currRequestCost;
+
+13333 if(bestRequestCost == 0)
+
+
+
+
+
+
+
+
+
+
+13344 for(
size_t blockIndex = m_Blocks.size(); blockIndex--; )
+
+13346 VmaDeviceMemoryBlock*
const pCurrBlock = m_Blocks[blockIndex];
+13347 VMA_ASSERT(pCurrBlock);
+13348 VmaAllocationRequest currRequest = {};
+13349 if(pCurrBlock->m_pMetadata->CreateAllocationRequest(
+
+
+13352 m_BufferImageGranularity,
+
+
+
+
+
+
+
+
+13361 const VkDeviceSize currRequestCost = currRequest.CalcCost();
+13362 if(pBestRequestBlock == VMA_NULL ||
+13363 currRequestCost < bestRequestCost ||
+
+
+13366 pBestRequestBlock = pCurrBlock;
+13367 bestRequest = currRequest;
+13368 bestRequestCost = currRequestCost;
+
+13370 if(bestRequestCost == 0 ||
+
+
+
+
+
+
+
+
+
+13380 if(pBestRequestBlock != VMA_NULL)
+
+
+
+13384 VkResult res = pBestRequestBlock->Map(m_hAllocator, 1, VMA_NULL);
+13385 if(res != VK_SUCCESS)
+
+
+
+
+
+13391 if(pBestRequestBlock->m_pMetadata->MakeRequestedAllocationsLost(
+
+
+
+
+
+13397 *pAllocation = m_hAllocator->m_AllocationObjectAllocator.Allocate(currentFrameIndex, isUserDataString);
+13398 pBestRequestBlock->m_pMetadata->Alloc(bestRequest, suballocType, size, *pAllocation);
+13399 UpdateHasEmptyBlock();
+13400 (*pAllocation)->InitBlockAllocation(
+
+13402 bestRequest.offset,
+
+
+
+
+
+
+13409 VMA_HEAVY_ASSERT(pBestRequestBlock->Validate());
+13410 VMA_DEBUG_LOG(
" Returned from existing block");
+13411 (*pAllocation)->SetUserData(m_hAllocator, createInfo.
pUserData);
+13412 m_hAllocator->m_Budget.AddAllocation(m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex), size);
+13413 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
+
+13415 m_hAllocator->FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
+
+13417 if(IsCorruptionDetectionEnabled())
+
+13419 VkResult res = pBestRequestBlock->WriteMagicValueAroundAllocation(m_hAllocator, bestRequest.offset, size);
+13420 VMA_ASSERT(res == VK_SUCCESS &&
"Couldn't map block memory to write magic value.");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+13435 if(tryIndex == VMA_ALLOCATION_TRY_COUNT)
+
+13437 return VK_ERROR_TOO_MANY_OBJECTS;
+
+
+
+13441 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+13444 void VmaBlockVector::Free(
+
+
+13447 VmaDeviceMemoryBlock* pBlockToDelete = VMA_NULL;
+
+13449 bool budgetExceeded =
false;
+
+13451 const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
+
+13453 m_hAllocator->GetBudget(&heapBudget, heapIndex, 1);
+13454 budgetExceeded = heapBudget.
usage >= heapBudget.
budget;
+
+
+
+
+13459 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
-13461 const bool canDeleteBlock = m_Blocks.size() > m_MinBlockCount;
-
-13463 if(pBlock->m_pMetadata->IsEmpty())
+13461 VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock();
+
+13463 if(IsCorruptionDetectionEnabled())
-
-13466 if((m_HasEmptyBlock || budgetExceeded) && canDeleteBlock)
-
-13468 pBlockToDelete = pBlock;
-
-
-
+13465 VkResult res = pBlock->ValidateMagicValueAroundAllocation(m_hAllocator, hAllocation->GetOffset(), hAllocation->GetSize());
+13466 VMA_ASSERT(res == VK_SUCCESS &&
"Couldn't map block memory to validate magic value.");
+
+
+13469 if(hAllocation->IsPersistentMap())
+
+13471 pBlock->Unmap(m_hAllocator, 1);
-
-
-13475 else if(m_HasEmptyBlock && canDeleteBlock)
-
-13477 VmaDeviceMemoryBlock* pLastBlock = m_Blocks.back();
-13478 if(pLastBlock->m_pMetadata->IsEmpty())
-
-13480 pBlockToDelete = pLastBlock;
-13481 m_Blocks.pop_back();
-
-
-
-13485 UpdateHasEmptyBlock();
-13486 IncrementallySortBlocks();
-
-
-
-
-13491 if(pBlockToDelete != VMA_NULL)
-
-13493 VMA_DEBUG_LOG(
" Deleted empty block");
-13494 pBlockToDelete->Destroy(m_hAllocator);
-13495 vma_delete(m_hAllocator, pBlockToDelete);
-
-
-
-13499 VkDeviceSize VmaBlockVector::CalcMaxBlockSize()
const
-
-13501 VkDeviceSize result = 0;
-13502 for(
size_t i = m_Blocks.size(); i--; )
-
-13504 result = VMA_MAX(result, m_Blocks[i]->m_pMetadata->GetSize());
-13505 if(result >= m_PreferredBlockSize)
-
-
-
-
-
-
-
-13513 void VmaBlockVector::Remove(VmaDeviceMemoryBlock* pBlock)
-
-13515 for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
-
-13517 if(m_Blocks[blockIndex] == pBlock)
-
-13519 VmaVectorRemove(m_Blocks, blockIndex);
-
-
-
-
-
-
-13526 void VmaBlockVector::IncrementallySortBlocks()
-
-
-
-
-13531 for(
size_t i = 1; i < m_Blocks.size(); ++i)
-
-13533 if(m_Blocks[i - 1]->m_pMetadata->GetSumFreeSize() > m_Blocks[i]->m_pMetadata->GetSumFreeSize())
-
-13535 VMA_SWAP(m_Blocks[i - 1], m_Blocks[i]);
-
-
-
-
-
-
-13542 VkResult VmaBlockVector::AllocateFromBlock(
-13543 VmaDeviceMemoryBlock* pBlock,
-13544 uint32_t currentFrameIndex,
-
-13546 VkDeviceSize alignment,
-
-
-13549 VmaSuballocationType suballocType,
-
-
-
-
-
-
-
-
-13558 VmaAllocationRequest currRequest = {};
-13559 if(pBlock->m_pMetadata->CreateAllocationRequest(
-
-
-13562 m_BufferImageGranularity,
-
-
-
-
-
-
-
-
-
-13572 VMA_ASSERT(currRequest.itemsToMakeLostCount == 0);
-
-
-
-13576 VkResult res = pBlock->Map(m_hAllocator, 1, VMA_NULL);
-13577 if(res != VK_SUCCESS)
-
-
-
-
-
-13583 *pAllocation = m_hAllocator->m_AllocationObjectAllocator.Allocate(currentFrameIndex, isUserDataString);
-13584 pBlock->m_pMetadata->Alloc(currRequest, suballocType, size, *pAllocation);
-13585 UpdateHasEmptyBlock();
-13586 (*pAllocation)->InitBlockAllocation(
-
-13588 currRequest.offset,
-
-
-
-
-
-
-13595 VMA_HEAVY_ASSERT(pBlock->Validate());
-13596 (*pAllocation)->SetUserData(m_hAllocator, pUserData);
-13597 m_hAllocator->m_Budget.AddAllocation(m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex), size);
-13598 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
-
-13600 m_hAllocator->FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
-
-13602 if(IsCorruptionDetectionEnabled())
-
-13604 VkResult res = pBlock->WriteMagicValueAroundAllocation(m_hAllocator, currRequest.offset, size);
-13605 VMA_ASSERT(res == VK_SUCCESS &&
"Couldn't map block memory to write magic value.");
-
-
-
-13609 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-13612 VkResult VmaBlockVector::CreateBlock(VkDeviceSize blockSize,
size_t* pNewBlockIndex)
-
-13614 VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
-13615 allocInfo.memoryTypeIndex = m_MemoryTypeIndex;
-13616 allocInfo.allocationSize = blockSize;
-
-13618 #if VMA_BUFFER_DEVICE_ADDRESS
-
-13620 VkMemoryAllocateFlagsInfoKHR allocFlagsInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR };
-13621 if(m_hAllocator->m_UseKhrBufferDeviceAddress)
-
-13623 allocFlagsInfo.flags = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR;
-13624 VmaPnextChainPushFront(&allocInfo, &allocFlagsInfo);
-
-
-
-13628 #if VMA_MEMORY_PRIORITY
-13629 VkMemoryPriorityAllocateInfoEXT priorityInfo = { VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT };
-13630 if(m_hAllocator->m_UseExtMemoryPriority)
-
-13632 priorityInfo.priority = m_Priority;
-13633 VmaPnextChainPushFront(&allocInfo, &priorityInfo);
-
-
-
-13637 VkDeviceMemory mem = VK_NULL_HANDLE;
-13638 VkResult res = m_hAllocator->AllocateVulkanMemory(&allocInfo, &mem);
-
+
+13474 pBlock->m_pMetadata->Free(hAllocation);
+13475 VMA_HEAVY_ASSERT(pBlock->Validate());
+
+13477 VMA_DEBUG_LOG(
" Freed from MemoryTypeIndex=%u", m_MemoryTypeIndex);
+
+13479 const bool canDeleteBlock = m_Blocks.size() > m_MinBlockCount;
+
+13481 if(pBlock->m_pMetadata->IsEmpty())
+
+
+13484 if((m_HasEmptyBlock || budgetExceeded) && canDeleteBlock)
+
+13486 pBlockToDelete = pBlock;
+
+
+
+
+
+
+13493 else if(m_HasEmptyBlock && canDeleteBlock)
+
+13495 VmaDeviceMemoryBlock* pLastBlock = m_Blocks.back();
+13496 if(pLastBlock->m_pMetadata->IsEmpty())
+
+13498 pBlockToDelete = pLastBlock;
+13499 m_Blocks.pop_back();
+
+
+
+13503 UpdateHasEmptyBlock();
+13504 IncrementallySortBlocks();
+
+
+
+
+13509 if(pBlockToDelete != VMA_NULL)
+
+13511 VMA_DEBUG_LOG(
" Deleted empty block");
+13512 pBlockToDelete->Destroy(m_hAllocator);
+13513 vma_delete(m_hAllocator, pBlockToDelete);
+
+
+
+13517 VkDeviceSize VmaBlockVector::CalcMaxBlockSize()
const
+
+13519 VkDeviceSize result = 0;
+13520 for(
size_t i = m_Blocks.size(); i--; )
+
+13522 result = VMA_MAX(result, m_Blocks[i]->m_pMetadata->GetSize());
+13523 if(result >= m_PreferredBlockSize)
+
+
+
+
+
+
+
+13531 void VmaBlockVector::Remove(VmaDeviceMemoryBlock* pBlock)
+
+13533 for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
+
+13535 if(m_Blocks[blockIndex] == pBlock)
+
+13537 VmaVectorRemove(m_Blocks, blockIndex);
+
+
+
+
+
+
+13544 void VmaBlockVector::IncrementallySortBlocks()
+
+
+
+
+13549 for(
size_t i = 1; i < m_Blocks.size(); ++i)
+
+13551 if(m_Blocks[i - 1]->m_pMetadata->GetSumFreeSize() > m_Blocks[i]->m_pMetadata->GetSumFreeSize())
+
+13553 VMA_SWAP(m_Blocks[i - 1], m_Blocks[i]);
+
+
+
+
+
+
+13560 VkResult VmaBlockVector::AllocateFromBlock(
+13561 VmaDeviceMemoryBlock* pBlock,
+13562 uint32_t currentFrameIndex,
+
+13564 VkDeviceSize alignment,
+
+
+13567 VmaSuballocationType suballocType,
+
+
+
+
+
+
+
+
+13576 VmaAllocationRequest currRequest = {};
+13577 if(pBlock->m_pMetadata->CreateAllocationRequest(
+
+
+13580 m_BufferImageGranularity,
+
+
+
+
+
+
+
+
+
+13590 VMA_ASSERT(currRequest.itemsToMakeLostCount == 0);
+
+
+
+13594 VkResult res = pBlock->Map(m_hAllocator, 1, VMA_NULL);
+13595 if(res != VK_SUCCESS)
+
+
+
+
+
+13601 *pAllocation = m_hAllocator->m_AllocationObjectAllocator.Allocate(currentFrameIndex, isUserDataString);
+13602 pBlock->m_pMetadata->Alloc(currRequest, suballocType, size, *pAllocation);
+13603 UpdateHasEmptyBlock();
+13604 (*pAllocation)->InitBlockAllocation(
+
+13606 currRequest.offset,
+
+
+
+
+
+
+13613 VMA_HEAVY_ASSERT(pBlock->Validate());
+13614 (*pAllocation)->SetUserData(m_hAllocator, pUserData);
+13615 m_hAllocator->m_Budget.AddAllocation(m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex), size);
+13616 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
+
+13618 m_hAllocator->FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
+
+13620 if(IsCorruptionDetectionEnabled())
+
+13622 VkResult res = pBlock->WriteMagicValueAroundAllocation(m_hAllocator, currRequest.offset, size);
+13623 VMA_ASSERT(res == VK_SUCCESS &&
"Couldn't map block memory to write magic value.");
+
+
+
+13627 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+13630 VkResult VmaBlockVector::CreateBlock(VkDeviceSize blockSize,
size_t* pNewBlockIndex)
+
+13632 VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
+13633 allocInfo.memoryTypeIndex = m_MemoryTypeIndex;
+13634 allocInfo.allocationSize = blockSize;
+
+13636 #if VMA_BUFFER_DEVICE_ADDRESS
+
+13638 VkMemoryAllocateFlagsInfoKHR allocFlagsInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR };
+13639 if(m_hAllocator->m_UseKhrBufferDeviceAddress)
-
-
-
-
+13641 allocFlagsInfo.flags = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR;
+13642 VmaPnextChainPushFront(&allocInfo, &allocFlagsInfo);
+
+
-
-13647 VmaDeviceMemoryBlock*
const pBlock = vma_new(m_hAllocator, VmaDeviceMemoryBlock)(m_hAllocator);
-
-
-
-
-
-13653 allocInfo.allocationSize,
-
-
-
-13657 m_Blocks.push_back(pBlock);
-13658 if(pNewBlockIndex != VMA_NULL)
-
-13660 *pNewBlockIndex = m_Blocks.size() - 1;
-
-
-
-
-
-13666 void VmaBlockVector::ApplyDefragmentationMovesCpu(
-13667 class VmaBlockVectorDefragmentationContext* pDefragCtx,
-13668 const VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves)
-
-13670 const size_t blockCount = m_Blocks.size();
-13671 const bool isNonCoherent = m_hAllocator->IsMemoryTypeNonCoherent(m_MemoryTypeIndex);
-
-
-
-13675 BLOCK_FLAG_USED = 0x00000001,
-13676 BLOCK_FLAG_MAPPED_FOR_DEFRAGMENTATION = 0x00000002,
-
-
-
-
-
-
-
-13684 VmaVector< BlockInfo, VmaStlAllocator<BlockInfo> >
-13685 blockInfo(blockCount, BlockInfo(), VmaStlAllocator<BlockInfo>(m_hAllocator->GetAllocationCallbacks()));
-13686 memset(blockInfo.data(), 0, blockCount *
sizeof(BlockInfo));
-
-
-13689 const size_t moveCount = moves.size();
-13690 for(
size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
-
-13692 const VmaDefragmentationMove& move = moves[moveIndex];
-13693 blockInfo[move.srcBlockIndex].flags |= BLOCK_FLAG_USED;
-13694 blockInfo[move.dstBlockIndex].flags |= BLOCK_FLAG_USED;
-
+13646 #if VMA_MEMORY_PRIORITY
+13647 VkMemoryPriorityAllocateInfoEXT priorityInfo = { VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT };
+13648 if(m_hAllocator->m_UseExtMemoryPriority)
+
+13650 priorityInfo.priority = m_Priority;
+13651 VmaPnextChainPushFront(&allocInfo, &priorityInfo);
+
+
+
+13655 VkDeviceMemory mem = VK_NULL_HANDLE;
+13656 VkResult res = m_hAllocator->AllocateVulkanMemory(&allocInfo, &mem);
+
+
+
+
+
+
+
+
+13665 VmaDeviceMemoryBlock*
const pBlock = vma_new(m_hAllocator, VmaDeviceMemoryBlock)(m_hAllocator);
+
+
+
+
+
+13671 allocInfo.allocationSize,
+
+
+
+13675 m_Blocks.push_back(pBlock);
+13676 if(pNewBlockIndex != VMA_NULL)
+
+13678 *pNewBlockIndex = m_Blocks.size() - 1;
+
+
+
+
+
+13684 void VmaBlockVector::ApplyDefragmentationMovesCpu(
+13685 class VmaBlockVectorDefragmentationContext* pDefragCtx,
+13686 const VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves)
+
+13688 const size_t blockCount = m_Blocks.size();
+13689 const bool isNonCoherent = m_hAllocator->IsMemoryTypeNonCoherent(m_MemoryTypeIndex);
+
+
+
+13693 BLOCK_FLAG_USED = 0x00000001,
+13694 BLOCK_FLAG_MAPPED_FOR_DEFRAGMENTATION = 0x00000002,
+
-13697 VMA_ASSERT(pDefragCtx->res == VK_SUCCESS);
-
-
-13700 for(
size_t blockIndex = 0; pDefragCtx->res == VK_SUCCESS && blockIndex < blockCount; ++blockIndex)
-
-13702 BlockInfo& currBlockInfo = blockInfo[blockIndex];
-13703 VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
-13704 if((currBlockInfo.flags & BLOCK_FLAG_USED) != 0)
-
-13706 currBlockInfo.pMappedData = pBlock->GetMappedData();
-
-13708 if(currBlockInfo.pMappedData == VMA_NULL)
-
-13710 pDefragCtx->res = pBlock->Map(m_hAllocator, 1, &currBlockInfo.pMappedData);
-13711 if(pDefragCtx->res == VK_SUCCESS)
-
-13713 currBlockInfo.flags |= BLOCK_FLAG_MAPPED_FOR_DEFRAGMENTATION;
-
-
-
-
-
-
-13720 if(pDefragCtx->res == VK_SUCCESS)
-
-13722 const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
-13723 VkMappedMemoryRange memRange = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE };
-
-13725 for(
size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
-
-13727 const VmaDefragmentationMove& move = moves[moveIndex];
-
-13729 const BlockInfo& srcBlockInfo = blockInfo[move.srcBlockIndex];
-13730 const BlockInfo& dstBlockInfo = blockInfo[move.dstBlockIndex];
-
-13732 VMA_ASSERT(srcBlockInfo.pMappedData && dstBlockInfo.pMappedData);
-
-
-
-
-13737 VmaDeviceMemoryBlock*
const pSrcBlock = m_Blocks[move.srcBlockIndex];
-13738 memRange.memory = pSrcBlock->GetDeviceMemory();
-13739 memRange.offset = VmaAlignDown(move.srcOffset, nonCoherentAtomSize);
-13740 memRange.size = VMA_MIN(
-13741 VmaAlignUp(move.size + (move.srcOffset - memRange.offset), nonCoherentAtomSize),
-13742 pSrcBlock->m_pMetadata->GetSize() - memRange.offset);
-13743 (*m_hAllocator->GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hAllocator->m_hDevice, 1, &memRange);
-
-
-
-
-13748 reinterpret_cast<char*
>(dstBlockInfo.pMappedData) + move.dstOffset,
-13749 reinterpret_cast<char*
>(srcBlockInfo.pMappedData) + move.srcOffset,
-13750 static_cast<size_t>(move.size));
+
+
+
+
+
+13702 VmaVector< BlockInfo, VmaStlAllocator<BlockInfo> >
+13703 blockInfo(blockCount, BlockInfo(), VmaStlAllocator<BlockInfo>(m_hAllocator->GetAllocationCallbacks()));
+13704 memset(blockInfo.data(), 0, blockCount *
sizeof(BlockInfo));
+
+
+13707 const size_t moveCount = moves.size();
+13708 for(
size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+
+13710 const VmaDefragmentationMove& move = moves[moveIndex];
+13711 blockInfo[move.srcBlockIndex].flags |= BLOCK_FLAG_USED;
+13712 blockInfo[move.dstBlockIndex].flags |= BLOCK_FLAG_USED;
+
+
+13715 VMA_ASSERT(pDefragCtx->res == VK_SUCCESS);
+
+
+13718 for(
size_t blockIndex = 0; pDefragCtx->res == VK_SUCCESS && blockIndex < blockCount; ++blockIndex)
+
+13720 BlockInfo& currBlockInfo = blockInfo[blockIndex];
+13721 VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
+13722 if((currBlockInfo.flags & BLOCK_FLAG_USED) != 0)
+
+13724 currBlockInfo.pMappedData = pBlock->GetMappedData();
+
+13726 if(currBlockInfo.pMappedData == VMA_NULL)
+
+13728 pDefragCtx->res = pBlock->Map(m_hAllocator, 1, &currBlockInfo.pMappedData);
+13729 if(pDefragCtx->res == VK_SUCCESS)
+
+13731 currBlockInfo.flags |= BLOCK_FLAG_MAPPED_FOR_DEFRAGMENTATION;
+
+
+
+
+
+
+13738 if(pDefragCtx->res == VK_SUCCESS)
+
+13740 const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
+13741 VkMappedMemoryRange memRange = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE };
+
+13743 for(
size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+
+13745 const VmaDefragmentationMove& move = moves[moveIndex];
+
+13747 const BlockInfo& srcBlockInfo = blockInfo[move.srcBlockIndex];
+13748 const BlockInfo& dstBlockInfo = blockInfo[move.dstBlockIndex];
+
+13750 VMA_ASSERT(srcBlockInfo.pMappedData && dstBlockInfo.pMappedData);
-13752 if(IsCorruptionDetectionEnabled())
-
-13754 VmaWriteMagicValue(dstBlockInfo.pMappedData, move.dstOffset - VMA_DEBUG_MARGIN);
-13755 VmaWriteMagicValue(dstBlockInfo.pMappedData, move.dstOffset + move.size);
-
-
-
-
-
-13761 VmaDeviceMemoryBlock*
const pDstBlock = m_Blocks[move.dstBlockIndex];
-13762 memRange.memory = pDstBlock->GetDeviceMemory();
-13763 memRange.offset = VmaAlignDown(move.dstOffset, nonCoherentAtomSize);
-13764 memRange.size = VMA_MIN(
-13765 VmaAlignUp(move.size + (move.dstOffset - memRange.offset), nonCoherentAtomSize),
-13766 pDstBlock->m_pMetadata->GetSize() - memRange.offset);
-13767 (*m_hAllocator->GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hAllocator->m_hDevice, 1, &memRange);
-
-
-
-
-
-
-13774 for(
size_t blockIndex = blockCount; blockIndex--; )
-
-13776 const BlockInfo& currBlockInfo = blockInfo[blockIndex];
-13777 if((currBlockInfo.flags & BLOCK_FLAG_MAPPED_FOR_DEFRAGMENTATION) != 0)
-
-13779 VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
-13780 pBlock->Unmap(m_hAllocator, 1);
-
-
-
-
-13785 void VmaBlockVector::ApplyDefragmentationMovesGpu(
-13786 class VmaBlockVectorDefragmentationContext* pDefragCtx,
-13787 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
-13788 VkCommandBuffer commandBuffer)
-
-13790 const size_t blockCount = m_Blocks.size();
-
-13792 pDefragCtx->blockContexts.resize(blockCount);
-13793 memset(pDefragCtx->blockContexts.data(), 0, blockCount *
sizeof(VmaBlockDefragmentationContext));
-
-
-13796 const size_t moveCount = moves.size();
-13797 for(
size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
-
-13799 const VmaDefragmentationMove& move = moves[moveIndex];
-
-
-
-
-13804 pDefragCtx->blockContexts[move.srcBlockIndex].flags |= VmaBlockDefragmentationContext::BLOCK_FLAG_USED;
-13805 pDefragCtx->blockContexts[move.dstBlockIndex].flags |= VmaBlockDefragmentationContext::BLOCK_FLAG_USED;
-
-
-
-13809 VMA_ASSERT(pDefragCtx->res == VK_SUCCESS);
-
-
-
-13813 VkBufferCreateInfo bufCreateInfo;
-13814 VmaFillGpuDefragmentationBufferCreateInfo(bufCreateInfo);
-
-13816 for(
size_t blockIndex = 0; pDefragCtx->res == VK_SUCCESS && blockIndex < blockCount; ++blockIndex)
-
-13818 VmaBlockDefragmentationContext& currBlockCtx = pDefragCtx->blockContexts[blockIndex];
-13819 VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
-13820 if((currBlockCtx.flags & VmaBlockDefragmentationContext::BLOCK_FLAG_USED) != 0)
-
-13822 bufCreateInfo.size = pBlock->m_pMetadata->GetSize();
-13823 pDefragCtx->res = (*m_hAllocator->GetVulkanFunctions().vkCreateBuffer)(
-13824 m_hAllocator->m_hDevice, &bufCreateInfo, m_hAllocator->GetAllocationCallbacks(), &currBlockCtx.hBuffer);
-13825 if(pDefragCtx->res == VK_SUCCESS)
-
-13827 pDefragCtx->res = (*m_hAllocator->GetVulkanFunctions().vkBindBufferMemory)(
-13828 m_hAllocator->m_hDevice, currBlockCtx.hBuffer, pBlock->GetDeviceMemory(), 0);
-
-
-
-
+
+
+
+13755 VmaDeviceMemoryBlock*
const pSrcBlock = m_Blocks[move.srcBlockIndex];
+13756 memRange.memory = pSrcBlock->GetDeviceMemory();
+13757 memRange.offset = VmaAlignDown(move.srcOffset, nonCoherentAtomSize);
+13758 memRange.size = VMA_MIN(
+13759 VmaAlignUp(move.size + (move.srcOffset - memRange.offset), nonCoherentAtomSize),
+13760 pSrcBlock->m_pMetadata->GetSize() - memRange.offset);
+13761 (*m_hAllocator->GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hAllocator->m_hDevice, 1, &memRange);
+
+
+
+
+13766 reinterpret_cast<char*
>(dstBlockInfo.pMappedData) + move.dstOffset,
+13767 reinterpret_cast<char*
>(srcBlockInfo.pMappedData) + move.srcOffset,
+13768 static_cast<size_t>(move.size));
+
+13770 if(IsCorruptionDetectionEnabled())
+
+13772 VmaWriteMagicValue(dstBlockInfo.pMappedData, move.dstOffset - VMA_DEBUG_MARGIN);
+13773 VmaWriteMagicValue(dstBlockInfo.pMappedData, move.dstOffset + move.size);
+
+
+
+
+
+13779 VmaDeviceMemoryBlock*
const pDstBlock = m_Blocks[move.dstBlockIndex];
+13780 memRange.memory = pDstBlock->GetDeviceMemory();
+13781 memRange.offset = VmaAlignDown(move.dstOffset, nonCoherentAtomSize);
+13782 memRange.size = VMA_MIN(
+13783 VmaAlignUp(move.size + (move.dstOffset - memRange.offset), nonCoherentAtomSize),
+13784 pDstBlock->m_pMetadata->GetSize() - memRange.offset);
+13785 (*m_hAllocator->GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hAllocator->m_hDevice, 1, &memRange);
+
+
+
+
+
+
+13792 for(
size_t blockIndex = blockCount; blockIndex--; )
+
+13794 const BlockInfo& currBlockInfo = blockInfo[blockIndex];
+13795 if((currBlockInfo.flags & BLOCK_FLAG_MAPPED_FOR_DEFRAGMENTATION) != 0)
+
+13797 VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
+13798 pBlock->Unmap(m_hAllocator, 1);
+
+
+
+
+13803 void VmaBlockVector::ApplyDefragmentationMovesGpu(
+13804 class VmaBlockVectorDefragmentationContext* pDefragCtx,
+13805 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+13806 VkCommandBuffer commandBuffer)
+
+13808 const size_t blockCount = m_Blocks.size();
+
+13810 pDefragCtx->blockContexts.resize(blockCount);
+13811 memset(pDefragCtx->blockContexts.data(), 0, blockCount *
sizeof(VmaBlockDefragmentationContext));
+
+
+13814 const size_t moveCount = moves.size();
+13815 for(
size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+
+13817 const VmaDefragmentationMove& move = moves[moveIndex];
+
+
+
+
+13822 pDefragCtx->blockContexts[move.srcBlockIndex].flags |= VmaBlockDefragmentationContext::BLOCK_FLAG_USED;
+13823 pDefragCtx->blockContexts[move.dstBlockIndex].flags |= VmaBlockDefragmentationContext::BLOCK_FLAG_USED;
+
+
+
+13827 VMA_ASSERT(pDefragCtx->res == VK_SUCCESS);
+
+
+
+13831 VkBufferCreateInfo bufCreateInfo;
+13832 VmaFillGpuDefragmentationBufferCreateInfo(bufCreateInfo);
-
-13835 if(pDefragCtx->res == VK_SUCCESS)
-
-13837 for(
size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
-
-13839 const VmaDefragmentationMove& move = moves[moveIndex];
-
-13841 const VmaBlockDefragmentationContext& srcBlockCtx = pDefragCtx->blockContexts[move.srcBlockIndex];
-13842 const VmaBlockDefragmentationContext& dstBlockCtx = pDefragCtx->blockContexts[move.dstBlockIndex];
-
-13844 VMA_ASSERT(srcBlockCtx.hBuffer && dstBlockCtx.hBuffer);
-
-13846 VkBufferCopy region = {
-
-
-
-13850 (*m_hAllocator->GetVulkanFunctions().vkCmdCopyBuffer)(
-13851 commandBuffer, srcBlockCtx.hBuffer, dstBlockCtx.hBuffer, 1, ®ion);
-
-
-
-
-13856 if(pDefragCtx->res == VK_SUCCESS && moveCount > 0)
-
-13858 pDefragCtx->res = VK_NOT_READY;
-
-
+13834 for(
size_t blockIndex = 0; pDefragCtx->res == VK_SUCCESS && blockIndex < blockCount; ++blockIndex)
+
+13836 VmaBlockDefragmentationContext& currBlockCtx = pDefragCtx->blockContexts[blockIndex];
+13837 VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
+13838 if((currBlockCtx.flags & VmaBlockDefragmentationContext::BLOCK_FLAG_USED) != 0)
+
+13840 bufCreateInfo.size = pBlock->m_pMetadata->GetSize();
+13841 pDefragCtx->res = (*m_hAllocator->GetVulkanFunctions().vkCreateBuffer)(
+13842 m_hAllocator->m_hDevice, &bufCreateInfo, m_hAllocator->GetAllocationCallbacks(), &currBlockCtx.hBuffer);
+13843 if(pDefragCtx->res == VK_SUCCESS)
+
+13845 pDefragCtx->res = (*m_hAllocator->GetVulkanFunctions().vkBindBufferMemory)(
+13846 m_hAllocator->m_hDevice, currBlockCtx.hBuffer, pBlock->GetDeviceMemory(), 0);
+
+
+
+
+
+
+13853 if(pDefragCtx->res == VK_SUCCESS)
+
+13855 for(
size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+
+13857 const VmaDefragmentationMove& move = moves[moveIndex];
+
+13859 const VmaBlockDefragmentationContext& srcBlockCtx = pDefragCtx->blockContexts[move.srcBlockIndex];
+13860 const VmaBlockDefragmentationContext& dstBlockCtx = pDefragCtx->blockContexts[move.dstBlockIndex];
-
-
-13864 for(
size_t blockIndex = m_Blocks.size(); blockIndex--; )
-
-13866 VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
-13867 if(pBlock->m_pMetadata->IsEmpty())
-
-13869 if(m_Blocks.size() > m_MinBlockCount)
-
-13871 if(pDefragmentationStats != VMA_NULL)
-
-
-13874 pDefragmentationStats->
bytesFreed += pBlock->m_pMetadata->GetSize();
-
-
-13877 VmaVectorRemove(m_Blocks, blockIndex);
-13878 pBlock->Destroy(m_hAllocator);
-13879 vma_delete(m_hAllocator, pBlock);
-
-
-
-
-
-
-
-13887 UpdateHasEmptyBlock();
-
-
-13890 void VmaBlockVector::UpdateHasEmptyBlock()
-
-13892 m_HasEmptyBlock =
false;
-13893 for(
size_t index = 0, count = m_Blocks.size(); index < count; ++index)
-
-13895 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[index];
-13896 if(pBlock->m_pMetadata->IsEmpty())
-
-13898 m_HasEmptyBlock =
true;
-
-
-
-
-
-13904 #if VMA_STATS_STRING_ENABLED
-
-13906 void VmaBlockVector::PrintDetailedMap(
class VmaJsonWriter& json)
-
-13908 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
-
-13910 json.BeginObject();
-
-
-
-13914 const char* poolName = m_hParentPool->GetName();
-13915 if(poolName != VMA_NULL && poolName[0] !=
'\0')
-
-13917 json.WriteString(
"Name");
-13918 json.WriteString(poolName);
-
-
-13921 json.WriteString(
"MemoryTypeIndex");
-13922 json.WriteNumber(m_MemoryTypeIndex);
+13862 VMA_ASSERT(srcBlockCtx.hBuffer && dstBlockCtx.hBuffer);
+
+13864 VkBufferCopy region = {
+
+
+
+13868 (*m_hAllocator->GetVulkanFunctions().vkCmdCopyBuffer)(
+13869 commandBuffer, srcBlockCtx.hBuffer, dstBlockCtx.hBuffer, 1, ®ion);
+
+
+
+
+13874 if(pDefragCtx->res == VK_SUCCESS && moveCount > 0)
+
+13876 pDefragCtx->res = VK_NOT_READY;
+
+
+
+
+
+13882 for(
size_t blockIndex = m_Blocks.size(); blockIndex--; )
+
+13884 VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
+13885 if(pBlock->m_pMetadata->IsEmpty())
+
+13887 if(m_Blocks.size() > m_MinBlockCount)
+
+13889 if(pDefragmentationStats != VMA_NULL)
+
+
+13892 pDefragmentationStats->
bytesFreed += pBlock->m_pMetadata->GetSize();
+
+
+13895 VmaVectorRemove(m_Blocks, blockIndex);
+13896 pBlock->Destroy(m_hAllocator);
+13897 vma_delete(m_hAllocator, pBlock);
+
+
+
+
+
+
+
+13905 UpdateHasEmptyBlock();
+
+
+13908 void VmaBlockVector::UpdateHasEmptyBlock()
+
+13910 m_HasEmptyBlock =
false;
+13911 for(
size_t index = 0, count = m_Blocks.size(); index < count; ++index)
+
+13913 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[index];
+13914 if(pBlock->m_pMetadata->IsEmpty())
+
+13916 m_HasEmptyBlock =
true;
+
+
+
+
+
+13922 #if VMA_STATS_STRING_ENABLED
-13924 json.WriteString(
"BlockSize");
-13925 json.WriteNumber(m_PreferredBlockSize);
-
-13927 json.WriteString(
"BlockCount");
-13928 json.BeginObject(
true);
-13929 if(m_MinBlockCount > 0)
-
-13931 json.WriteString(
"Min");
-13932 json.WriteNumber((uint64_t)m_MinBlockCount);
-
-13934 if(m_MaxBlockCount < SIZE_MAX)
-
-13936 json.WriteString(
"Max");
-13937 json.WriteNumber((uint64_t)m_MaxBlockCount);
-
-13939 json.WriteString(
"Cur");
-13940 json.WriteNumber((uint64_t)m_Blocks.size());
-
-
-13943 if(m_FrameInUseCount > 0)
-
-13945 json.WriteString(
"FrameInUseCount");
-13946 json.WriteNumber(m_FrameInUseCount);
-
-
-13949 if(m_Algorithm != 0)
-
-13951 json.WriteString(
"Algorithm");
-13952 json.WriteString(VmaAlgorithmToStr(m_Algorithm));
-
-
-
-
-13957 json.WriteString(
"PreferredBlockSize");
-13958 json.WriteNumber(m_PreferredBlockSize);
-
+13924 void VmaBlockVector::PrintDetailedMap(
class VmaJsonWriter& json)
+
+13926 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
+
+13928 json.BeginObject();
+
+
+
+13932 const char* poolName = m_hParentPool->GetName();
+13933 if(poolName != VMA_NULL && poolName[0] !=
'\0')
+
+13935 json.WriteString(
"Name");
+13936 json.WriteString(poolName);
+
+
+13939 json.WriteString(
"MemoryTypeIndex");
+13940 json.WriteNumber(m_MemoryTypeIndex);
+
+13942 json.WriteString(
"BlockSize");
+13943 json.WriteNumber(m_PreferredBlockSize);
+
+13945 json.WriteString(
"BlockCount");
+13946 json.BeginObject(
true);
+13947 if(m_MinBlockCount > 0)
+
+13949 json.WriteString(
"Min");
+13950 json.WriteNumber((uint64_t)m_MinBlockCount);
+
+13952 if(m_MaxBlockCount < SIZE_MAX)
+
+13954 json.WriteString(
"Max");
+13955 json.WriteNumber((uint64_t)m_MaxBlockCount);
+
+13957 json.WriteString(
"Cur");
+13958 json.WriteNumber((uint64_t)m_Blocks.size());
+
-13961 json.WriteString(
"Blocks");
-13962 json.BeginObject();
-13963 for(
size_t i = 0; i < m_Blocks.size(); ++i)
-
-13965 json.BeginString();
-13966 json.ContinueString(m_Blocks[i]->GetId());
-
-
-13969 m_Blocks[i]->m_pMetadata->PrintDetailedMap(json);
-
-
-
-
-
-
-
-
-13978 void VmaBlockVector::Defragment(
-13979 class VmaBlockVectorDefragmentationContext* pCtx,
-
-13981 VkDeviceSize& maxCpuBytesToMove, uint32_t& maxCpuAllocationsToMove,
-13982 VkDeviceSize& maxGpuBytesToMove, uint32_t& maxGpuAllocationsToMove,
-13983 VkCommandBuffer commandBuffer)
-
-13985 pCtx->res = VK_SUCCESS;
+13961 if(m_FrameInUseCount > 0)
+
+13963 json.WriteString(
"FrameInUseCount");
+13964 json.WriteNumber(m_FrameInUseCount);
+
+
+13967 if(m_Algorithm != 0)
+
+13969 json.WriteString(
"Algorithm");
+13970 json.WriteString(VmaAlgorithmToStr(m_Algorithm));
+
+
+
+
+13975 json.WriteString(
"PreferredBlockSize");
+13976 json.WriteNumber(m_PreferredBlockSize);
+
+
+13979 json.WriteString(
"Blocks");
+13980 json.BeginObject();
+13981 for(
size_t i = 0; i < m_Blocks.size(); ++i)
+
+13983 json.BeginString();
+13984 json.ContinueString(m_Blocks[i]->GetId());
+
-13987 const VkMemoryPropertyFlags memPropFlags =
-13988 m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags;
-13989 const bool isHostVisible = (memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0;
+13987 m_Blocks[i]->m_pMetadata->PrintDetailedMap(json);
+
+
-13991 const bool canDefragmentOnCpu = maxCpuBytesToMove > 0 && maxCpuAllocationsToMove > 0 &&
-
-13993 const bool canDefragmentOnGpu = maxGpuBytesToMove > 0 && maxGpuAllocationsToMove > 0 &&
-13994 !IsCorruptionDetectionEnabled() &&
-13995 ((1u << m_MemoryTypeIndex) & m_hAllocator->GetGpuDefragmentationMemoryTypeBits()) != 0;
-
-
-13998 if(canDefragmentOnCpu || canDefragmentOnGpu)
-
-14000 bool defragmentOnGpu;
-
-14002 if(canDefragmentOnGpu != canDefragmentOnCpu)
-
-14004 defragmentOnGpu = canDefragmentOnGpu;
-
-
-
-
-14009 defragmentOnGpu = (memPropFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0 ||
-14010 m_hAllocator->IsIntegratedGpu();
-
-
-14013 bool overlappingMoveSupported = !defragmentOnGpu;
+
+
+
+
+
+13996 void VmaBlockVector::Defragment(
+13997 class VmaBlockVectorDefragmentationContext* pCtx,
+
+13999 VkDeviceSize& maxCpuBytesToMove, uint32_t& maxCpuAllocationsToMove,
+14000 VkDeviceSize& maxGpuBytesToMove, uint32_t& maxGpuAllocationsToMove,
+14001 VkCommandBuffer commandBuffer)
+
+14003 pCtx->res = VK_SUCCESS;
+
+14005 const VkMemoryPropertyFlags memPropFlags =
+14006 m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags;
+14007 const bool isHostVisible = (memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0;
+
+14009 const bool canDefragmentOnCpu = maxCpuBytesToMove > 0 && maxCpuAllocationsToMove > 0 &&
+
+14011 const bool canDefragmentOnGpu = maxGpuBytesToMove > 0 && maxGpuAllocationsToMove > 0 &&
+14012 !IsCorruptionDetectionEnabled() &&
+14013 ((1u << m_MemoryTypeIndex) & m_hAllocator->GetGpuDefragmentationMemoryTypeBits()) != 0;
-14015 if(m_hAllocator->m_UseMutex)
-
-
-
-14019 if(!m_Mutex.TryLockWrite())
-
-14021 pCtx->res = VK_ERROR_INITIALIZATION_FAILED;
-
-
-
-
-
-14027 m_Mutex.LockWrite();
-14028 pCtx->mutexLocked =
true;
-
-
-
-14032 pCtx->Begin(overlappingMoveSupported, flags);
-
-
-
-14036 const VkDeviceSize maxBytesToMove = defragmentOnGpu ? maxGpuBytesToMove : maxCpuBytesToMove;
-14037 const uint32_t maxAllocationsToMove = defragmentOnGpu ? maxGpuAllocationsToMove : maxCpuAllocationsToMove;
-14038 pCtx->res = pCtx->GetAlgorithm()->Defragment(pCtx->defragmentationMoves, maxBytesToMove, maxAllocationsToMove, flags);
-
-
-14041 if(pStats != VMA_NULL)
-
-14043 const VkDeviceSize bytesMoved = pCtx->GetAlgorithm()->GetBytesMoved();
-14044 const uint32_t allocationsMoved = pCtx->GetAlgorithm()->GetAllocationsMoved();
-
-
-14047 VMA_ASSERT(bytesMoved <= maxBytesToMove);
-14048 VMA_ASSERT(allocationsMoved <= maxAllocationsToMove);
-14049 if(defragmentOnGpu)
-
-14051 maxGpuBytesToMove -= bytesMoved;
-14052 maxGpuAllocationsToMove -= allocationsMoved;
-
-
-
-14056 maxCpuBytesToMove -= bytesMoved;
-14057 maxCpuAllocationsToMove -= allocationsMoved;
-
-
-
-
-
-14063 if(m_hAllocator->m_UseMutex)
-14064 m_Mutex.UnlockWrite();
-
-14066 if(pCtx->res >= VK_SUCCESS && !pCtx->defragmentationMoves.empty())
-14067 pCtx->res = VK_NOT_READY;
-
-
-
-
-14072 if(pCtx->res >= VK_SUCCESS)
-
-14074 if(defragmentOnGpu)
-
-14076 ApplyDefragmentationMovesGpu(pCtx, pCtx->defragmentationMoves, commandBuffer);
-
-
-
-14080 ApplyDefragmentationMovesCpu(pCtx, pCtx->defragmentationMoves);
-
-
-
-
-
-14086 void VmaBlockVector::DefragmentationEnd(
-14087 class VmaBlockVectorDefragmentationContext* pCtx,
-
-
-
-
-
-14093 VMA_ASSERT(pCtx->mutexLocked ==
false);
-
-
-
-14097 m_Mutex.LockWrite();
-14098 pCtx->mutexLocked =
true;
-
-
-
-14102 if(pCtx->mutexLocked || !m_hAllocator->m_UseMutex)
-
-
-14105 for(
size_t blockIndex = pCtx->blockContexts.size(); blockIndex--;)
-
-14107 VmaBlockDefragmentationContext &blockCtx = pCtx->blockContexts[blockIndex];
-14108 if(blockCtx.hBuffer)
-
-14110 (*m_hAllocator->GetVulkanFunctions().vkDestroyBuffer)(m_hAllocator->m_hDevice, blockCtx.hBuffer, m_hAllocator->GetAllocationCallbacks());
-
-
-
-14114 if(pCtx->res >= VK_SUCCESS)
-
-14116 FreeEmptyBlocks(pStats);
-
-
-
-14120 if(pCtx->mutexLocked)
+
+14016 if(canDefragmentOnCpu || canDefragmentOnGpu)
+
+14018 bool defragmentOnGpu;
+
+14020 if(canDefragmentOnGpu != canDefragmentOnCpu)
+
+14022 defragmentOnGpu = canDefragmentOnGpu;
+
+
+
+
+14027 defragmentOnGpu = (memPropFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0 ||
+14028 m_hAllocator->IsIntegratedGpu();
+
+
+14031 bool overlappingMoveSupported = !defragmentOnGpu;
+
+14033 if(m_hAllocator->m_UseMutex)
+
+
+
+14037 if(!m_Mutex.TryLockWrite())
+
+14039 pCtx->res = VK_ERROR_INITIALIZATION_FAILED;
+
+
+
+
+
+14045 m_Mutex.LockWrite();
+14046 pCtx->mutexLocked =
true;
+
+
+
+14050 pCtx->Begin(overlappingMoveSupported, flags);
+
+
+
+14054 const VkDeviceSize maxBytesToMove = defragmentOnGpu ? maxGpuBytesToMove : maxCpuBytesToMove;
+14055 const uint32_t maxAllocationsToMove = defragmentOnGpu ? maxGpuAllocationsToMove : maxCpuAllocationsToMove;
+14056 pCtx->res = pCtx->GetAlgorithm()->Defragment(pCtx->defragmentationMoves, maxBytesToMove, maxAllocationsToMove, flags);
+
+
+14059 if(pStats != VMA_NULL)
+
+14061 const VkDeviceSize bytesMoved = pCtx->GetAlgorithm()->GetBytesMoved();
+14062 const uint32_t allocationsMoved = pCtx->GetAlgorithm()->GetAllocationsMoved();
+
+
+14065 VMA_ASSERT(bytesMoved <= maxBytesToMove);
+14066 VMA_ASSERT(allocationsMoved <= maxAllocationsToMove);
+14067 if(defragmentOnGpu)
+
+14069 maxGpuBytesToMove -= bytesMoved;
+14070 maxGpuAllocationsToMove -= allocationsMoved;
+
+
+
+14074 maxCpuBytesToMove -= bytesMoved;
+14075 maxCpuAllocationsToMove -= allocationsMoved;
+
+
+
+
+
+14081 if(m_hAllocator->m_UseMutex)
+14082 m_Mutex.UnlockWrite();
+
+14084 if(pCtx->res >= VK_SUCCESS && !pCtx->defragmentationMoves.empty())
+14085 pCtx->res = VK_NOT_READY;
+
+
+
+
+14090 if(pCtx->res >= VK_SUCCESS)
+
+14092 if(defragmentOnGpu)
+
+14094 ApplyDefragmentationMovesGpu(pCtx, pCtx->defragmentationMoves, commandBuffer);
+
+
+
+14098 ApplyDefragmentationMovesCpu(pCtx, pCtx->defragmentationMoves);
+
+
+
+
+
+14104 void VmaBlockVector::DefragmentationEnd(
+14105 class VmaBlockVectorDefragmentationContext* pCtx,
+
+
+
+
+
+14111 VMA_ASSERT(pCtx->mutexLocked ==
false);
+
+
+
+14115 m_Mutex.LockWrite();
+14116 pCtx->mutexLocked =
true;
+
+
+
+14120 if(pCtx->mutexLocked || !m_hAllocator->m_UseMutex)
-14122 VMA_ASSERT(m_hAllocator->m_UseMutex);
-14123 m_Mutex.UnlockWrite();
-
-
-
-14127 uint32_t VmaBlockVector::ProcessDefragmentations(
-14128 class VmaBlockVectorDefragmentationContext *pCtx,
-
-
-14131 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
-
-14133 const uint32_t moveCount = VMA_MIN(uint32_t(pCtx->defragmentationMoves.size()) - pCtx->defragmentationMovesProcessed, maxMoves);
-
-14135 for(uint32_t i = 0; i < moveCount; ++ i)
-
-14137 VmaDefragmentationMove& move = pCtx->defragmentationMoves[pCtx->defragmentationMovesProcessed + i];
-
-
-14140 pMove->
memory = move.pDstBlock->GetDeviceMemory();
-14141 pMove->
offset = move.dstOffset;
-
-
-
-
-14146 pCtx->defragmentationMovesProcessed += moveCount;
-
-
-
+
+14123 for(
size_t blockIndex = pCtx->blockContexts.size(); blockIndex--;)
+
+14125 VmaBlockDefragmentationContext &blockCtx = pCtx->blockContexts[blockIndex];
+14126 if(blockCtx.hBuffer)
+
+14128 (*m_hAllocator->GetVulkanFunctions().vkDestroyBuffer)(m_hAllocator->m_hDevice, blockCtx.hBuffer, m_hAllocator->GetAllocationCallbacks());
+
+
+
+14132 if(pCtx->res >= VK_SUCCESS)
+
+14134 FreeEmptyBlocks(pStats);
+
+
+
+14138 if(pCtx->mutexLocked)
+
+14140 VMA_ASSERT(m_hAllocator->m_UseMutex);
+14141 m_Mutex.UnlockWrite();
+
+
+
+14145 uint32_t VmaBlockVector::ProcessDefragmentations(
+14146 class VmaBlockVectorDefragmentationContext *pCtx,
+
+
+14149 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
-14151 void VmaBlockVector::CommitDefragmentations(
-14152 class VmaBlockVectorDefragmentationContext *pCtx,
-
-
-14155 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
+14151 const uint32_t moveCount = VMA_MIN(uint32_t(pCtx->defragmentationMoves.size()) - pCtx->defragmentationMovesProcessed, maxMoves);
+
+14153 for(uint32_t i = 0; i < moveCount; ++ i)
+
+14155 VmaDefragmentationMove& move = pCtx->defragmentationMoves[pCtx->defragmentationMovesProcessed + i];
-14157 for(uint32_t i = pCtx->defragmentationMovesCommitted; i < pCtx->defragmentationMovesProcessed; ++ i)
-
-14159 const VmaDefragmentationMove &move = pCtx->defragmentationMoves[i];
+
+14158 pMove->
memory = move.pDstBlock->GetDeviceMemory();
+14159 pMove->
offset = move.dstOffset;
-14161 move.pSrcBlock->m_pMetadata->FreeAtOffset(move.srcOffset);
-14162 move.hAllocation->ChangeBlockAllocation(m_hAllocator, move.pDstBlock, move.dstOffset);
-
-
-14165 pCtx->defragmentationMovesCommitted = pCtx->defragmentationMovesProcessed;
-14166 FreeEmptyBlocks(pStats);
+
+
+
+14164 pCtx->defragmentationMovesProcessed += moveCount;
+
+
-14169 size_t VmaBlockVector::CalcAllocationCount()
const
-
-
-14172 for(
size_t i = 0; i < m_Blocks.size(); ++i)
-
-14174 result += m_Blocks[i]->m_pMetadata->GetAllocationCount();
-
-
-
+14169 void VmaBlockVector::CommitDefragmentations(
+14170 class VmaBlockVectorDefragmentationContext *pCtx,
+
+
+14173 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
+
+14175 for(uint32_t i = pCtx->defragmentationMovesCommitted; i < pCtx->defragmentationMovesProcessed; ++ i)
+
+14177 const VmaDefragmentationMove &move = pCtx->defragmentationMoves[i];
-14179 bool VmaBlockVector::IsBufferImageGranularityConflictPossible()
const
-
-14181 if(m_BufferImageGranularity == 1)
-
-
-
-14185 VmaSuballocationType lastSuballocType = VMA_SUBALLOCATION_TYPE_FREE;
-14186 for(
size_t i = 0, count = m_Blocks.size(); i < count; ++i)
-
-14188 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[i];
-14189 VMA_ASSERT(m_Algorithm == 0);
-14190 VmaBlockMetadata_Generic*
const pMetadata = (VmaBlockMetadata_Generic*)pBlock->m_pMetadata;
-14191 if(pMetadata->IsBufferImageGranularityConflictPossible(m_BufferImageGranularity, lastSuballocType))
-
-
-
-
-
-
-
-14199 void VmaBlockVector::MakePoolAllocationsLost(
-14200 uint32_t currentFrameIndex,
-14201 size_t* pLostAllocationCount)
-
-14203 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
-14204 size_t lostAllocationCount = 0;
-14205 for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
-
-14207 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[blockIndex];
-14208 VMA_ASSERT(pBlock);
-14209 lostAllocationCount += pBlock->m_pMetadata->MakeAllocationsLost(currentFrameIndex, m_FrameInUseCount);
-
-14211 if(pLostAllocationCount != VMA_NULL)
-
-14213 *pLostAllocationCount = lostAllocationCount;
-
+14179 move.pSrcBlock->m_pMetadata->FreeAtOffset(move.srcOffset);
+14180 move.hAllocation->ChangeBlockAllocation(m_hAllocator, move.pDstBlock, move.dstOffset);
+
+
+14183 pCtx->defragmentationMovesCommitted = pCtx->defragmentationMovesProcessed;
+14184 FreeEmptyBlocks(pStats);
+
+
+14187 size_t VmaBlockVector::CalcAllocationCount()
const
+
+
+14190 for(
size_t i = 0; i < m_Blocks.size(); ++i)
+
+14192 result += m_Blocks[i]->m_pMetadata->GetAllocationCount();
+
+
+
+
+14197 bool VmaBlockVector::IsBufferImageGranularityConflictPossible()
const
+
+14199 if(m_BufferImageGranularity == 1)
+
+
+
+14203 VmaSuballocationType lastSuballocType = VMA_SUBALLOCATION_TYPE_FREE;
+14204 for(
size_t i = 0, count = m_Blocks.size(); i < count; ++i)
+
+14206 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[i];
+14207 VMA_ASSERT(m_Algorithm == 0);
+14208 VmaBlockMetadata_Generic*
const pMetadata = (VmaBlockMetadata_Generic*)pBlock->m_pMetadata;
+14209 if(pMetadata->IsBufferImageGranularityConflictPossible(m_BufferImageGranularity, lastSuballocType))
+
+
+
+
+
-14217 VkResult VmaBlockVector::CheckCorruption()
-
-14219 if(!IsCorruptionDetectionEnabled())
-
-14221 return VK_ERROR_FEATURE_NOT_PRESENT;
-
-
-14224 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
-14225 for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
-
-14227 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[blockIndex];
-14228 VMA_ASSERT(pBlock);
-14229 VkResult res = pBlock->CheckCorruption(m_hAllocator);
-14230 if(res != VK_SUCCESS)
-
-
-
-
-
-
-
-14238 void VmaBlockVector::AddStats(
VmaStats* pStats)
-
-14240 const uint32_t memTypeIndex = m_MemoryTypeIndex;
-14241 const uint32_t memHeapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(memTypeIndex);
-
-14243 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
-
-14245 for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
-
-14247 const VmaDeviceMemoryBlock*
const pBlock = m_Blocks[blockIndex];
-14248 VMA_ASSERT(pBlock);
-14249 VMA_HEAVY_ASSERT(pBlock->Validate());
-
-14251 pBlock->m_pMetadata->CalcAllocationStatInfo(allocationStatInfo);
-14252 VmaAddStatInfo(pStats->
total, allocationStatInfo);
-14253 VmaAddStatInfo(pStats->
memoryType[memTypeIndex], allocationStatInfo);
-14254 VmaAddStatInfo(pStats->
memoryHeap[memHeapIndex], allocationStatInfo);
-
-
-
-
+14217 void VmaBlockVector::MakePoolAllocationsLost(
+14218 uint32_t currentFrameIndex,
+14219 size_t* pLostAllocationCount)
+
+14221 VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
+14222 size_t lostAllocationCount = 0;
+14223 for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
+
+14225 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[blockIndex];
+14226 VMA_ASSERT(pBlock);
+14227 lostAllocationCount += pBlock->m_pMetadata->MakeAllocationsLost(currentFrameIndex, m_FrameInUseCount);
+
+14229 if(pLostAllocationCount != VMA_NULL)
+
+14231 *pLostAllocationCount = lostAllocationCount;
+
+
+
+14235 VkResult VmaBlockVector::CheckCorruption()
+
+14237 if(!IsCorruptionDetectionEnabled())
+
+14239 return VK_ERROR_FEATURE_NOT_PRESENT;
+
+
+14242 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
+14243 for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
+
+14245 VmaDeviceMemoryBlock*
const pBlock = m_Blocks[blockIndex];
+14246 VMA_ASSERT(pBlock);
+14247 VkResult res = pBlock->CheckCorruption(m_hAllocator);
+14248 if(res != VK_SUCCESS)
+
+
+
+
+
+
+
+14256 void VmaBlockVector::AddStats(
VmaStats* pStats)
+
+14258 const uint32_t memTypeIndex = m_MemoryTypeIndex;
+14259 const uint32_t memHeapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(memTypeIndex);
-14261 VmaDefragmentationAlgorithm_Generic::VmaDefragmentationAlgorithm_Generic(
-
-14263 VmaBlockVector* pBlockVector,
-14264 uint32_t currentFrameIndex,
-14265 bool overlappingMoveSupported) :
-14266 VmaDefragmentationAlgorithm(hAllocator, pBlockVector, currentFrameIndex),
-14267 m_AllocationCount(0),
-14268 m_AllAllocations(false),
-
-14270 m_AllocationsMoved(0),
-14271 m_Blocks(VmaStlAllocator<BlockInfo*>(hAllocator->GetAllocationCallbacks()))
-
-
-14274 const size_t blockCount = m_pBlockVector->m_Blocks.size();
-14275 for(
size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
-
-14277 BlockInfo* pBlockInfo = vma_new(m_hAllocator, BlockInfo)(m_hAllocator->GetAllocationCallbacks());
-14278 pBlockInfo->m_OriginalBlockIndex = blockIndex;
-14279 pBlockInfo->m_pBlock = m_pBlockVector->m_Blocks[blockIndex];
-14280 m_Blocks.push_back(pBlockInfo);
-
-
-
-14284 VMA_SORT(m_Blocks.begin(), m_Blocks.end(), BlockPointerLess());
-
-
-14287 VmaDefragmentationAlgorithm_Generic::~VmaDefragmentationAlgorithm_Generic()
-
-14289 for(
size_t i = m_Blocks.size(); i--; )
-
-14291 vma_delete(m_hAllocator, m_Blocks[i]);
-
-
-
-14295 void VmaDefragmentationAlgorithm_Generic::AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged)
-
-
-14298 if(hAlloc->GetLastUseFrameIndex() != VMA_FRAME_INDEX_LOST)
-
-14300 VmaDeviceMemoryBlock* pBlock = hAlloc->GetBlock();
-14301 BlockInfoVector::iterator it = VmaBinaryFindFirstNotLess(m_Blocks.begin(), m_Blocks.end(), pBlock, BlockPointerLess());
-14302 if(it != m_Blocks.end() && (*it)->m_pBlock == pBlock)
-
-14304 AllocationInfo allocInfo = AllocationInfo(hAlloc, pChanged);
-14305 (*it)->m_Allocations.push_back(allocInfo);
-
-
-
-
-
-
-14312 ++m_AllocationCount;
-
-
-
-14316 VkResult VmaDefragmentationAlgorithm_Generic::DefragmentRound(
-14317 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
-14318 VkDeviceSize maxBytesToMove,
-14319 uint32_t maxAllocationsToMove,
-14320 bool freeOldAllocations)
-
-14322 if(m_Blocks.empty())
-
-
-
-
-
-
-
-
-
-
-
-
-14335 size_t srcBlockMinIndex = 0;
-
-
-
-
-
-
-
-
-
-
-
-
-14348 size_t srcBlockIndex = m_Blocks.size() - 1;
-14349 size_t srcAllocIndex = SIZE_MAX;
-
-
-
-
-
-14355 while(srcAllocIndex >= m_Blocks[srcBlockIndex]->m_Allocations.size())
-
-14357 if(m_Blocks[srcBlockIndex]->m_Allocations.empty())
-
-
-14360 if(srcBlockIndex == srcBlockMinIndex)
-
-
-
-
-
-
-14367 srcAllocIndex = SIZE_MAX;
-
-
-
-
-14372 srcAllocIndex = m_Blocks[srcBlockIndex]->m_Allocations.size() - 1;
-
-
-
-14376 BlockInfo* pSrcBlockInfo = m_Blocks[srcBlockIndex];
-14377 AllocationInfo& allocInfo = pSrcBlockInfo->m_Allocations[srcAllocIndex];
-
-14379 const VkDeviceSize size = allocInfo.m_hAllocation->GetSize();
-14380 const VkDeviceSize srcOffset = allocInfo.m_hAllocation->GetOffset();
-14381 const VkDeviceSize alignment = allocInfo.m_hAllocation->GetAlignment();
-14382 const VmaSuballocationType suballocType = allocInfo.m_hAllocation->GetSuballocationType();
-
-
-14385 for(
size_t dstBlockIndex = 0; dstBlockIndex <= srcBlockIndex; ++dstBlockIndex)
-
-14387 BlockInfo* pDstBlockInfo = m_Blocks[dstBlockIndex];
-14388 VmaAllocationRequest dstAllocRequest;
-14389 if(pDstBlockInfo->m_pBlock->m_pMetadata->CreateAllocationRequest(
-14390 m_CurrentFrameIndex,
-14391 m_pBlockVector->GetFrameInUseCount(),
-14392 m_pBlockVector->GetBufferImageGranularity(),
-
-
-
-
-
-
-14399 &dstAllocRequest) &&
-
-14401 dstBlockIndex, dstAllocRequest.offset, srcBlockIndex, srcOffset))
-
-14403 VMA_ASSERT(dstAllocRequest.itemsToMakeLostCount == 0);
-
-
-14406 if((m_AllocationsMoved + 1 > maxAllocationsToMove) ||
-14407 (m_BytesMoved + size > maxBytesToMove))
-
-
-
-
-14412 VmaDefragmentationMove move = {};
-14413 move.srcBlockIndex = pSrcBlockInfo->m_OriginalBlockIndex;
-14414 move.dstBlockIndex = pDstBlockInfo->m_OriginalBlockIndex;
-14415 move.srcOffset = srcOffset;
-14416 move.dstOffset = dstAllocRequest.offset;
-
-14418 move.hAllocation = allocInfo.m_hAllocation;
-14419 move.pSrcBlock = pSrcBlockInfo->m_pBlock;
-14420 move.pDstBlock = pDstBlockInfo->m_pBlock;
-
-14422 moves.push_back(move);
-
-14424 pDstBlockInfo->m_pBlock->m_pMetadata->Alloc(
-
-
-
-14428 allocInfo.m_hAllocation);
+14261 VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
+
+14263 for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
+
+14265 const VmaDeviceMemoryBlock*
const pBlock = m_Blocks[blockIndex];
+14266 VMA_ASSERT(pBlock);
+14267 VMA_HEAVY_ASSERT(pBlock->Validate());
+
+14269 pBlock->m_pMetadata->CalcAllocationStatInfo(allocationStatInfo);
+14270 VmaAddStatInfo(pStats->
total, allocationStatInfo);
+14271 VmaAddStatInfo(pStats->
memoryType[memTypeIndex], allocationStatInfo);
+14272 VmaAddStatInfo(pStats->
memoryHeap[memHeapIndex], allocationStatInfo);
+
+
+
+
+
+14279 VmaDefragmentationAlgorithm_Generic::VmaDefragmentationAlgorithm_Generic(
+
+14281 VmaBlockVector* pBlockVector,
+14282 uint32_t currentFrameIndex,
+14283 bool overlappingMoveSupported) :
+14284 VmaDefragmentationAlgorithm(hAllocator, pBlockVector, currentFrameIndex),
+14285 m_AllocationCount(0),
+14286 m_AllAllocations(false),
+
+14288 m_AllocationsMoved(0),
+14289 m_Blocks(VmaStlAllocator<BlockInfo*>(hAllocator->GetAllocationCallbacks()))
+
+
+14292 const size_t blockCount = m_pBlockVector->m_Blocks.size();
+14293 for(
size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+
+14295 BlockInfo* pBlockInfo = vma_new(m_hAllocator, BlockInfo)(m_hAllocator->GetAllocationCallbacks());
+14296 pBlockInfo->m_OriginalBlockIndex = blockIndex;
+14297 pBlockInfo->m_pBlock = m_pBlockVector->m_Blocks[blockIndex];
+14298 m_Blocks.push_back(pBlockInfo);
+
+
+
+14302 VMA_SORT(m_Blocks.begin(), m_Blocks.end(), BlockPointerLess());
+
+
+14305 VmaDefragmentationAlgorithm_Generic::~VmaDefragmentationAlgorithm_Generic()
+
+14307 for(
size_t i = m_Blocks.size(); i--; )
+
+14309 vma_delete(m_hAllocator, m_Blocks[i]);
+
+
+
+14313 void VmaDefragmentationAlgorithm_Generic::AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged)
+
+
+14316 if(hAlloc->GetLastUseFrameIndex() != VMA_FRAME_INDEX_LOST)
+
+14318 VmaDeviceMemoryBlock* pBlock = hAlloc->GetBlock();
+14319 BlockInfoVector::iterator it = VmaBinaryFindFirstNotLess(m_Blocks.begin(), m_Blocks.end(), pBlock, BlockPointerLess());
+14320 if(it != m_Blocks.end() && (*it)->m_pBlock == pBlock)
+
+14322 AllocationInfo allocInfo = AllocationInfo(hAlloc, pChanged);
+14323 (*it)->m_Allocations.push_back(allocInfo);
+
+
+
+
+
+
+14330 ++m_AllocationCount;
+
+
+
+14334 VkResult VmaDefragmentationAlgorithm_Generic::DefragmentRound(
+14335 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+14336 VkDeviceSize maxBytesToMove,
+14337 uint32_t maxAllocationsToMove,
+14338 bool freeOldAllocations)
+
+14340 if(m_Blocks.empty())
+
+
+
+
+
+
+
+
+
+
+
+
+14353 size_t srcBlockMinIndex = 0;
+
+
+
+
+
+
+
+
+
+
+
+
+14366 size_t srcBlockIndex = m_Blocks.size() - 1;
+14367 size_t srcAllocIndex = SIZE_MAX;
+
+
+
+
+
+14373 while(srcAllocIndex >= m_Blocks[srcBlockIndex]->m_Allocations.size())
+
+14375 if(m_Blocks[srcBlockIndex]->m_Allocations.empty())
+
+
+14378 if(srcBlockIndex == srcBlockMinIndex)
+
+
+
+
+
+
+14385 srcAllocIndex = SIZE_MAX;
+
+
+
+
+14390 srcAllocIndex = m_Blocks[srcBlockIndex]->m_Allocations.size() - 1;
+
+
+
+14394 BlockInfo* pSrcBlockInfo = m_Blocks[srcBlockIndex];
+14395 AllocationInfo& allocInfo = pSrcBlockInfo->m_Allocations[srcAllocIndex];
+
+14397 const VkDeviceSize size = allocInfo.m_hAllocation->GetSize();
+14398 const VkDeviceSize srcOffset = allocInfo.m_hAllocation->GetOffset();
+14399 const VkDeviceSize alignment = allocInfo.m_hAllocation->GetAlignment();
+14400 const VmaSuballocationType suballocType = allocInfo.m_hAllocation->GetSuballocationType();
+
+
+14403 for(
size_t dstBlockIndex = 0; dstBlockIndex <= srcBlockIndex; ++dstBlockIndex)
+
+14405 BlockInfo* pDstBlockInfo = m_Blocks[dstBlockIndex];
+14406 VmaAllocationRequest dstAllocRequest;
+14407 if(pDstBlockInfo->m_pBlock->m_pMetadata->CreateAllocationRequest(
+14408 m_CurrentFrameIndex,
+14409 m_pBlockVector->GetFrameInUseCount(),
+14410 m_pBlockVector->GetBufferImageGranularity(),
+
+
+
+
+
+
+14417 &dstAllocRequest) &&
+
+14419 dstBlockIndex, dstAllocRequest.offset, srcBlockIndex, srcOffset))
+
+14421 VMA_ASSERT(dstAllocRequest.itemsToMakeLostCount == 0);
+
+
+14424 if((m_AllocationsMoved + 1 > maxAllocationsToMove) ||
+14425 (m_BytesMoved + size > maxBytesToMove))
+
+
+
-14430 if(freeOldAllocations)
-
-14432 pSrcBlockInfo->m_pBlock->m_pMetadata->FreeAtOffset(srcOffset);
-14433 allocInfo.m_hAllocation->ChangeBlockAllocation(m_hAllocator, pDstBlockInfo->m_pBlock, dstAllocRequest.offset);
-
-
-14436 if(allocInfo.m_pChanged != VMA_NULL)
-
-14438 *allocInfo.m_pChanged = VK_TRUE;
-
-
-14441 ++m_AllocationsMoved;
-14442 m_BytesMoved += size;
-
-14444 VmaVectorRemove(pSrcBlockInfo->m_Allocations, srcAllocIndex);
-
-
-
-
-
-
-
-14452 if(srcAllocIndex > 0)
-
-
-
-
-
-14458 if(srcBlockIndex > 0)
-
-
-14461 srcAllocIndex = SIZE_MAX;
-
-
-
-
-
-
-
-
-
-14471 size_t VmaDefragmentationAlgorithm_Generic::CalcBlocksWithNonMovableCount()
const
-
-
-14474 for(
size_t i = 0; i < m_Blocks.size(); ++i)
-
-14476 if(m_Blocks[i]->m_HasNonMovableAllocations)
-
-
-
-
-
-
-
-14484 VkResult VmaDefragmentationAlgorithm_Generic::Defragment(
-14485 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
-14486 VkDeviceSize maxBytesToMove,
-14487 uint32_t maxAllocationsToMove,
-
-
-14490 if(!m_AllAllocations && m_AllocationCount == 0)
-
-
-
-
-14495 const size_t blockCount = m_Blocks.size();
-14496 for(
size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
-
-14498 BlockInfo* pBlockInfo = m_Blocks[blockIndex];
-
-14500 if(m_AllAllocations)
-
-14502 VmaBlockMetadata_Generic* pMetadata = (VmaBlockMetadata_Generic*)pBlockInfo->m_pBlock->m_pMetadata;
-14503 for(VmaSuballocationList::const_iterator it = pMetadata->m_Suballocations.begin();
-14504 it != pMetadata->m_Suballocations.end();
-
-
-14507 if(it->type != VMA_SUBALLOCATION_TYPE_FREE)
-
-14509 AllocationInfo allocInfo = AllocationInfo(it->hAllocation, VMA_NULL);
-14510 pBlockInfo->m_Allocations.push_back(allocInfo);
-
-
-
-
-14515 pBlockInfo->CalcHasNonMovableAllocations();
-
-
-
-14519 pBlockInfo->SortAllocationsByOffsetDescending();
-
-
-
-
-
-14525 VMA_SORT(m_Blocks.begin(), m_Blocks.end(), BlockInfoCompareMoveDestination());
-
-
-14528 const uint32_t roundCount = 2;
-
-
-14531 VkResult result = VK_SUCCESS;
-14532 for(uint32_t round = 0; (round < roundCount) && (result == VK_SUCCESS); ++round)
-
-
-
-
-
-
-
-14540 bool VmaDefragmentationAlgorithm_Generic::MoveMakesSense(
-14541 size_t dstBlockIndex, VkDeviceSize dstOffset,
-14542 size_t srcBlockIndex, VkDeviceSize srcOffset)
-
-14544 if(dstBlockIndex < srcBlockIndex)
-
-
-
-14548 if(dstBlockIndex > srcBlockIndex)
-
-
-
-14552 if(dstOffset < srcOffset)
-
-
-
-
-
-
-
-
-14562 VmaDefragmentationAlgorithm_Fast::VmaDefragmentationAlgorithm_Fast(
-
-14564 VmaBlockVector* pBlockVector,
-14565 uint32_t currentFrameIndex,
-14566 bool overlappingMoveSupported) :
-14567 VmaDefragmentationAlgorithm(hAllocator, pBlockVector, currentFrameIndex),
-14568 m_OverlappingMoveSupported(overlappingMoveSupported),
-14569 m_AllocationCount(0),
-14570 m_AllAllocations(false),
-
-14572 m_AllocationsMoved(0),
-14573 m_BlockInfos(VmaStlAllocator<BlockInfo>(hAllocator->GetAllocationCallbacks()))
-
-14575 VMA_ASSERT(VMA_DEBUG_MARGIN == 0);
+14430 VmaDefragmentationMove move = {};
+14431 move.srcBlockIndex = pSrcBlockInfo->m_OriginalBlockIndex;
+14432 move.dstBlockIndex = pDstBlockInfo->m_OriginalBlockIndex;
+14433 move.srcOffset = srcOffset;
+14434 move.dstOffset = dstAllocRequest.offset;
+
+14436 move.hAllocation = allocInfo.m_hAllocation;
+14437 move.pSrcBlock = pSrcBlockInfo->m_pBlock;
+14438 move.pDstBlock = pDstBlockInfo->m_pBlock;
+
+14440 moves.push_back(move);
+
+14442 pDstBlockInfo->m_pBlock->m_pMetadata->Alloc(
+
+
+
+14446 allocInfo.m_hAllocation);
+
+14448 if(freeOldAllocations)
+
+14450 pSrcBlockInfo->m_pBlock->m_pMetadata->FreeAtOffset(srcOffset);
+14451 allocInfo.m_hAllocation->ChangeBlockAllocation(m_hAllocator, pDstBlockInfo->m_pBlock, dstAllocRequest.offset);
+
+
+14454 if(allocInfo.m_pChanged != VMA_NULL)
+
+14456 *allocInfo.m_pChanged = VK_TRUE;
+
+
+14459 ++m_AllocationsMoved;
+14460 m_BytesMoved += size;
+
+14462 VmaVectorRemove(pSrcBlockInfo->m_Allocations, srcAllocIndex);
+
+
+
+
+
+
+
+14470 if(srcAllocIndex > 0)
+
+
+
+
+
+14476 if(srcBlockIndex > 0)
+
+
+14479 srcAllocIndex = SIZE_MAX;
+
+
+
+
+
+
+
+
+
+14489 size_t VmaDefragmentationAlgorithm_Generic::CalcBlocksWithNonMovableCount()
const
+
+
+14492 for(
size_t i = 0; i < m_Blocks.size(); ++i)
+
+14494 if(m_Blocks[i]->m_HasNonMovableAllocations)
+
+
+
+
+
+
+
+14502 VkResult VmaDefragmentationAlgorithm_Generic::Defragment(
+14503 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+14504 VkDeviceSize maxBytesToMove,
+14505 uint32_t maxAllocationsToMove,
+
+
+14508 if(!m_AllAllocations && m_AllocationCount == 0)
+
+
+
+
+14513 const size_t blockCount = m_Blocks.size();
+14514 for(
size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+
+14516 BlockInfo* pBlockInfo = m_Blocks[blockIndex];
+
+14518 if(m_AllAllocations)
+
+14520 VmaBlockMetadata_Generic* pMetadata = (VmaBlockMetadata_Generic*)pBlockInfo->m_pBlock->m_pMetadata;
+14521 for(VmaSuballocationList::const_iterator it = pMetadata->m_Suballocations.begin();
+14522 it != pMetadata->m_Suballocations.end();
+
+
+14525 if(it->type != VMA_SUBALLOCATION_TYPE_FREE)
+
+14527 AllocationInfo allocInfo = AllocationInfo(it->hAllocation, VMA_NULL);
+14528 pBlockInfo->m_Allocations.push_back(allocInfo);
+
+
+
+
+14533 pBlockInfo->CalcHasNonMovableAllocations();
+
+
+
+14537 pBlockInfo->SortAllocationsByOffsetDescending();
+
+
+
+
+
+14543 VMA_SORT(m_Blocks.begin(), m_Blocks.end(), BlockInfoCompareMoveDestination());
+
+
+14546 const uint32_t roundCount = 2;
+
+
+14549 VkResult result = VK_SUCCESS;
+14550 for(uint32_t round = 0; (round < roundCount) && (result == VK_SUCCESS); ++round)
+
+
+
+
+
+
+
+14558 bool VmaDefragmentationAlgorithm_Generic::MoveMakesSense(
+14559 size_t dstBlockIndex, VkDeviceSize dstOffset,
+14560 size_t srcBlockIndex, VkDeviceSize srcOffset)
+
+14562 if(dstBlockIndex < srcBlockIndex)
+
+
+
+14566 if(dstBlockIndex > srcBlockIndex)
+
+
+
+14570 if(dstOffset < srcOffset)
+
+
+
+
+
-
-
-14579 VmaDefragmentationAlgorithm_Fast::~VmaDefragmentationAlgorithm_Fast()
-
-
-
-14583 VkResult VmaDefragmentationAlgorithm_Fast::Defragment(
-14584 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
-14585 VkDeviceSize maxBytesToMove,
-14586 uint32_t maxAllocationsToMove,
-
-
-14589 VMA_ASSERT(m_AllAllocations || m_pBlockVector->CalcAllocationCount() == m_AllocationCount);
-
-14591 const size_t blockCount = m_pBlockVector->GetBlockCount();
-14592 if(blockCount == 0 || maxBytesToMove == 0 || maxAllocationsToMove == 0)
-
-
-
+
+
+14580 VmaDefragmentationAlgorithm_Fast::VmaDefragmentationAlgorithm_Fast(
+
+14582 VmaBlockVector* pBlockVector,
+14583 uint32_t currentFrameIndex,
+14584 bool overlappingMoveSupported) :
+14585 VmaDefragmentationAlgorithm(hAllocator, pBlockVector, currentFrameIndex),
+14586 m_OverlappingMoveSupported(overlappingMoveSupported),
+14587 m_AllocationCount(0),
+14588 m_AllAllocations(false),
+
+14590 m_AllocationsMoved(0),
+14591 m_BlockInfos(VmaStlAllocator<BlockInfo>(hAllocator->GetAllocationCallbacks()))
+
+14593 VMA_ASSERT(VMA_DEBUG_MARGIN == 0);
+
+
-14597 PreprocessMetadata();
-
-
+14597 VmaDefragmentationAlgorithm_Fast::~VmaDefragmentationAlgorithm_Fast()
+
+
-14601 m_BlockInfos.resize(blockCount);
-14602 for(
size_t i = 0; i < blockCount; ++i)
-
-14604 m_BlockInfos[i].origBlockIndex = i;
-
-
-14607 VMA_SORT(m_BlockInfos.begin(), m_BlockInfos.end(), [
this](
const BlockInfo& lhs,
const BlockInfo& rhs) ->
bool {
-14608 return m_pBlockVector->GetBlock(lhs.origBlockIndex)->m_pMetadata->GetSumFreeSize() <
-14609 m_pBlockVector->GetBlock(rhs.origBlockIndex)->m_pMetadata->GetSumFreeSize();
-
-
-
-
-14614 FreeSpaceDatabase freeSpaceDb;
-
-14616 size_t dstBlockInfoIndex = 0;
-14617 size_t dstOrigBlockIndex = m_BlockInfos[dstBlockInfoIndex].origBlockIndex;
-14618 VmaDeviceMemoryBlock* pDstBlock = m_pBlockVector->GetBlock(dstOrigBlockIndex);
-14619 VmaBlockMetadata_Generic* pDstMetadata = (VmaBlockMetadata_Generic*)pDstBlock->m_pMetadata;
-14620 VkDeviceSize dstBlockSize = pDstMetadata->GetSize();
-14621 VkDeviceSize dstOffset = 0;
-
-
-14624 for(
size_t srcBlockInfoIndex = 0; !end && srcBlockInfoIndex < blockCount; ++srcBlockInfoIndex)
-
-14626 const size_t srcOrigBlockIndex = m_BlockInfos[srcBlockInfoIndex].origBlockIndex;
-14627 VmaDeviceMemoryBlock*
const pSrcBlock = m_pBlockVector->GetBlock(srcOrigBlockIndex);
-14628 VmaBlockMetadata_Generic*
const pSrcMetadata = (VmaBlockMetadata_Generic*)pSrcBlock->m_pMetadata;
-14629 for(VmaSuballocationList::iterator srcSuballocIt = pSrcMetadata->m_Suballocations.begin();
-14630 !end && srcSuballocIt != pSrcMetadata->m_Suballocations.end(); )
-
-14632 VmaAllocation_T*
const pAlloc = srcSuballocIt->hAllocation;
-14633 const VkDeviceSize srcAllocAlignment = pAlloc->GetAlignment();
-14634 const VkDeviceSize srcAllocSize = srcSuballocIt->size;
-14635 if(m_AllocationsMoved == maxAllocationsToMove ||
-14636 m_BytesMoved + srcAllocSize > maxBytesToMove)
-
-
-
-
-14641 const VkDeviceSize srcAllocOffset = srcSuballocIt->offset;
-
-14643 VmaDefragmentationMove move = {};
-
-14645 size_t freeSpaceInfoIndex;
-14646 VkDeviceSize dstAllocOffset;
-14647 if(freeSpaceDb.Fetch(srcAllocAlignment, srcAllocSize,
-14648 freeSpaceInfoIndex, dstAllocOffset))
-
-14650 size_t freeSpaceOrigBlockIndex = m_BlockInfos[freeSpaceInfoIndex].origBlockIndex;
-14651 VmaDeviceMemoryBlock* pFreeSpaceBlock = m_pBlockVector->GetBlock(freeSpaceOrigBlockIndex);
-14652 VmaBlockMetadata_Generic* pFreeSpaceMetadata = (VmaBlockMetadata_Generic*)pFreeSpaceBlock->m_pMetadata;
-
-
-14655 if(freeSpaceInfoIndex == srcBlockInfoIndex)
-
-14657 VMA_ASSERT(dstAllocOffset <= srcAllocOffset);
-
-
+14601 VkResult VmaDefragmentationAlgorithm_Fast::Defragment(
+14602 VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+14603 VkDeviceSize maxBytesToMove,
+14604 uint32_t maxAllocationsToMove,
+
+
+14607 VMA_ASSERT(m_AllAllocations || m_pBlockVector->CalcAllocationCount() == m_AllocationCount);
+
+14609 const size_t blockCount = m_pBlockVector->GetBlockCount();
+14610 if(blockCount == 0 || maxBytesToMove == 0 || maxAllocationsToMove == 0)
+
+
+
+
+14615 PreprocessMetadata();
+
+
+
+14619 m_BlockInfos.resize(blockCount);
+14620 for(
size_t i = 0; i < blockCount; ++i)
+
+14622 m_BlockInfos[i].origBlockIndex = i;
+
+
+14625 VMA_SORT(m_BlockInfos.begin(), m_BlockInfos.end(), [
this](
const BlockInfo& lhs,
const BlockInfo& rhs) ->
bool {
+14626 return m_pBlockVector->GetBlock(lhs.origBlockIndex)->m_pMetadata->GetSumFreeSize() <
+14627 m_pBlockVector->GetBlock(rhs.origBlockIndex)->m_pMetadata->GetSumFreeSize();
+
+
+
+
+14632 FreeSpaceDatabase freeSpaceDb;
+
+14634 size_t dstBlockInfoIndex = 0;
+14635 size_t dstOrigBlockIndex = m_BlockInfos[dstBlockInfoIndex].origBlockIndex;
+14636 VmaDeviceMemoryBlock* pDstBlock = m_pBlockVector->GetBlock(dstOrigBlockIndex);
+14637 VmaBlockMetadata_Generic* pDstMetadata = (VmaBlockMetadata_Generic*)pDstBlock->m_pMetadata;
+14638 VkDeviceSize dstBlockSize = pDstMetadata->GetSize();
+14639 VkDeviceSize dstOffset = 0;
+
+
+14642 for(
size_t srcBlockInfoIndex = 0; !end && srcBlockInfoIndex < blockCount; ++srcBlockInfoIndex)
+
+14644 const size_t srcOrigBlockIndex = m_BlockInfos[srcBlockInfoIndex].origBlockIndex;
+14645 VmaDeviceMemoryBlock*
const pSrcBlock = m_pBlockVector->GetBlock(srcOrigBlockIndex);
+14646 VmaBlockMetadata_Generic*
const pSrcMetadata = (VmaBlockMetadata_Generic*)pSrcBlock->m_pMetadata;
+14647 for(VmaSuballocationList::iterator srcSuballocIt = pSrcMetadata->m_Suballocations.begin();
+14648 !end && srcSuballocIt != pSrcMetadata->m_Suballocations.end(); )
+
+14650 VmaAllocation_T*
const pAlloc = srcSuballocIt->hAllocation;
+14651 const VkDeviceSize srcAllocAlignment = pAlloc->GetAlignment();
+14652 const VkDeviceSize srcAllocSize = srcSuballocIt->size;
+14653 if(m_AllocationsMoved == maxAllocationsToMove ||
+14654 m_BytesMoved + srcAllocSize > maxBytesToMove)
+
+
+
+
+14659 const VkDeviceSize srcAllocOffset = srcSuballocIt->offset;
-14661 VmaSuballocation suballoc = *srcSuballocIt;
-14662 suballoc.offset = dstAllocOffset;
-14663 suballoc.hAllocation->ChangeOffset(dstAllocOffset);
-14664 m_BytesMoved += srcAllocSize;
-14665 ++m_AllocationsMoved;
-
-14667 VmaSuballocationList::iterator nextSuballocIt = srcSuballocIt;
-
-14669 pSrcMetadata->m_Suballocations.erase(srcSuballocIt);
-14670 srcSuballocIt = nextSuballocIt;
+14661 VmaDefragmentationMove move = {};
+
+14663 size_t freeSpaceInfoIndex;
+14664 VkDeviceSize dstAllocOffset;
+14665 if(freeSpaceDb.Fetch(srcAllocAlignment, srcAllocSize,
+14666 freeSpaceInfoIndex, dstAllocOffset))
+
+14668 size_t freeSpaceOrigBlockIndex = m_BlockInfos[freeSpaceInfoIndex].origBlockIndex;
+14669 VmaDeviceMemoryBlock* pFreeSpaceBlock = m_pBlockVector->GetBlock(freeSpaceOrigBlockIndex);
+14670 VmaBlockMetadata_Generic* pFreeSpaceMetadata = (VmaBlockMetadata_Generic*)pFreeSpaceBlock->m_pMetadata;
-14672 InsertSuballoc(pFreeSpaceMetadata, suballoc);
-
-14674 move.srcBlockIndex = srcOrigBlockIndex;
-14675 move.dstBlockIndex = freeSpaceOrigBlockIndex;
-14676 move.srcOffset = srcAllocOffset;
-14677 move.dstOffset = dstAllocOffset;
-14678 move.size = srcAllocSize;
-
-14680 moves.push_back(move);
-
-
-
-
-
-
-14687 VMA_ASSERT(freeSpaceInfoIndex < srcBlockInfoIndex);
-
-14689 VmaSuballocation suballoc = *srcSuballocIt;
-14690 suballoc.offset = dstAllocOffset;
-14691 suballoc.hAllocation->ChangeBlockAllocation(m_hAllocator, pFreeSpaceBlock, dstAllocOffset);
-14692 m_BytesMoved += srcAllocSize;
-14693 ++m_AllocationsMoved;
-
-14695 VmaSuballocationList::iterator nextSuballocIt = srcSuballocIt;
-
-14697 pSrcMetadata->m_Suballocations.erase(srcSuballocIt);
-14698 srcSuballocIt = nextSuballocIt;
-
-14700 InsertSuballoc(pFreeSpaceMetadata, suballoc);
-
-14702 move.srcBlockIndex = srcOrigBlockIndex;
-14703 move.dstBlockIndex = freeSpaceOrigBlockIndex;
-14704 move.srcOffset = srcAllocOffset;
-14705 move.dstOffset = dstAllocOffset;
-14706 move.size = srcAllocSize;
-
-14708 moves.push_back(move);
-
-
-
-
-14713 dstAllocOffset = VmaAlignUp(dstOffset, srcAllocAlignment);
-
-
-14716 while(dstBlockInfoIndex < srcBlockInfoIndex &&
-14717 dstAllocOffset + srcAllocSize > dstBlockSize)
-
-
-14720 freeSpaceDb.Register(dstBlockInfoIndex, dstOffset, dstBlockSize - dstOffset);
-
-14722 ++dstBlockInfoIndex;
-14723 dstOrigBlockIndex = m_BlockInfos[dstBlockInfoIndex].origBlockIndex;
-14724 pDstBlock = m_pBlockVector->GetBlock(dstOrigBlockIndex);
-14725 pDstMetadata = (VmaBlockMetadata_Generic*)pDstBlock->m_pMetadata;
-14726 dstBlockSize = pDstMetadata->GetSize();
-
-14728 dstAllocOffset = 0;
-
-
-
-14732 if(dstBlockInfoIndex == srcBlockInfoIndex)
-
-14734 VMA_ASSERT(dstAllocOffset <= srcAllocOffset);
-
-14736 const bool overlap = dstAllocOffset + srcAllocSize > srcAllocOffset;
-
-14738 bool skipOver = overlap;
-14739 if(overlap && m_OverlappingMoveSupported && dstAllocOffset < srcAllocOffset)
-
-
-
-14743 skipOver = (srcAllocOffset - dstAllocOffset) * 64 < srcAllocSize;
-
-
-
-
-14748 freeSpaceDb.Register(dstBlockInfoIndex, dstOffset, srcAllocOffset - dstOffset);
-
-14750 dstOffset = srcAllocOffset + srcAllocSize;
-
-
-
-
-
-14756 srcSuballocIt->offset = dstAllocOffset;
-14757 srcSuballocIt->hAllocation->ChangeOffset(dstAllocOffset);
-14758 dstOffset = dstAllocOffset + srcAllocSize;
-14759 m_BytesMoved += srcAllocSize;
-14760 ++m_AllocationsMoved;
-
-
-14763 move.srcBlockIndex = srcOrigBlockIndex;
-14764 move.dstBlockIndex = dstOrigBlockIndex;
-14765 move.srcOffset = srcAllocOffset;
-14766 move.dstOffset = dstAllocOffset;
-14767 move.size = srcAllocSize;
-
-14769 moves.push_back(move);
+
+14673 if(freeSpaceInfoIndex == srcBlockInfoIndex)
+
+14675 VMA_ASSERT(dstAllocOffset <= srcAllocOffset);
+
+
+
+14679 VmaSuballocation suballoc = *srcSuballocIt;
+14680 suballoc.offset = dstAllocOffset;
+14681 suballoc.hAllocation->ChangeOffset(dstAllocOffset);
+14682 m_BytesMoved += srcAllocSize;
+14683 ++m_AllocationsMoved;
+
+14685 VmaSuballocationList::iterator nextSuballocIt = srcSuballocIt;
+
+14687 pSrcMetadata->m_Suballocations.erase(srcSuballocIt);
+14688 srcSuballocIt = nextSuballocIt;
+
+14690 InsertSuballoc(pFreeSpaceMetadata, suballoc);
+
+14692 move.srcBlockIndex = srcOrigBlockIndex;
+14693 move.dstBlockIndex = freeSpaceOrigBlockIndex;
+14694 move.srcOffset = srcAllocOffset;
+14695 move.dstOffset = dstAllocOffset;
+14696 move.size = srcAllocSize;
+
+14698 moves.push_back(move);
+
+
+
+
+
+
+14705 VMA_ASSERT(freeSpaceInfoIndex < srcBlockInfoIndex);
+
+14707 VmaSuballocation suballoc = *srcSuballocIt;
+14708 suballoc.offset = dstAllocOffset;
+14709 suballoc.hAllocation->ChangeBlockAllocation(m_hAllocator, pFreeSpaceBlock, dstAllocOffset);
+14710 m_BytesMoved += srcAllocSize;
+14711 ++m_AllocationsMoved;
+
+14713 VmaSuballocationList::iterator nextSuballocIt = srcSuballocIt;
+
+14715 pSrcMetadata->m_Suballocations.erase(srcSuballocIt);
+14716 srcSuballocIt = nextSuballocIt;
+
+14718 InsertSuballoc(pFreeSpaceMetadata, suballoc);
+
+14720 move.srcBlockIndex = srcOrigBlockIndex;
+14721 move.dstBlockIndex = freeSpaceOrigBlockIndex;
+14722 move.srcOffset = srcAllocOffset;
+14723 move.dstOffset = dstAllocOffset;
+14724 move.size = srcAllocSize;
+
+14726 moves.push_back(move);
+
+
+
+
+14731 dstAllocOffset = VmaAlignUp(dstOffset, srcAllocAlignment);
+
+
+14734 while(dstBlockInfoIndex < srcBlockInfoIndex &&
+14735 dstAllocOffset + srcAllocSize > dstBlockSize)
+
+
+14738 freeSpaceDb.Register(dstBlockInfoIndex, dstOffset, dstBlockSize - dstOffset);
+
+14740 ++dstBlockInfoIndex;
+14741 dstOrigBlockIndex = m_BlockInfos[dstBlockInfoIndex].origBlockIndex;
+14742 pDstBlock = m_pBlockVector->GetBlock(dstOrigBlockIndex);
+14743 pDstMetadata = (VmaBlockMetadata_Generic*)pDstBlock->m_pMetadata;
+14744 dstBlockSize = pDstMetadata->GetSize();
+
+14746 dstAllocOffset = 0;
+
+
+
+14750 if(dstBlockInfoIndex == srcBlockInfoIndex)
+
+14752 VMA_ASSERT(dstAllocOffset <= srcAllocOffset);
+
+14754 const bool overlap = dstAllocOffset + srcAllocSize > srcAllocOffset;
+
+14756 bool skipOver = overlap;
+14757 if(overlap && m_OverlappingMoveSupported && dstAllocOffset < srcAllocOffset)
+
+
+
+14761 skipOver = (srcAllocOffset - dstAllocOffset) * 64 < srcAllocSize;
+
+
+
+
+14766 freeSpaceDb.Register(dstBlockInfoIndex, dstOffset, srcAllocOffset - dstOffset);
+
+14768 dstOffset = srcAllocOffset + srcAllocSize;
+
-
-
-
-
-
-
-14777 VMA_ASSERT(dstBlockInfoIndex < srcBlockInfoIndex);
-14778 VMA_ASSERT(dstAllocOffset + srcAllocSize <= dstBlockSize);
-
-14780 VmaSuballocation suballoc = *srcSuballocIt;
-14781 suballoc.offset = dstAllocOffset;
-14782 suballoc.hAllocation->ChangeBlockAllocation(m_hAllocator, pDstBlock, dstAllocOffset);
-14783 dstOffset = dstAllocOffset + srcAllocSize;
-14784 m_BytesMoved += srcAllocSize;
-14785 ++m_AllocationsMoved;
+
+
+
+14774 srcSuballocIt->offset = dstAllocOffset;
+14775 srcSuballocIt->hAllocation->ChangeOffset(dstAllocOffset);
+14776 dstOffset = dstAllocOffset + srcAllocSize;
+14777 m_BytesMoved += srcAllocSize;
+14778 ++m_AllocationsMoved;
+
+
+14781 move.srcBlockIndex = srcOrigBlockIndex;
+14782 move.dstBlockIndex = dstOrigBlockIndex;
+14783 move.srcOffset = srcAllocOffset;
+14784 move.dstOffset = dstAllocOffset;
+14785 move.size = srcAllocSize;
-14787 VmaSuballocationList::iterator nextSuballocIt = srcSuballocIt;
-
-14789 pSrcMetadata->m_Suballocations.erase(srcSuballocIt);
-14790 srcSuballocIt = nextSuballocIt;
-
-14792 pDstMetadata->m_Suballocations.push_back(suballoc);
-
-14794 move.srcBlockIndex = srcOrigBlockIndex;
-14795 move.dstBlockIndex = dstOrigBlockIndex;
-14796 move.srcOffset = srcAllocOffset;
-14797 move.dstOffset = dstAllocOffset;
-14798 move.size = srcAllocSize;
-
-14800 moves.push_back(move);
-
-
-
-
-
-14806 m_BlockInfos.clear();
-
-14808 PostprocessMetadata();
+14787 moves.push_back(move);
+
+
+
+
+
+
+
+14795 VMA_ASSERT(dstBlockInfoIndex < srcBlockInfoIndex);
+14796 VMA_ASSERT(dstAllocOffset + srcAllocSize <= dstBlockSize);
+
+14798 VmaSuballocation suballoc = *srcSuballocIt;
+14799 suballoc.offset = dstAllocOffset;
+14800 suballoc.hAllocation->ChangeBlockAllocation(m_hAllocator, pDstBlock, dstAllocOffset);
+14801 dstOffset = dstAllocOffset + srcAllocSize;
+14802 m_BytesMoved += srcAllocSize;
+14803 ++m_AllocationsMoved;
+
+14805 VmaSuballocationList::iterator nextSuballocIt = srcSuballocIt;
+
+14807 pSrcMetadata->m_Suballocations.erase(srcSuballocIt);
+14808 srcSuballocIt = nextSuballocIt;
-
-
-
-14813 void VmaDefragmentationAlgorithm_Fast::PreprocessMetadata()
-
-14815 const size_t blockCount = m_pBlockVector->GetBlockCount();
-14816 for(
size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
-
-14818 VmaBlockMetadata_Generic*
const pMetadata =
-14819 (VmaBlockMetadata_Generic*)m_pBlockVector->GetBlock(blockIndex)->m_pMetadata;
-14820 pMetadata->m_FreeCount = 0;
-14821 pMetadata->m_SumFreeSize = pMetadata->GetSize();
-14822 pMetadata->m_FreeSuballocationsBySize.clear();
-14823 for(VmaSuballocationList::iterator it = pMetadata->m_Suballocations.begin();
-14824 it != pMetadata->m_Suballocations.end(); )
-
-14826 if(it->type == VMA_SUBALLOCATION_TYPE_FREE)
-
-14828 VmaSuballocationList::iterator nextIt = it;
-
-14830 pMetadata->m_Suballocations.erase(it);
-
-
-
-
-
-
-
-
-
-
-14841 void VmaDefragmentationAlgorithm_Fast::PostprocessMetadata()
-
-14843 const size_t blockCount = m_pBlockVector->GetBlockCount();
-14844 for(
size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
-
-14846 VmaBlockMetadata_Generic*
const pMetadata =
-14847 (VmaBlockMetadata_Generic*)m_pBlockVector->GetBlock(blockIndex)->m_pMetadata;
-14848 const VkDeviceSize blockSize = pMetadata->GetSize();
-
-
-14851 if(pMetadata->m_Suballocations.empty())
-
-14853 pMetadata->m_FreeCount = 1;
-
-14855 VmaSuballocation suballoc = {
-
-
-
-14859 VMA_SUBALLOCATION_TYPE_FREE };
-14860 pMetadata->m_Suballocations.push_back(suballoc);
-14861 pMetadata->RegisterFreeSuballocation(pMetadata->m_Suballocations.begin());
-
-
-
-
-14866 VkDeviceSize offset = 0;
-14867 VmaSuballocationList::iterator it;
-14868 for(it = pMetadata->m_Suballocations.begin();
-14869 it != pMetadata->m_Suballocations.end();
-
-
-14872 VMA_ASSERT(it->type != VMA_SUBALLOCATION_TYPE_FREE);
-14873 VMA_ASSERT(it->offset >= offset);
-
-
-14876 if(it->offset > offset)
-
-14878 ++pMetadata->m_FreeCount;
-14879 const VkDeviceSize freeSize = it->offset - offset;
-14880 VmaSuballocation suballoc = {
-
-
-
-14884 VMA_SUBALLOCATION_TYPE_FREE };
-14885 VmaSuballocationList::iterator precedingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc);
-14886 if(freeSize >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
-
-14888 pMetadata->m_FreeSuballocationsBySize.push_back(precedingFreeIt);
-
-
-
-14892 pMetadata->m_SumFreeSize -= it->size;
-14893 offset = it->offset + it->size;
-
-
-
-14897 if(offset < blockSize)
-
-14899 ++pMetadata->m_FreeCount;
-14900 const VkDeviceSize freeSize = blockSize - offset;
-14901 VmaSuballocation suballoc = {
-
-
-
-14905 VMA_SUBALLOCATION_TYPE_FREE };
-14906 VMA_ASSERT(it == pMetadata->m_Suballocations.end());
-14907 VmaSuballocationList::iterator trailingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc);
-14908 if(freeSize > VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
-
-14910 pMetadata->m_FreeSuballocationsBySize.push_back(trailingFreeIt);
-
+14810 pDstMetadata->m_Suballocations.push_back(suballoc);
+
+14812 move.srcBlockIndex = srcOrigBlockIndex;
+14813 move.dstBlockIndex = dstOrigBlockIndex;
+14814 move.srcOffset = srcAllocOffset;
+14815 move.dstOffset = dstAllocOffset;
+14816 move.size = srcAllocSize;
+
+14818 moves.push_back(move);
+
+
+
+
+
+14824 m_BlockInfos.clear();
+
+14826 PostprocessMetadata();
+
+
+
+
+14831 void VmaDefragmentationAlgorithm_Fast::PreprocessMetadata()
+
+14833 const size_t blockCount = m_pBlockVector->GetBlockCount();
+14834 for(
size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+
+14836 VmaBlockMetadata_Generic*
const pMetadata =
+14837 (VmaBlockMetadata_Generic*)m_pBlockVector->GetBlock(blockIndex)->m_pMetadata;
+14838 pMetadata->m_FreeCount = 0;
+14839 pMetadata->m_SumFreeSize = pMetadata->GetSize();
+14840 pMetadata->m_FreeSuballocationsBySize.clear();
+14841 for(VmaSuballocationList::iterator it = pMetadata->m_Suballocations.begin();
+14842 it != pMetadata->m_Suballocations.end(); )
+
+14844 if(it->type == VMA_SUBALLOCATION_TYPE_FREE)
+
+14846 VmaSuballocationList::iterator nextIt = it;
+
+14848 pMetadata->m_Suballocations.erase(it);
+
+
+
+
+
+
+
+
+
+
+14859 void VmaDefragmentationAlgorithm_Fast::PostprocessMetadata()
+
+14861 const size_t blockCount = m_pBlockVector->GetBlockCount();
+14862 for(
size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+
+14864 VmaBlockMetadata_Generic*
const pMetadata =
+14865 (VmaBlockMetadata_Generic*)m_pBlockVector->GetBlock(blockIndex)->m_pMetadata;
+14866 const VkDeviceSize blockSize = pMetadata->GetSize();
+
+
+14869 if(pMetadata->m_Suballocations.empty())
+
+14871 pMetadata->m_FreeCount = 1;
+
+14873 VmaSuballocation suballoc = {
+
+
+
+14877 VMA_SUBALLOCATION_TYPE_FREE };
+14878 pMetadata->m_Suballocations.push_back(suballoc);
+14879 pMetadata->RegisterFreeSuballocation(pMetadata->m_Suballocations.begin());
+
+
+
+
+14884 VkDeviceSize offset = 0;
+14885 VmaSuballocationList::iterator it;
+14886 for(it = pMetadata->m_Suballocations.begin();
+14887 it != pMetadata->m_Suballocations.end();
+
+
+14890 VMA_ASSERT(it->type != VMA_SUBALLOCATION_TYPE_FREE);
+14891 VMA_ASSERT(it->offset >= offset);
+
+
+14894 if(it->offset > offset)
+
+14896 ++pMetadata->m_FreeCount;
+14897 const VkDeviceSize freeSize = it->offset - offset;
+14898 VmaSuballocation suballoc = {
+
+
+
+14902 VMA_SUBALLOCATION_TYPE_FREE };
+14903 VmaSuballocationList::iterator precedingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc);
+14904 if(freeSize >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+
+14906 pMetadata->m_FreeSuballocationsBySize.push_back(precedingFreeIt);
+
+
+
+14910 pMetadata->m_SumFreeSize -= it->size;
+14911 offset = it->offset + it->size;
-
-14915 pMetadata->m_FreeSuballocationsBySize.begin(),
-14916 pMetadata->m_FreeSuballocationsBySize.end(),
-14917 VmaSuballocationItemSizeLess());
-
-
-14920 VMA_HEAVY_ASSERT(pMetadata->Validate());
-
-
-
-14924 void VmaDefragmentationAlgorithm_Fast::InsertSuballoc(VmaBlockMetadata_Generic* pMetadata,
const VmaSuballocation& suballoc)
-
-
-14927 VmaSuballocationList::iterator it = pMetadata->m_Suballocations.begin();
-14928 while(it != pMetadata->m_Suballocations.end())
-
-14930 if(it->offset < suballoc.offset)
-
-
-
-
-14935 pMetadata->m_Suballocations.insert(it, suballoc);
-
+
+14915 if(offset < blockSize)
+
+14917 ++pMetadata->m_FreeCount;
+14918 const VkDeviceSize freeSize = blockSize - offset;
+14919 VmaSuballocation suballoc = {
+
+
+
+14923 VMA_SUBALLOCATION_TYPE_FREE };
+14924 VMA_ASSERT(it == pMetadata->m_Suballocations.end());
+14925 VmaSuballocationList::iterator trailingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc);
+14926 if(freeSize > VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+
+14928 pMetadata->m_FreeSuballocationsBySize.push_back(trailingFreeIt);
+
+
+
+
+14933 pMetadata->m_FreeSuballocationsBySize.begin(),
+14934 pMetadata->m_FreeSuballocationsBySize.end(),
+14935 VmaSuballocationItemSizeLess());
+
-
-
-14941 VmaBlockVectorDefragmentationContext::VmaBlockVectorDefragmentationContext(
-
-
-14944 VmaBlockVector* pBlockVector,
-14945 uint32_t currFrameIndex) :
-
-14947 mutexLocked(false),
-14948 blockContexts(VmaStlAllocator<VmaBlockDefragmentationContext>(hAllocator->GetAllocationCallbacks())),
-14949 defragmentationMoves(VmaStlAllocator<VmaDefragmentationMove>(hAllocator->GetAllocationCallbacks())),
-14950 defragmentationMovesProcessed(0),
-14951 defragmentationMovesCommitted(0),
-14952 hasDefragmentationPlan(0),
-14953 m_hAllocator(hAllocator),
-14954 m_hCustomPool(hCustomPool),
-14955 m_pBlockVector(pBlockVector),
-14956 m_CurrFrameIndex(currFrameIndex),
-14957 m_pAlgorithm(VMA_NULL),
-14958 m_Allocations(VmaStlAllocator<AllocInfo>(hAllocator->GetAllocationCallbacks())),
-14959 m_AllAllocations(false)
-
-
-
-14963 VmaBlockVectorDefragmentationContext::~VmaBlockVectorDefragmentationContext()
-
-14965 vma_delete(m_hAllocator, m_pAlgorithm);
-
-
-14968 void VmaBlockVectorDefragmentationContext::AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged)
-
-14970 AllocInfo info = { hAlloc, pChanged };
-14971 m_Allocations.push_back(info);
-
-
-14974 void VmaBlockVectorDefragmentationContext::Begin(
bool overlappingMoveSupported,
VmaDefragmentationFlags flags)
-
-14976 const bool allAllocations = m_AllAllocations ||
-14977 m_Allocations.size() == m_pBlockVector->CalcAllocationCount();
-
-
-
-
-
-
-
-
-
-
-
-
-14990 if(VMA_DEBUG_MARGIN == 0 &&
-
-14992 !m_pBlockVector->IsBufferImageGranularityConflictPossible() &&
-
-
-14995 m_pAlgorithm = vma_new(m_hAllocator, VmaDefragmentationAlgorithm_Fast)(
-14996 m_hAllocator, m_pBlockVector, m_CurrFrameIndex, overlappingMoveSupported);
-
-
-
-15000 m_pAlgorithm = vma_new(m_hAllocator, VmaDefragmentationAlgorithm_Generic)(
-15001 m_hAllocator, m_pBlockVector, m_CurrFrameIndex, overlappingMoveSupported);
-
-
-
-
-15006 m_pAlgorithm->AddAll();
-
-
-
-15010 for(
size_t i = 0, count = m_Allocations.size(); i < count; ++i)
-
-15012 m_pAlgorithm->AddAllocation(m_Allocations[i].hAlloc, m_Allocations[i].pChanged);
-
-
-
-
-
-
-15020 VmaDefragmentationContext_T::VmaDefragmentationContext_T(
-
-15022 uint32_t currFrameIndex,
-
-
-15025 m_hAllocator(hAllocator),
-15026 m_CurrFrameIndex(currFrameIndex),
-
-
-15029 m_CustomPoolContexts(VmaStlAllocator<VmaBlockVectorDefragmentationContext*>(hAllocator->GetAllocationCallbacks()))
-
-15031 memset(m_DefaultPoolContexts, 0,
sizeof(m_DefaultPoolContexts));
-
-
-15034 VmaDefragmentationContext_T::~VmaDefragmentationContext_T()
-
-15036 for(
size_t i = m_CustomPoolContexts.size(); i--; )
-
-15038 VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_CustomPoolContexts[i];
-15039 pBlockVectorCtx->GetBlockVector()->DefragmentationEnd(pBlockVectorCtx, m_Flags, m_pStats);
-15040 vma_delete(m_hAllocator, pBlockVectorCtx);
-
-15042 for(
size_t i = m_hAllocator->m_MemProps.memoryTypeCount; i--; )
-
-15044 VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_DefaultPoolContexts[i];
-15045 if(pBlockVectorCtx)
-
-15047 pBlockVectorCtx->GetBlockVector()->DefragmentationEnd(pBlockVectorCtx, m_Flags, m_pStats);
-15048 vma_delete(m_hAllocator, pBlockVectorCtx);
-
-
-
-
-15053 void VmaDefragmentationContext_T::AddPools(uint32_t poolCount,
const VmaPool* pPools)
-
-15055 for(uint32_t poolIndex = 0; poolIndex < poolCount; ++poolIndex)
-
-15057 VmaPool pool = pPools[poolIndex];
-
-
-15060 if(pool->m_BlockVector.GetAlgorithm() == 0)
-
-15062 VmaBlockVectorDefragmentationContext* pBlockVectorDefragCtx = VMA_NULL;
-
-15064 for(
size_t i = m_CustomPoolContexts.size(); i--; )
-
-15066 if(m_CustomPoolContexts[i]->GetCustomPool() == pool)
-
-15068 pBlockVectorDefragCtx = m_CustomPoolContexts[i];
-
-
-
-
-15073 if(!pBlockVectorDefragCtx)
-
-15075 pBlockVectorDefragCtx = vma_new(m_hAllocator, VmaBlockVectorDefragmentationContext)(
-
-
-15078 &pool->m_BlockVector,
-
-15080 m_CustomPoolContexts.push_back(pBlockVectorDefragCtx);
-
-
-15083 pBlockVectorDefragCtx->AddAll();
-
-
-
-
-15088 void VmaDefragmentationContext_T::AddAllocations(
-15089 uint32_t allocationCount,
-
-15091 VkBool32* pAllocationsChanged)
-
-
-15094 for(uint32_t allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
-
-
-15097 VMA_ASSERT(hAlloc);
-
-15099 if((hAlloc->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK) &&
-
-15101 (hAlloc->GetLastUseFrameIndex() != VMA_FRAME_INDEX_LOST))
-
-15103 VmaBlockVectorDefragmentationContext* pBlockVectorDefragCtx = VMA_NULL;
-
-15105 const VmaPool hAllocPool = hAlloc->GetBlock()->GetParentPool();
-
-15107 if(hAllocPool != VK_NULL_HANDLE)
-
-
-15110 if(hAllocPool->m_BlockVector.GetAlgorithm() == 0)
-
-15112 for(
size_t i = m_CustomPoolContexts.size(); i--; )
-
-15114 if(m_CustomPoolContexts[i]->GetCustomPool() == hAllocPool)
-
-15116 pBlockVectorDefragCtx = m_CustomPoolContexts[i];
-
-
-
-15120 if(!pBlockVectorDefragCtx)
-
-15122 pBlockVectorDefragCtx = vma_new(m_hAllocator, VmaBlockVectorDefragmentationContext)(
-
-
-15125 &hAllocPool->m_BlockVector,
-
-15127 m_CustomPoolContexts.push_back(pBlockVectorDefragCtx);
-
-
-
-
-
-
-15134 const uint32_t memTypeIndex = hAlloc->GetMemoryTypeIndex();
-15135 pBlockVectorDefragCtx = m_DefaultPoolContexts[memTypeIndex];
-15136 if(!pBlockVectorDefragCtx)
-
-15138 pBlockVectorDefragCtx = vma_new(m_hAllocator, VmaBlockVectorDefragmentationContext)(
-
-
-15141 m_hAllocator->m_pBlockVectors[memTypeIndex],
-
-15143 m_DefaultPoolContexts[memTypeIndex] = pBlockVectorDefragCtx;
-
-
-
-15147 if(pBlockVectorDefragCtx)
-
-15149 VkBool32*
const pChanged = (pAllocationsChanged != VMA_NULL) ?
-15150 &pAllocationsChanged[allocIndex] : VMA_NULL;
-15151 pBlockVectorDefragCtx->AddAllocation(hAlloc, pChanged);
-
-
-
-
-
-15157 VkResult VmaDefragmentationContext_T::Defragment(
-15158 VkDeviceSize maxCpuBytesToMove, uint32_t maxCpuAllocationsToMove,
-15159 VkDeviceSize maxGpuBytesToMove, uint32_t maxGpuAllocationsToMove,
-
-
-
-
-
-
-
-
-
-
-
-15171 m_MaxCpuBytesToMove = maxCpuBytesToMove;
-15172 m_MaxCpuAllocationsToMove = maxCpuAllocationsToMove;
-
-15174 m_MaxGpuBytesToMove = maxGpuBytesToMove;
-15175 m_MaxGpuAllocationsToMove = maxGpuAllocationsToMove;
-
-15177 if(m_MaxCpuBytesToMove == 0 && m_MaxCpuAllocationsToMove == 0 &&
-15178 m_MaxGpuBytesToMove == 0 && m_MaxGpuAllocationsToMove == 0)
-
-
-15181 return VK_NOT_READY;
-
-
-15184 if(commandBuffer == VK_NULL_HANDLE)
-
-15186 maxGpuBytesToMove = 0;
-15187 maxGpuAllocationsToMove = 0;
-
-
-15190 VkResult res = VK_SUCCESS;
+14938 VMA_HEAVY_ASSERT(pMetadata->Validate());
+
+
+
+14942 void VmaDefragmentationAlgorithm_Fast::InsertSuballoc(VmaBlockMetadata_Generic* pMetadata,
const VmaSuballocation& suballoc)
+
+
+14945 VmaSuballocationList::iterator it = pMetadata->m_Suballocations.begin();
+14946 while(it != pMetadata->m_Suballocations.end())
+
+14948 if(it->offset < suballoc.offset)
+
+
+
+
+14953 pMetadata->m_Suballocations.insert(it, suballoc);
+
+
+
+
+14959 VmaBlockVectorDefragmentationContext::VmaBlockVectorDefragmentationContext(
+
+
+14962 VmaBlockVector* pBlockVector,
+14963 uint32_t currFrameIndex) :
+
+14965 mutexLocked(false),
+14966 blockContexts(VmaStlAllocator<VmaBlockDefragmentationContext>(hAllocator->GetAllocationCallbacks())),
+14967 defragmentationMoves(VmaStlAllocator<VmaDefragmentationMove>(hAllocator->GetAllocationCallbacks())),
+14968 defragmentationMovesProcessed(0),
+14969 defragmentationMovesCommitted(0),
+14970 hasDefragmentationPlan(0),
+14971 m_hAllocator(hAllocator),
+14972 m_hCustomPool(hCustomPool),
+14973 m_pBlockVector(pBlockVector),
+14974 m_CurrFrameIndex(currFrameIndex),
+14975 m_pAlgorithm(VMA_NULL),
+14976 m_Allocations(VmaStlAllocator<AllocInfo>(hAllocator->GetAllocationCallbacks())),
+14977 m_AllAllocations(false)
+
+
+
+14981 VmaBlockVectorDefragmentationContext::~VmaBlockVectorDefragmentationContext()
+
+14983 vma_delete(m_hAllocator, m_pAlgorithm);
+
+
+14986 void VmaBlockVectorDefragmentationContext::AddAllocation(
VmaAllocation hAlloc, VkBool32* pChanged)
+
+14988 AllocInfo info = { hAlloc, pChanged };
+14989 m_Allocations.push_back(info);
+
+
+14992 void VmaBlockVectorDefragmentationContext::Begin(
bool overlappingMoveSupported,
VmaDefragmentationFlags flags)
+
+14994 const bool allAllocations = m_AllAllocations ||
+14995 m_Allocations.size() == m_pBlockVector->CalcAllocationCount();
+
+
+
+
+
+
+
+
+
+
+
+
+15008 if(VMA_DEBUG_MARGIN == 0 &&
+
+15010 !m_pBlockVector->IsBufferImageGranularityConflictPossible() &&
+
+
+15013 m_pAlgorithm = vma_new(m_hAllocator, VmaDefragmentationAlgorithm_Fast)(
+15014 m_hAllocator, m_pBlockVector, m_CurrFrameIndex, overlappingMoveSupported);
+
+
+
+15018 m_pAlgorithm = vma_new(m_hAllocator, VmaDefragmentationAlgorithm_Generic)(
+15019 m_hAllocator, m_pBlockVector, m_CurrFrameIndex, overlappingMoveSupported);
+
+
+
+
+15024 m_pAlgorithm->AddAll();
+
+
+
+15028 for(
size_t i = 0, count = m_Allocations.size(); i < count; ++i)
+
+15030 m_pAlgorithm->AddAllocation(m_Allocations[i].hAlloc, m_Allocations[i].pChanged);
+
+
+
+
+
+
+15038 VmaDefragmentationContext_T::VmaDefragmentationContext_T(
+
+15040 uint32_t currFrameIndex,
+
+
+15043 m_hAllocator(hAllocator),
+15044 m_CurrFrameIndex(currFrameIndex),
+
+
+15047 m_CustomPoolContexts(VmaStlAllocator<VmaBlockVectorDefragmentationContext*>(hAllocator->GetAllocationCallbacks()))
+
+15049 memset(m_DefaultPoolContexts, 0,
sizeof(m_DefaultPoolContexts));
+
+
+15052 VmaDefragmentationContext_T::~VmaDefragmentationContext_T()
+
+15054 for(
size_t i = m_CustomPoolContexts.size(); i--; )
+
+15056 VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_CustomPoolContexts[i];
+15057 pBlockVectorCtx->GetBlockVector()->DefragmentationEnd(pBlockVectorCtx, m_Flags, m_pStats);
+15058 vma_delete(m_hAllocator, pBlockVectorCtx);
+
+15060 for(
size_t i = m_hAllocator->m_MemProps.memoryTypeCount; i--; )
+
+15062 VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_DefaultPoolContexts[i];
+15063 if(pBlockVectorCtx)
+
+15065 pBlockVectorCtx->GetBlockVector()->DefragmentationEnd(pBlockVectorCtx, m_Flags, m_pStats);
+15066 vma_delete(m_hAllocator, pBlockVectorCtx);
+
+
+
+
+15071 void VmaDefragmentationContext_T::AddPools(uint32_t poolCount,
const VmaPool* pPools)
+
+15073 for(uint32_t poolIndex = 0; poolIndex < poolCount; ++poolIndex)
+
+15075 VmaPool pool = pPools[poolIndex];
+
+
+15078 if(pool->m_BlockVector.GetAlgorithm() == 0)
+
+15080 VmaBlockVectorDefragmentationContext* pBlockVectorDefragCtx = VMA_NULL;
+
+15082 for(
size_t i = m_CustomPoolContexts.size(); i--; )
+
+15084 if(m_CustomPoolContexts[i]->GetCustomPool() == pool)
+
+15086 pBlockVectorDefragCtx = m_CustomPoolContexts[i];
+
+
+
+
+15091 if(!pBlockVectorDefragCtx)
+
+15093 pBlockVectorDefragCtx = vma_new(m_hAllocator, VmaBlockVectorDefragmentationContext)(
+
+
+15096 &pool->m_BlockVector,
+
+15098 m_CustomPoolContexts.push_back(pBlockVectorDefragCtx);
+
+
+15101 pBlockVectorDefragCtx->AddAll();
+
+
+
+
+15106 void VmaDefragmentationContext_T::AddAllocations(
+15107 uint32_t allocationCount,
+
+15109 VkBool32* pAllocationsChanged)
+
+
+15112 for(uint32_t allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+
+
+15115 VMA_ASSERT(hAlloc);
+
+15117 if((hAlloc->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK) &&
+
+15119 (hAlloc->GetLastUseFrameIndex() != VMA_FRAME_INDEX_LOST))
+
+15121 VmaBlockVectorDefragmentationContext* pBlockVectorDefragCtx = VMA_NULL;
+
+15123 const VmaPool hAllocPool = hAlloc->GetBlock()->GetParentPool();
+
+15125 if(hAllocPool != VK_NULL_HANDLE)
+
+
+15128 if(hAllocPool->m_BlockVector.GetAlgorithm() == 0)
+
+15130 for(
size_t i = m_CustomPoolContexts.size(); i--; )
+
+15132 if(m_CustomPoolContexts[i]->GetCustomPool() == hAllocPool)
+
+15134 pBlockVectorDefragCtx = m_CustomPoolContexts[i];
+
+
+
+15138 if(!pBlockVectorDefragCtx)
+
+15140 pBlockVectorDefragCtx = vma_new(m_hAllocator, VmaBlockVectorDefragmentationContext)(
+
+
+15143 &hAllocPool->m_BlockVector,
+
+15145 m_CustomPoolContexts.push_back(pBlockVectorDefragCtx);
+
+
+
+
+
+
+15152 const uint32_t memTypeIndex = hAlloc->GetMemoryTypeIndex();
+15153 pBlockVectorDefragCtx = m_DefaultPoolContexts[memTypeIndex];
+15154 if(!pBlockVectorDefragCtx)
+
+15156 pBlockVectorDefragCtx = vma_new(m_hAllocator, VmaBlockVectorDefragmentationContext)(
+
+
+15159 m_hAllocator->m_pBlockVectors[memTypeIndex],
+
+15161 m_DefaultPoolContexts[memTypeIndex] = pBlockVectorDefragCtx;
+
+
+
+15165 if(pBlockVectorDefragCtx)
+
+15167 VkBool32*
const pChanged = (pAllocationsChanged != VMA_NULL) ?
+15168 &pAllocationsChanged[allocIndex] : VMA_NULL;
+15169 pBlockVectorDefragCtx->AddAllocation(hAlloc, pChanged);
+
+
+
+
+
+15175 VkResult VmaDefragmentationContext_T::Defragment(
+15176 VkDeviceSize maxCpuBytesToMove, uint32_t maxCpuAllocationsToMove,
+15177 VkDeviceSize maxGpuBytesToMove, uint32_t maxGpuAllocationsToMove,
+
+
+
+
+
+
+
+
+
+
+
+15189 m_MaxCpuBytesToMove = maxCpuBytesToMove;
+15190 m_MaxCpuAllocationsToMove = maxCpuAllocationsToMove;
-
-15193 for(uint32_t memTypeIndex = 0;
-15194 memTypeIndex < m_hAllocator->GetMemoryTypeCount() && res >= VK_SUCCESS;
-
-
-15197 VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_DefaultPoolContexts[memTypeIndex];
-15198 if(pBlockVectorCtx)
-
-15200 VMA_ASSERT(pBlockVectorCtx->GetBlockVector());
-15201 pBlockVectorCtx->GetBlockVector()->Defragment(
-
-
-15204 maxCpuBytesToMove, maxCpuAllocationsToMove,
-15205 maxGpuBytesToMove, maxGpuAllocationsToMove,
-
-15207 if(pBlockVectorCtx->res != VK_SUCCESS)
-
-15209 res = pBlockVectorCtx->res;
-
-
-
-
-
-15215 for(
size_t customCtxIndex = 0, customCtxCount = m_CustomPoolContexts.size();
-15216 customCtxIndex < customCtxCount && res >= VK_SUCCESS;
-
-
-15219 VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_CustomPoolContexts[customCtxIndex];
-15220 VMA_ASSERT(pBlockVectorCtx && pBlockVectorCtx->GetBlockVector());
-15221 pBlockVectorCtx->GetBlockVector()->Defragment(
-
-
-15224 maxCpuBytesToMove, maxCpuAllocationsToMove,
-15225 maxGpuBytesToMove, maxGpuAllocationsToMove,
-
-15227 if(pBlockVectorCtx->res != VK_SUCCESS)
-
-15229 res = pBlockVectorCtx->res;
-
-
-
-
-
-
-
-
-
-
-
-
-15242 for(uint32_t memTypeIndex = 0;
-15243 memTypeIndex < m_hAllocator->GetMemoryTypeCount();
-
-
-15246 VmaBlockVectorDefragmentationContext *pBlockVectorCtx = m_DefaultPoolContexts[memTypeIndex];
-15247 if(pBlockVectorCtx)
-
-15249 VMA_ASSERT(pBlockVectorCtx->GetBlockVector());
+15192 m_MaxGpuBytesToMove = maxGpuBytesToMove;
+15193 m_MaxGpuAllocationsToMove = maxGpuAllocationsToMove;
+
+15195 if(m_MaxCpuBytesToMove == 0 && m_MaxCpuAllocationsToMove == 0 &&
+15196 m_MaxGpuBytesToMove == 0 && m_MaxGpuAllocationsToMove == 0)
+
+
+15199 return VK_NOT_READY;
+
+
+15202 if(commandBuffer == VK_NULL_HANDLE)
+
+15204 maxGpuBytesToMove = 0;
+15205 maxGpuAllocationsToMove = 0;
+
+
+15208 VkResult res = VK_SUCCESS;
+
+
+15211 for(uint32_t memTypeIndex = 0;
+15212 memTypeIndex < m_hAllocator->GetMemoryTypeCount() && res >= VK_SUCCESS;
+
+
+15215 VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_DefaultPoolContexts[memTypeIndex];
+15216 if(pBlockVectorCtx)
+
+15218 VMA_ASSERT(pBlockVectorCtx->GetBlockVector());
+15219 pBlockVectorCtx->GetBlockVector()->Defragment(
+
+
+15222 maxCpuBytesToMove, maxCpuAllocationsToMove,
+15223 maxGpuBytesToMove, maxGpuAllocationsToMove,
+
+15225 if(pBlockVectorCtx->res != VK_SUCCESS)
+
+15227 res = pBlockVectorCtx->res;
+
+
+
+
+
+15233 for(
size_t customCtxIndex = 0, customCtxCount = m_CustomPoolContexts.size();
+15234 customCtxIndex < customCtxCount && res >= VK_SUCCESS;
+
+
+15237 VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_CustomPoolContexts[customCtxIndex];
+15238 VMA_ASSERT(pBlockVectorCtx && pBlockVectorCtx->GetBlockVector());
+15239 pBlockVectorCtx->GetBlockVector()->Defragment(
+
+
+15242 maxCpuBytesToMove, maxCpuAllocationsToMove,
+15243 maxGpuBytesToMove, maxGpuAllocationsToMove,
+
+15245 if(pBlockVectorCtx->res != VK_SUCCESS)
+
+15247 res = pBlockVectorCtx->res;
+
+
-15251 if(!pBlockVectorCtx->hasDefragmentationPlan)
-
-15253 pBlockVectorCtx->GetBlockVector()->Defragment(
-
-
-15256 m_MaxCpuBytesToMove, m_MaxCpuAllocationsToMove,
-15257 m_MaxGpuBytesToMove, m_MaxGpuAllocationsToMove,
-
-
-15260 if(pBlockVectorCtx->res < VK_SUCCESS)
-
-
-15263 pBlockVectorCtx->hasDefragmentationPlan =
true;
-
-
-15266 const uint32_t processed = pBlockVectorCtx->GetBlockVector()->ProcessDefragmentations(
-
-15268 pCurrentMove, movesLeft);
-
-15270 movesLeft -= processed;
-15271 pCurrentMove += processed;
-
-
-
-
-15276 for(
size_t customCtxIndex = 0, customCtxCount = m_CustomPoolContexts.size();
-15277 customCtxIndex < customCtxCount;
-
-
-15280 VmaBlockVectorDefragmentationContext *pBlockVectorCtx = m_CustomPoolContexts[customCtxIndex];
-15281 VMA_ASSERT(pBlockVectorCtx && pBlockVectorCtx->GetBlockVector());
-
-15283 if(!pBlockVectorCtx->hasDefragmentationPlan)
-
-15285 pBlockVectorCtx->GetBlockVector()->Defragment(
-
-
-15288 m_MaxCpuBytesToMove, m_MaxCpuAllocationsToMove,
-15289 m_MaxGpuBytesToMove, m_MaxGpuAllocationsToMove,
-
-
-15292 if(pBlockVectorCtx->res < VK_SUCCESS)
-
-
-15295 pBlockVectorCtx->hasDefragmentationPlan =
true;
-
-
-15298 const uint32_t processed = pBlockVectorCtx->GetBlockVector()->ProcessDefragmentations(
-
-15300 pCurrentMove, movesLeft);
-
-15302 movesLeft -= processed;
-15303 pCurrentMove += processed;
-
-
-
-
-
-
-15310 VkResult VmaDefragmentationContext_T::DefragmentPassEnd()
-
-15312 VkResult res = VK_SUCCESS;
-
-
-15315 for(uint32_t memTypeIndex = 0;
-15316 memTypeIndex < m_hAllocator->GetMemoryTypeCount();
-
-
-15319 VmaBlockVectorDefragmentationContext *pBlockVectorCtx = m_DefaultPoolContexts[memTypeIndex];
-15320 if(pBlockVectorCtx)
-
-15322 VMA_ASSERT(pBlockVectorCtx->GetBlockVector());
+
+
+
+
+
+
+
+
+
+15260 for(uint32_t memTypeIndex = 0;
+15261 memTypeIndex < m_hAllocator->GetMemoryTypeCount();
+
+
+15264 VmaBlockVectorDefragmentationContext *pBlockVectorCtx = m_DefaultPoolContexts[memTypeIndex];
+15265 if(pBlockVectorCtx)
+
+15267 VMA_ASSERT(pBlockVectorCtx->GetBlockVector());
+
+15269 if(!pBlockVectorCtx->hasDefragmentationPlan)
+
+15271 pBlockVectorCtx->GetBlockVector()->Defragment(
+
+
+15274 m_MaxCpuBytesToMove, m_MaxCpuAllocationsToMove,
+15275 m_MaxGpuBytesToMove, m_MaxGpuAllocationsToMove,
+
+
+15278 if(pBlockVectorCtx->res < VK_SUCCESS)
+
+
+15281 pBlockVectorCtx->hasDefragmentationPlan =
true;
+
+
+15284 const uint32_t processed = pBlockVectorCtx->GetBlockVector()->ProcessDefragmentations(
+
+15286 pCurrentMove, movesLeft);
+
+15288 movesLeft -= processed;
+15289 pCurrentMove += processed;
+
+
+
+
+15294 for(
size_t customCtxIndex = 0, customCtxCount = m_CustomPoolContexts.size();
+15295 customCtxIndex < customCtxCount;
+
+
+15298 VmaBlockVectorDefragmentationContext *pBlockVectorCtx = m_CustomPoolContexts[customCtxIndex];
+15299 VMA_ASSERT(pBlockVectorCtx && pBlockVectorCtx->GetBlockVector());
+
+15301 if(!pBlockVectorCtx->hasDefragmentationPlan)
+
+15303 pBlockVectorCtx->GetBlockVector()->Defragment(
+
+
+15306 m_MaxCpuBytesToMove, m_MaxCpuAllocationsToMove,
+15307 m_MaxGpuBytesToMove, m_MaxGpuAllocationsToMove,
+
+
+15310 if(pBlockVectorCtx->res < VK_SUCCESS)
+
+
+15313 pBlockVectorCtx->hasDefragmentationPlan =
true;
+
+
+15316 const uint32_t processed = pBlockVectorCtx->GetBlockVector()->ProcessDefragmentations(
+
+15318 pCurrentMove, movesLeft);
+
+15320 movesLeft -= processed;
+15321 pCurrentMove += processed;
+
-15324 if(!pBlockVectorCtx->hasDefragmentationPlan)
-
-15326 res = VK_NOT_READY;
-
-
-
-15330 pBlockVectorCtx->GetBlockVector()->CommitDefragmentations(
-15331 pBlockVectorCtx, m_pStats);
-
-15333 if(pBlockVectorCtx->defragmentationMoves.size() != pBlockVectorCtx->defragmentationMovesCommitted)
-15334 res = VK_NOT_READY;
-
-
-
-
-15339 for(
size_t customCtxIndex = 0, customCtxCount = m_CustomPoolContexts.size();
-15340 customCtxIndex < customCtxCount;
-
-
-15343 VmaBlockVectorDefragmentationContext *pBlockVectorCtx = m_CustomPoolContexts[customCtxIndex];
-15344 VMA_ASSERT(pBlockVectorCtx && pBlockVectorCtx->GetBlockVector());
-
-15346 if(!pBlockVectorCtx->hasDefragmentationPlan)
-
-15348 res = VK_NOT_READY;
-
-
-
-15352 pBlockVectorCtx->GetBlockVector()->CommitDefragmentations(
-15353 pBlockVectorCtx, m_pStats);
-
-15355 if(pBlockVectorCtx->defragmentationMoves.size() != pBlockVectorCtx->defragmentationMovesCommitted)
-15356 res = VK_NOT_READY;
-
-
-
-
-
-
-
-15365 #if VMA_RECORDING_ENABLED
-
-15367 VmaRecorder::VmaRecorder() :
-
-
-
-15371 m_RecordingStartTime(std::chrono::high_resolution_clock::now())
-
-
-
-
-
-15377 m_UseMutex = useMutex;
-15378 m_Flags = settings.
flags;
+
+
+
+
+15328 VkResult VmaDefragmentationContext_T::DefragmentPassEnd()
+
+15330 VkResult res = VK_SUCCESS;
+
+
+15333 for(uint32_t memTypeIndex = 0;
+15334 memTypeIndex < m_hAllocator->GetMemoryTypeCount();
+
+
+15337 VmaBlockVectorDefragmentationContext *pBlockVectorCtx = m_DefaultPoolContexts[memTypeIndex];
+15338 if(pBlockVectorCtx)
+
+15340 VMA_ASSERT(pBlockVectorCtx->GetBlockVector());
+
+15342 if(!pBlockVectorCtx->hasDefragmentationPlan)
+
+15344 res = VK_NOT_READY;
+
+
+
+15348 pBlockVectorCtx->GetBlockVector()->CommitDefragmentations(
+15349 pBlockVectorCtx, m_pStats);
+
+15351 if(pBlockVectorCtx->defragmentationMoves.size() != pBlockVectorCtx->defragmentationMovesCommitted)
+15352 res = VK_NOT_READY;
+
+
+
+
+15357 for(
size_t customCtxIndex = 0, customCtxCount = m_CustomPoolContexts.size();
+15358 customCtxIndex < customCtxCount;
+
+
+15361 VmaBlockVectorDefragmentationContext *pBlockVectorCtx = m_CustomPoolContexts[customCtxIndex];
+15362 VMA_ASSERT(pBlockVectorCtx && pBlockVectorCtx->GetBlockVector());
+
+15364 if(!pBlockVectorCtx->hasDefragmentationPlan)
+
+15366 res = VK_NOT_READY;
+
+
+
+15370 pBlockVectorCtx->GetBlockVector()->CommitDefragmentations(
+15371 pBlockVectorCtx, m_pStats);
+
+15373 if(pBlockVectorCtx->defragmentationMoves.size() != pBlockVectorCtx->defragmentationMovesCommitted)
+15374 res = VK_NOT_READY;
+
+
+
+
-15380 #if defined(_WIN32)
-
-15382 errno_t err = fopen_s(&m_File, settings.
pFilePath,
"wb");
-
-
-
-15386 return VK_ERROR_INITIALIZATION_FAILED;
-
-
-
-15390 m_File = fopen(settings.
pFilePath,
"wb");
-
-
-
-15394 return VK_ERROR_INITIALIZATION_FAILED;
-
-
+
+
+15383 #if VMA_RECORDING_ENABLED
+
+15385 VmaRecorder::VmaRecorder() :
+
+
+
+15389 m_RecordingStartTime(std::chrono::high_resolution_clock::now())
+
+
+
+
+
+15395 m_UseMutex = useMutex;
+15396 m_Flags = settings.
flags;
-
-15399 fprintf(m_File,
"%s\n",
"Vulkan Memory Allocator,Calls recording");
-15400 fprintf(m_File,
"%s\n",
"1,8");
+15398 #if defined(_WIN32)
+
+15400 errno_t err = fopen_s(&m_File, settings.
pFilePath,
"wb");
-
-
-
-15405 VmaRecorder::~VmaRecorder()
-
-15407 if(m_File != VMA_NULL)
-
-
-
-
-
-15413 void VmaRecorder::RecordCreateAllocator(uint32_t frameIndex)
-
-15415 CallParams callParams;
-15416 GetBasicParams(callParams);
-
-15418 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15419 fprintf(m_File,
"%u,%.3f,%u,vmaCreateAllocator\n", callParams.threadId, callParams.time, frameIndex);
-
+
+
+15404 return VK_ERROR_INITIALIZATION_FAILED;
+
+
+
+15408 m_File = fopen(settings.
pFilePath,
"wb");
+
+
+
+15412 return VK_ERROR_INITIALIZATION_FAILED;
+
+
+
+
+15417 fprintf(m_File,
"%s\n",
"Vulkan Memory Allocator,Calls recording");
+15418 fprintf(m_File,
"%s\n",
"1,8");
+
+
-15423 void VmaRecorder::RecordDestroyAllocator(uint32_t frameIndex)
+15423 VmaRecorder::~VmaRecorder()
-15425 CallParams callParams;
-15426 GetBasicParams(callParams);
-
-15428 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15429 fprintf(m_File,
"%u,%.3f,%u,vmaDestroyAllocator\n", callParams.threadId, callParams.time, frameIndex);
-
-
-
-
-
-15435 CallParams callParams;
-15436 GetBasicParams(callParams);
-
-15438 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15439 fprintf(m_File,
"%u,%.3f,%u,vmaCreatePool,%u,%u,%llu,%llu,%llu,%u,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
-
-
-
-
-
-
-
-15450 void VmaRecorder::RecordDestroyPool(uint32_t frameIndex,
VmaPool pool)
-
-15452 CallParams callParams;
-15453 GetBasicParams(callParams);
-
-15455 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15456 fprintf(m_File,
"%u,%.3f,%u,vmaDestroyPool,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
-
-15461 void VmaRecorder::RecordAllocateMemory(uint32_t frameIndex,
-15462 const VkMemoryRequirements& vkMemReq,
-
-
-
-15466 CallParams callParams;
-15467 GetBasicParams(callParams);
-
-15469 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15470 UserDataString userDataStr(createInfo.
flags, createInfo.
pUserData);
-15471 fprintf(m_File,
"%u,%.3f,%u,vmaAllocateMemory,%llu,%llu,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
-
-15473 vkMemReq.alignment,
-15474 vkMemReq.memoryTypeBits,
-
-
-
-
-
-
-
-15482 userDataStr.GetString());
-
-
-
-15486 void VmaRecorder::RecordAllocateMemoryPages(uint32_t frameIndex,
-15487 const VkMemoryRequirements& vkMemReq,
-
-15489 uint64_t allocationCount,
-
-
-15492 CallParams callParams;
-15493 GetBasicParams(callParams);
-
-15495 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15496 UserDataString userDataStr(createInfo.
flags, createInfo.
pUserData);
-15497 fprintf(m_File,
"%u,%.3f,%u,vmaAllocateMemoryPages,%llu,%llu,%u,%u,%u,%u,%u,%u,%p,", callParams.threadId, callParams.time, frameIndex,
-
-15499 vkMemReq.alignment,
-15500 vkMemReq.memoryTypeBits,
-
-
-
-
-
-
-15507 PrintPointerList(allocationCount, pAllocations);
-15508 fprintf(m_File,
",%s\n", userDataStr.GetString());
-
-
-
-15512 void VmaRecorder::RecordAllocateMemoryForBuffer(uint32_t frameIndex,
-15513 const VkMemoryRequirements& vkMemReq,
-15514 bool requiresDedicatedAllocation,
-15515 bool prefersDedicatedAllocation,
-
-
-
-15519 CallParams callParams;
-15520 GetBasicParams(callParams);
-
-15522 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15523 UserDataString userDataStr(createInfo.
flags, createInfo.
pUserData);
-15524 fprintf(m_File,
"%u,%.3f,%u,vmaAllocateMemoryForBuffer,%llu,%llu,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
-
-15526 vkMemReq.alignment,
-15527 vkMemReq.memoryTypeBits,
-15528 requiresDedicatedAllocation ? 1 : 0,
-15529 prefersDedicatedAllocation ? 1 : 0,
-
-
-
-
-
-
-
-15537 userDataStr.GetString());
-
-
-
-15541 void VmaRecorder::RecordAllocateMemoryForImage(uint32_t frameIndex,
-15542 const VkMemoryRequirements& vkMemReq,
-15543 bool requiresDedicatedAllocation,
-15544 bool prefersDedicatedAllocation,
-
-
-
-15548 CallParams callParams;
-15549 GetBasicParams(callParams);
-
-15551 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15552 UserDataString userDataStr(createInfo.
flags, createInfo.
pUserData);
-15553 fprintf(m_File,
"%u,%.3f,%u,vmaAllocateMemoryForImage,%llu,%llu,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
-
-15555 vkMemReq.alignment,
-15556 vkMemReq.memoryTypeBits,
-15557 requiresDedicatedAllocation ? 1 : 0,
-15558 prefersDedicatedAllocation ? 1 : 0,
-
-
-
-
-
-
-
-15566 userDataStr.GetString());
-
-
-
-15570 void VmaRecorder::RecordFreeMemory(uint32_t frameIndex,
-
-
-15573 CallParams callParams;
-15574 GetBasicParams(callParams);
-
-15576 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15577 fprintf(m_File,
"%u,%.3f,%u,vmaFreeMemory,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
-
-15582 void VmaRecorder::RecordFreeMemoryPages(uint32_t frameIndex,
-15583 uint64_t allocationCount,
-
-
-15586 CallParams callParams;
-15587 GetBasicParams(callParams);
-
-15589 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15590 fprintf(m_File,
"%u,%.3f,%u,vmaFreeMemoryPages,", callParams.threadId, callParams.time, frameIndex);
-15591 PrintPointerList(allocationCount, pAllocations);
-15592 fprintf(m_File,
"\n");
-
-
-
-15596 void VmaRecorder::RecordSetAllocationUserData(uint32_t frameIndex,
-
-15598 const void* pUserData)
-
-15600 CallParams callParams;
-15601 GetBasicParams(callParams);
-
-15603 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15604 UserDataString userDataStr(
-
-
-15607 fprintf(m_File,
"%u,%.3f,%u,vmaSetAllocationUserData,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
-
-15609 userDataStr.GetString());
-
-
-
-15613 void VmaRecorder::RecordCreateLostAllocation(uint32_t frameIndex,
-
-
-15616 CallParams callParams;
-15617 GetBasicParams(callParams);
-
-15619 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15620 fprintf(m_File,
"%u,%.3f,%u,vmaCreateLostAllocation,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
-
-15625 void VmaRecorder::RecordMapMemory(uint32_t frameIndex,
-
-
-15628 CallParams callParams;
-15629 GetBasicParams(callParams);
+15425 if(m_File != VMA_NULL)
+
+
+
+
+
+15431 void VmaRecorder::RecordCreateAllocator(uint32_t frameIndex)
+
+15433 CallParams callParams;
+15434 GetBasicParams(callParams);
+
+15436 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15437 fprintf(m_File,
"%u,%.3f,%u,vmaCreateAllocator\n", callParams.threadId, callParams.time, frameIndex);
+
+
+
+15441 void VmaRecorder::RecordDestroyAllocator(uint32_t frameIndex)
+
+15443 CallParams callParams;
+15444 GetBasicParams(callParams);
+
+15446 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15447 fprintf(m_File,
"%u,%.3f,%u,vmaDestroyAllocator\n", callParams.threadId, callParams.time, frameIndex);
+
+
+
+
+
+15453 CallParams callParams;
+15454 GetBasicParams(callParams);
+
+15456 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15457 fprintf(m_File,
"%u,%.3f,%u,vmaCreatePool,%u,%u,%llu,%llu,%llu,%u,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
+
+
+
+
+
+
+
+15468 void VmaRecorder::RecordDestroyPool(uint32_t frameIndex,
VmaPool pool)
+
+15470 CallParams callParams;
+15471 GetBasicParams(callParams);
+
+15473 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15474 fprintf(m_File,
"%u,%.3f,%u,vmaDestroyPool,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
+
+15479 void VmaRecorder::RecordAllocateMemory(uint32_t frameIndex,
+15480 const VkMemoryRequirements& vkMemReq,
+
+
+
+15484 CallParams callParams;
+15485 GetBasicParams(callParams);
+
+15487 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15488 UserDataString userDataStr(createInfo.
flags, createInfo.
pUserData);
+15489 fprintf(m_File,
"%u,%.3f,%u,vmaAllocateMemory,%llu,%llu,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+
+15491 vkMemReq.alignment,
+15492 vkMemReq.memoryTypeBits,
+
+
+
+
+
+
+
+15500 userDataStr.GetString());
+
+
+
+15504 void VmaRecorder::RecordAllocateMemoryPages(uint32_t frameIndex,
+15505 const VkMemoryRequirements& vkMemReq,
+
+15507 uint64_t allocationCount,
+
+
+15510 CallParams callParams;
+15511 GetBasicParams(callParams);
+
+15513 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15514 UserDataString userDataStr(createInfo.
flags, createInfo.
pUserData);
+15515 fprintf(m_File,
"%u,%.3f,%u,vmaAllocateMemoryPages,%llu,%llu,%u,%u,%u,%u,%u,%u,%p,", callParams.threadId, callParams.time, frameIndex,
+
+15517 vkMemReq.alignment,
+15518 vkMemReq.memoryTypeBits,
+
+
+
+
+
+
+15525 PrintPointerList(allocationCount, pAllocations);
+15526 fprintf(m_File,
",%s\n", userDataStr.GetString());
+
+
+
+15530 void VmaRecorder::RecordAllocateMemoryForBuffer(uint32_t frameIndex,
+15531 const VkMemoryRequirements& vkMemReq,
+15532 bool requiresDedicatedAllocation,
+15533 bool prefersDedicatedAllocation,
+
+
+
+15537 CallParams callParams;
+15538 GetBasicParams(callParams);
+
+15540 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15541 UserDataString userDataStr(createInfo.
flags, createInfo.
pUserData);
+15542 fprintf(m_File,
"%u,%.3f,%u,vmaAllocateMemoryForBuffer,%llu,%llu,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+
+15544 vkMemReq.alignment,
+15545 vkMemReq.memoryTypeBits,
+15546 requiresDedicatedAllocation ? 1 : 0,
+15547 prefersDedicatedAllocation ? 1 : 0,
+
+
+
+
+
+
+
+15555 userDataStr.GetString());
+
+
+
+15559 void VmaRecorder::RecordAllocateMemoryForImage(uint32_t frameIndex,
+15560 const VkMemoryRequirements& vkMemReq,
+15561 bool requiresDedicatedAllocation,
+15562 bool prefersDedicatedAllocation,
+
+
+
+15566 CallParams callParams;
+15567 GetBasicParams(callParams);
+
+15569 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15570 UserDataString userDataStr(createInfo.
flags, createInfo.
pUserData);
+15571 fprintf(m_File,
"%u,%.3f,%u,vmaAllocateMemoryForImage,%llu,%llu,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+
+15573 vkMemReq.alignment,
+15574 vkMemReq.memoryTypeBits,
+15575 requiresDedicatedAllocation ? 1 : 0,
+15576 prefersDedicatedAllocation ? 1 : 0,
+
+
+
+
+
+
+
+15584 userDataStr.GetString());
+
+
+
+15588 void VmaRecorder::RecordFreeMemory(uint32_t frameIndex,
+
+
+15591 CallParams callParams;
+15592 GetBasicParams(callParams);
+
+15594 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15595 fprintf(m_File,
"%u,%.3f,%u,vmaFreeMemory,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
+
+15600 void VmaRecorder::RecordFreeMemoryPages(uint32_t frameIndex,
+15601 uint64_t allocationCount,
+
+
+15604 CallParams callParams;
+15605 GetBasicParams(callParams);
+
+15607 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15608 fprintf(m_File,
"%u,%.3f,%u,vmaFreeMemoryPages,", callParams.threadId, callParams.time, frameIndex);
+15609 PrintPointerList(allocationCount, pAllocations);
+15610 fprintf(m_File,
"\n");
+
+
+
+15614 void VmaRecorder::RecordSetAllocationUserData(uint32_t frameIndex,
+
+15616 const void* pUserData)
+
+15618 CallParams callParams;
+15619 GetBasicParams(callParams);
+
+15621 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15622 UserDataString userDataStr(
+
+
+15625 fprintf(m_File,
"%u,%.3f,%u,vmaSetAllocationUserData,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+
+15627 userDataStr.GetString());
+
+
-15631 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15632 fprintf(m_File,
"%u,%.3f,%u,vmaMapMemory,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
+15631 void VmaRecorder::RecordCreateLostAllocation(uint32_t frameIndex,
+
+
+15634 CallParams callParams;
+15635 GetBasicParams(callParams);
-15637 void VmaRecorder::RecordUnmapMemory(uint32_t frameIndex,
-
-
-15640 CallParams callParams;
-15641 GetBasicParams(callParams);
+15637 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15638 fprintf(m_File,
"%u,%.3f,%u,vmaCreateLostAllocation,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
-15643 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15644 fprintf(m_File,
"%u,%.3f,%u,vmaUnmapMemory,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
+15643 void VmaRecorder::RecordMapMemory(uint32_t frameIndex,
+
+
+15646 CallParams callParams;
+15647 GetBasicParams(callParams);
-15649 void VmaRecorder::RecordFlushAllocation(uint32_t frameIndex,
-15650 VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
-
-15652 CallParams callParams;
-15653 GetBasicParams(callParams);
+15649 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15650 fprintf(m_File,
"%u,%.3f,%u,vmaMapMemory,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
-15655 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15656 fprintf(m_File,
"%u,%.3f,%u,vmaFlushAllocation,%p,%llu,%llu\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
-
-
-
-15663 void VmaRecorder::RecordInvalidateAllocation(uint32_t frameIndex,
-15664 VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
-
-15666 CallParams callParams;
-15667 GetBasicParams(callParams);
-
-15669 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15670 fprintf(m_File,
"%u,%.3f,%u,vmaInvalidateAllocation,%p,%llu,%llu\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
-
-
-
-15677 void VmaRecorder::RecordCreateBuffer(uint32_t frameIndex,
-15678 const VkBufferCreateInfo& bufCreateInfo,
-
-
-
-15682 CallParams callParams;
-15683 GetBasicParams(callParams);
-
-15685 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15686 UserDataString userDataStr(allocCreateInfo.
flags, allocCreateInfo.
pUserData);
-15687 fprintf(m_File,
"%u,%.3f,%u,vmaCreateBuffer,%u,%llu,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
-15688 bufCreateInfo.flags,
-15689 bufCreateInfo.size,
-15690 bufCreateInfo.usage,
-15691 bufCreateInfo.sharingMode,
-15692 allocCreateInfo.
flags,
-15693 allocCreateInfo.
usage,
-
-
-
-15697 allocCreateInfo.
pool,
-
-15699 userDataStr.GetString());
-
-
+15655 void VmaRecorder::RecordUnmapMemory(uint32_t frameIndex,
+
+
+15658 CallParams callParams;
+15659 GetBasicParams(callParams);
+
+15661 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15662 fprintf(m_File,
"%u,%.3f,%u,vmaUnmapMemory,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
+
+15667 void VmaRecorder::RecordFlushAllocation(uint32_t frameIndex,
+15668 VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
+
+15670 CallParams callParams;
+15671 GetBasicParams(callParams);
+
+15673 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15674 fprintf(m_File,
"%u,%.3f,%u,vmaFlushAllocation,%p,%llu,%llu\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
+
+
+
+15681 void VmaRecorder::RecordInvalidateAllocation(uint32_t frameIndex,
+15682 VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
+
+15684 CallParams callParams;
+15685 GetBasicParams(callParams);
+
+15687 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15688 fprintf(m_File,
"%u,%.3f,%u,vmaInvalidateAllocation,%p,%llu,%llu\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
+
+
+
+15695 void VmaRecorder::RecordCreateBuffer(uint32_t frameIndex,
+15696 const VkBufferCreateInfo& bufCreateInfo,
+
+
+
+15700 CallParams callParams;
+15701 GetBasicParams(callParams);
-15703 void VmaRecorder::RecordCreateImage(uint32_t frameIndex,
-15704 const VkImageCreateInfo& imageCreateInfo,
-
-
-
-15708 CallParams callParams;
-15709 GetBasicParams(callParams);
-
-15711 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15712 UserDataString userDataStr(allocCreateInfo.
flags, allocCreateInfo.
pUserData);
-15713 fprintf(m_File,
"%u,%.3f,%u,vmaCreateImage,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
-15714 imageCreateInfo.flags,
-15715 imageCreateInfo.imageType,
-15716 imageCreateInfo.format,
-15717 imageCreateInfo.extent.width,
-15718 imageCreateInfo.extent.height,
-15719 imageCreateInfo.extent.depth,
-15720 imageCreateInfo.mipLevels,
-15721 imageCreateInfo.arrayLayers,
-15722 imageCreateInfo.samples,
-15723 imageCreateInfo.tiling,
-15724 imageCreateInfo.usage,
-15725 imageCreateInfo.sharingMode,
-15726 imageCreateInfo.initialLayout,
-15727 allocCreateInfo.
flags,
-15728 allocCreateInfo.
usage,
-
-
-
-15732 allocCreateInfo.
pool,
-
-15734 userDataStr.GetString());
-
-
-
-15738 void VmaRecorder::RecordDestroyBuffer(uint32_t frameIndex,
-
-
-15741 CallParams callParams;
-15742 GetBasicParams(callParams);
-
-15744 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15745 fprintf(m_File,
"%u,%.3f,%u,vmaDestroyBuffer,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
-
-15750 void VmaRecorder::RecordDestroyImage(uint32_t frameIndex,
-
-
-15753 CallParams callParams;
-15754 GetBasicParams(callParams);
+15703 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15704 UserDataString userDataStr(allocCreateInfo.
flags, allocCreateInfo.
pUserData);
+15705 fprintf(m_File,
"%u,%.3f,%u,vmaCreateBuffer,%u,%llu,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+15706 bufCreateInfo.flags,
+15707 bufCreateInfo.size,
+15708 bufCreateInfo.usage,
+15709 bufCreateInfo.sharingMode,
+15710 allocCreateInfo.
flags,
+15711 allocCreateInfo.
usage,
+
+
+
+15715 allocCreateInfo.
pool,
+
+15717 userDataStr.GetString());
+
+
+
+15721 void VmaRecorder::RecordCreateImage(uint32_t frameIndex,
+15722 const VkImageCreateInfo& imageCreateInfo,
+
+
+
+15726 CallParams callParams;
+15727 GetBasicParams(callParams);
+
+15729 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15730 UserDataString userDataStr(allocCreateInfo.
flags, allocCreateInfo.
pUserData);
+15731 fprintf(m_File,
"%u,%.3f,%u,vmaCreateImage,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+15732 imageCreateInfo.flags,
+15733 imageCreateInfo.imageType,
+15734 imageCreateInfo.format,
+15735 imageCreateInfo.extent.width,
+15736 imageCreateInfo.extent.height,
+15737 imageCreateInfo.extent.depth,
+15738 imageCreateInfo.mipLevels,
+15739 imageCreateInfo.arrayLayers,
+15740 imageCreateInfo.samples,
+15741 imageCreateInfo.tiling,
+15742 imageCreateInfo.usage,
+15743 imageCreateInfo.sharingMode,
+15744 imageCreateInfo.initialLayout,
+15745 allocCreateInfo.
flags,
+15746 allocCreateInfo.
usage,
+
+
+
+15750 allocCreateInfo.
pool,
+
+15752 userDataStr.GetString());
+
+
-15756 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15757 fprintf(m_File,
"%u,%.3f,%u,vmaDestroyImage,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
+15756 void VmaRecorder::RecordDestroyBuffer(uint32_t frameIndex,
+
+
+15759 CallParams callParams;
+15760 GetBasicParams(callParams);
-15762 void VmaRecorder::RecordTouchAllocation(uint32_t frameIndex,
-
-
-15765 CallParams callParams;
-15766 GetBasicParams(callParams);
+15762 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15763 fprintf(m_File,
"%u,%.3f,%u,vmaDestroyBuffer,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
-15768 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15769 fprintf(m_File,
"%u,%.3f,%u,vmaTouchAllocation,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
+15768 void VmaRecorder::RecordDestroyImage(uint32_t frameIndex,
+
+
+15771 CallParams callParams;
+15772 GetBasicParams(callParams);
-15774 void VmaRecorder::RecordGetAllocationInfo(uint32_t frameIndex,
-
-
-15777 CallParams callParams;
-15778 GetBasicParams(callParams);
+15774 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15775 fprintf(m_File,
"%u,%.3f,%u,vmaDestroyImage,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
-15780 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15781 fprintf(m_File,
"%u,%.3f,%u,vmaGetAllocationInfo,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
+15780 void VmaRecorder::RecordTouchAllocation(uint32_t frameIndex,
+
+
+15783 CallParams callParams;
+15784 GetBasicParams(callParams);
-15786 void VmaRecorder::RecordMakePoolAllocationsLost(uint32_t frameIndex,
-
-
-15789 CallParams callParams;
-15790 GetBasicParams(callParams);
+15786 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15787 fprintf(m_File,
"%u,%.3f,%u,vmaTouchAllocation,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
-15792 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15793 fprintf(m_File,
"%u,%.3f,%u,vmaMakePoolAllocationsLost,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
+15792 void VmaRecorder::RecordGetAllocationInfo(uint32_t frameIndex,
+
+
+15795 CallParams callParams;
+15796 GetBasicParams(callParams);
-15798 void VmaRecorder::RecordDefragmentationBegin(uint32_t frameIndex,
-
-
-
-15802 CallParams callParams;
-15803 GetBasicParams(callParams);
-
-15805 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15806 fprintf(m_File,
"%u,%.3f,%u,vmaDefragmentationBegin,%u,", callParams.threadId, callParams.time, frameIndex,
-
-
-15809 fprintf(m_File,
",");
-
-15811 fprintf(m_File,
",%llu,%u,%llu,%u,%p,%p\n",
-
-
-
-
-
-
-
-
-
-15821 void VmaRecorder::RecordDefragmentationEnd(uint32_t frameIndex,
-
-
-15824 CallParams callParams;
-15825 GetBasicParams(callParams);
-
-15827 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15828 fprintf(m_File,
"%u,%.3f,%u,vmaDefragmentationEnd,%p\n", callParams.threadId, callParams.time, frameIndex,
-
-
-
-
-15833 void VmaRecorder::RecordSetPoolName(uint32_t frameIndex,
-
-
-
-15837 CallParams callParams;
-15838 GetBasicParams(callParams);
-
-15840 VmaMutexLock lock(m_FileMutex, m_UseMutex);
-15841 fprintf(m_File,
"%u,%.3f,%u,vmaSetPoolName,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
-15842 pool, name != VMA_NULL ? name :
"");
-
-
-
-
-
-15848 if(pUserData != VMA_NULL)
-
-
-
-15852 m_Str = (
const char*)pUserData;
-
-
-
-
-15857 snprintf(m_PtrStr, 17,
"%p", pUserData);
-
-
-
-
-
-
-
-
-
-15867 void VmaRecorder::WriteConfiguration(
-15868 const VkPhysicalDeviceProperties& devProps,
-15869 const VkPhysicalDeviceMemoryProperties& memProps,
-15870 uint32_t vulkanApiVersion,
-15871 bool dedicatedAllocationExtensionEnabled,
-15872 bool bindMemory2ExtensionEnabled,
-15873 bool memoryBudgetExtensionEnabled,
-15874 bool deviceCoherentMemoryExtensionEnabled)
-
-15876 fprintf(m_File,
"Config,Begin\n");
-
-15878 fprintf(m_File,
"VulkanApiVersion,%u,%u\n", VK_VERSION_MAJOR(vulkanApiVersion), VK_VERSION_MINOR(vulkanApiVersion));
-
-15880 fprintf(m_File,
"PhysicalDevice,apiVersion,%u\n", devProps.apiVersion);
-15881 fprintf(m_File,
"PhysicalDevice,driverVersion,%u\n", devProps.driverVersion);
-15882 fprintf(m_File,
"PhysicalDevice,vendorID,%u\n", devProps.vendorID);
-15883 fprintf(m_File,
"PhysicalDevice,deviceID,%u\n", devProps.deviceID);
-15884 fprintf(m_File,
"PhysicalDevice,deviceType,%u\n", devProps.deviceType);
-15885 fprintf(m_File,
"PhysicalDevice,deviceName,%s\n", devProps.deviceName);
-
-15887 fprintf(m_File,
"PhysicalDeviceLimits,maxMemoryAllocationCount,%u\n", devProps.limits.maxMemoryAllocationCount);
-15888 fprintf(m_File,
"PhysicalDeviceLimits,bufferImageGranularity,%llu\n", devProps.limits.bufferImageGranularity);
-15889 fprintf(m_File,
"PhysicalDeviceLimits,nonCoherentAtomSize,%llu\n", devProps.limits.nonCoherentAtomSize);
-
-15891 fprintf(m_File,
"PhysicalDeviceMemory,HeapCount,%u\n", memProps.memoryHeapCount);
-15892 for(uint32_t i = 0; i < memProps.memoryHeapCount; ++i)
-
-15894 fprintf(m_File,
"PhysicalDeviceMemory,Heap,%u,size,%llu\n", i, memProps.memoryHeaps[i].size);
-15895 fprintf(m_File,
"PhysicalDeviceMemory,Heap,%u,flags,%u\n", i, memProps.memoryHeaps[i].flags);
-
-15897 fprintf(m_File,
"PhysicalDeviceMemory,TypeCount,%u\n", memProps.memoryTypeCount);
-15898 for(uint32_t i = 0; i < memProps.memoryTypeCount; ++i)
-
-15900 fprintf(m_File,
"PhysicalDeviceMemory,Type,%u,heapIndex,%u\n", i, memProps.memoryTypes[i].heapIndex);
-15901 fprintf(m_File,
"PhysicalDeviceMemory,Type,%u,propertyFlags,%u\n", i, memProps.memoryTypes[i].propertyFlags);
-
-
-15904 fprintf(m_File,
"Extension,VK_KHR_dedicated_allocation,%u\n", dedicatedAllocationExtensionEnabled ? 1 : 0);
-15905 fprintf(m_File,
"Extension,VK_KHR_bind_memory2,%u\n", bindMemory2ExtensionEnabled ? 1 : 0);
-15906 fprintf(m_File,
"Extension,VK_EXT_memory_budget,%u\n", memoryBudgetExtensionEnabled ? 1 : 0);
-15907 fprintf(m_File,
"Extension,VK_AMD_device_coherent_memory,%u\n", deviceCoherentMemoryExtensionEnabled ? 1 : 0);
+15798 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15799 fprintf(m_File,
"%u,%.3f,%u,vmaGetAllocationInfo,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
+
+15804 void VmaRecorder::RecordMakePoolAllocationsLost(uint32_t frameIndex,
+
+
+15807 CallParams callParams;
+15808 GetBasicParams(callParams);
+
+15810 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15811 fprintf(m_File,
"%u,%.3f,%u,vmaMakePoolAllocationsLost,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
+
+15816 void VmaRecorder::RecordDefragmentationBegin(uint32_t frameIndex,
+
+
+
+15820 CallParams callParams;
+15821 GetBasicParams(callParams);
+
+15823 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15824 fprintf(m_File,
"%u,%.3f,%u,vmaDefragmentationBegin,%u,", callParams.threadId, callParams.time, frameIndex,
+
+
+15827 fprintf(m_File,
",");
+
+15829 fprintf(m_File,
",%llu,%u,%llu,%u,%p,%p\n",
+
+
+
+
+
+
+
+
+
+15839 void VmaRecorder::RecordDefragmentationEnd(uint32_t frameIndex,
+
+
+15842 CallParams callParams;
+15843 GetBasicParams(callParams);
+
+15845 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15846 fprintf(m_File,
"%u,%.3f,%u,vmaDefragmentationEnd,%p\n", callParams.threadId, callParams.time, frameIndex,
+
+
+
+
+15851 void VmaRecorder::RecordSetPoolName(uint32_t frameIndex,
+
+
+
+15855 CallParams callParams;
+15856 GetBasicParams(callParams);
+
+15858 VmaMutexLock lock(m_FileMutex, m_UseMutex);
+15859 fprintf(m_File,
"%u,%.3f,%u,vmaSetPoolName,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+15860 pool, name != VMA_NULL ? name :
"");
+
+
+
+
+
+15866 if(pUserData != VMA_NULL)
+
+
+
+15870 m_Str = (
const char*)pUserData;
+
+
+
+
+15875 snprintf(m_PtrStr, 17,
"%p", pUserData);
+
+
+
+
+
+
+
+
+
+15885 void VmaRecorder::WriteConfiguration(
+15886 const VkPhysicalDeviceProperties& devProps,
+15887 const VkPhysicalDeviceMemoryProperties& memProps,
+15888 uint32_t vulkanApiVersion,
+15889 bool dedicatedAllocationExtensionEnabled,
+15890 bool bindMemory2ExtensionEnabled,
+15891 bool memoryBudgetExtensionEnabled,
+15892 bool deviceCoherentMemoryExtensionEnabled)
+
+15894 fprintf(m_File,
"Config,Begin\n");
+
+15896 fprintf(m_File,
"VulkanApiVersion,%u,%u\n", VK_VERSION_MAJOR(vulkanApiVersion), VK_VERSION_MINOR(vulkanApiVersion));
+
+15898 fprintf(m_File,
"PhysicalDevice,apiVersion,%u\n", devProps.apiVersion);
+15899 fprintf(m_File,
"PhysicalDevice,driverVersion,%u\n", devProps.driverVersion);
+15900 fprintf(m_File,
"PhysicalDevice,vendorID,%u\n", devProps.vendorID);
+15901 fprintf(m_File,
"PhysicalDevice,deviceID,%u\n", devProps.deviceID);
+15902 fprintf(m_File,
"PhysicalDevice,deviceType,%u\n", devProps.deviceType);
+15903 fprintf(m_File,
"PhysicalDevice,deviceName,%s\n", devProps.deviceName);
+
+15905 fprintf(m_File,
"PhysicalDeviceLimits,maxMemoryAllocationCount,%u\n", devProps.limits.maxMemoryAllocationCount);
+15906 fprintf(m_File,
"PhysicalDeviceLimits,bufferImageGranularity,%llu\n", devProps.limits.bufferImageGranularity);
+15907 fprintf(m_File,
"PhysicalDeviceLimits,nonCoherentAtomSize,%llu\n", devProps.limits.nonCoherentAtomSize);
-15909 fprintf(m_File,
"Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY,%u\n", VMA_DEBUG_ALWAYS_DEDICATED_MEMORY ? 1 : 0);
-15910 fprintf(m_File,
"Macro,VMA_DEBUG_ALIGNMENT,%llu\n", (VkDeviceSize)VMA_DEBUG_ALIGNMENT);
-15911 fprintf(m_File,
"Macro,VMA_DEBUG_MARGIN,%llu\n", (VkDeviceSize)VMA_DEBUG_MARGIN);
-15912 fprintf(m_File,
"Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS,%u\n", VMA_DEBUG_INITIALIZE_ALLOCATIONS ? 1 : 0);
-15913 fprintf(m_File,
"Macro,VMA_DEBUG_DETECT_CORRUPTION,%u\n", VMA_DEBUG_DETECT_CORRUPTION ? 1 : 0);
-15914 fprintf(m_File,
"Macro,VMA_DEBUG_GLOBAL_MUTEX,%u\n", VMA_DEBUG_GLOBAL_MUTEX ? 1 : 0);
-15915 fprintf(m_File,
"Macro,VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY,%llu\n", (VkDeviceSize)VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY);
-15916 fprintf(m_File,
"Macro,VMA_SMALL_HEAP_MAX_SIZE,%llu\n", (VkDeviceSize)VMA_SMALL_HEAP_MAX_SIZE);
-15917 fprintf(m_File,
"Macro,VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE,%llu\n", (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE);
-
-15919 fprintf(m_File,
"Config,End\n");
-
+15909 fprintf(m_File,
"PhysicalDeviceMemory,HeapCount,%u\n", memProps.memoryHeapCount);
+15910 for(uint32_t i = 0; i < memProps.memoryHeapCount; ++i)
+
+15912 fprintf(m_File,
"PhysicalDeviceMemory,Heap,%u,size,%llu\n", i, memProps.memoryHeaps[i].size);
+15913 fprintf(m_File,
"PhysicalDeviceMemory,Heap,%u,flags,%u\n", i, memProps.memoryHeaps[i].flags);
+
+15915 fprintf(m_File,
"PhysicalDeviceMemory,TypeCount,%u\n", memProps.memoryTypeCount);
+15916 for(uint32_t i = 0; i < memProps.memoryTypeCount; ++i)
+
+15918 fprintf(m_File,
"PhysicalDeviceMemory,Type,%u,heapIndex,%u\n", i, memProps.memoryTypes[i].heapIndex);
+15919 fprintf(m_File,
"PhysicalDeviceMemory,Type,%u,propertyFlags,%u\n", i, memProps.memoryTypes[i].propertyFlags);
+
-15922 void VmaRecorder::GetBasicParams(CallParams& outParams)
-
-15924 #if defined(_WIN32)
-15925 outParams.threadId = GetCurrentThreadId();
-
-
-
-
-15930 std::thread::id thread_id = std::this_thread::get_id();
-15931 std::stringstream thread_id_to_string_converter;
-15932 thread_id_to_string_converter << thread_id;
-15933 std::string thread_id_as_string = thread_id_to_string_converter.str();
-15934 outParams.threadId =
static_cast<uint32_t
>(std::stoi(thread_id_as_string.c_str()));
-
+15922 fprintf(m_File,
"Extension,VK_KHR_dedicated_allocation,%u\n", dedicatedAllocationExtensionEnabled ? 1 : 0);
+15923 fprintf(m_File,
"Extension,VK_KHR_bind_memory2,%u\n", bindMemory2ExtensionEnabled ? 1 : 0);
+15924 fprintf(m_File,
"Extension,VK_EXT_memory_budget,%u\n", memoryBudgetExtensionEnabled ? 1 : 0);
+15925 fprintf(m_File,
"Extension,VK_AMD_device_coherent_memory,%u\n", deviceCoherentMemoryExtensionEnabled ? 1 : 0);
+
+15927 fprintf(m_File,
"Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY,%u\n", VMA_DEBUG_ALWAYS_DEDICATED_MEMORY ? 1 : 0);
+15928 fprintf(m_File,
"Macro,VMA_MIN_ALIGNMENT,%llu\n", (VkDeviceSize)VMA_MIN_ALIGNMENT);
+15929 fprintf(m_File,
"Macro,VMA_DEBUG_MARGIN,%llu\n", (VkDeviceSize)VMA_DEBUG_MARGIN);
+15930 fprintf(m_File,
"Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS,%u\n", VMA_DEBUG_INITIALIZE_ALLOCATIONS ? 1 : 0);
+15931 fprintf(m_File,
"Macro,VMA_DEBUG_DETECT_CORRUPTION,%u\n", VMA_DEBUG_DETECT_CORRUPTION ? 1 : 0);
+15932 fprintf(m_File,
"Macro,VMA_DEBUG_GLOBAL_MUTEX,%u\n", VMA_DEBUG_GLOBAL_MUTEX ? 1 : 0);
+15933 fprintf(m_File,
"Macro,VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY,%llu\n", (VkDeviceSize)VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY);
+15934 fprintf(m_File,
"Macro,VMA_SMALL_HEAP_MAX_SIZE,%llu\n", (VkDeviceSize)VMA_SMALL_HEAP_MAX_SIZE);
+15935 fprintf(m_File,
"Macro,VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE,%llu\n", (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE);
-15937 auto current_time = std::chrono::high_resolution_clock::now();
-
-15939 outParams.time = std::chrono::duration<double, std::chrono::seconds::period>(current_time - m_RecordingStartTime).count();
-
-
-15942 void VmaRecorder::PrintPointerList(uint64_t count,
const VmaAllocation* pItems)
-
-
-
-15946 fprintf(m_File,
"%p", pItems[0]);
-15947 for(uint64_t i = 1; i < count; ++i)
-
-15949 fprintf(m_File,
" %p", pItems[i]);
-
-
-
-
-15954 void VmaRecorder::Flush()
-
-
-
-
-
-
-
-
-
-
-
-15967 VmaAllocationObjectAllocator::VmaAllocationObjectAllocator(
const VkAllocationCallbacks* pAllocationCallbacks) :
-15968 m_Allocator(pAllocationCallbacks, 1024)
-
+15937 fprintf(m_File,
"Config,End\n");
+
+
+15940 void VmaRecorder::GetBasicParams(CallParams& outParams)
+
+15942 #if defined(_WIN32)
+15943 outParams.threadId = GetCurrentThreadId();
+
+
+
+
+15948 std::thread::id thread_id = std::this_thread::get_id();
+15949 std::stringstream thread_id_to_string_converter;
+15950 thread_id_to_string_converter << thread_id;
+15951 std::string thread_id_as_string = thread_id_to_string_converter.str();
+15952 outParams.threadId =
static_cast<uint32_t
>(std::stoi(thread_id_as_string.c_str()));
+
+
+15955 auto current_time = std::chrono::high_resolution_clock::now();
+
+15957 outParams.time = std::chrono::duration<double, std::chrono::seconds::period>(current_time - m_RecordingStartTime).count();
+
+
+15960 void VmaRecorder::PrintPointerList(uint64_t count,
const VmaAllocation* pItems)
+
+
+
+15964 fprintf(m_File,
"%p", pItems[0]);
+15965 for(uint64_t i = 1; i < count; ++i)
+
+15967 fprintf(m_File,
" %p", pItems[i]);
+
+
-15972 template<
typename... Types>
VmaAllocation VmaAllocationObjectAllocator::Allocate(Types... args)
+15972 void VmaRecorder::Flush()
-15974 VmaMutexLock mutexLock(m_Mutex);
-15975 return m_Allocator.Alloc<Types...>(std::forward<Types>(args)...);
-
-
-15978 void VmaAllocationObjectAllocator::Free(
VmaAllocation hAlloc)
-
-15980 VmaMutexLock mutexLock(m_Mutex);
-15981 m_Allocator.Free(hAlloc);
-
-
-
-
-
-
-15989 m_VulkanApiVersion(pCreateInfo->vulkanApiVersion != 0 ? pCreateInfo->vulkanApiVersion : VK_API_VERSION_1_0),
-
-
-
-
-
-
-15996 m_hDevice(pCreateInfo->device),
-15997 m_hInstance(pCreateInfo->instance),
-15998 m_AllocationCallbacksSpecified(pCreateInfo->pAllocationCallbacks != VMA_NULL),
-15999 m_AllocationCallbacks(pCreateInfo->pAllocationCallbacks ?
-16000 *pCreateInfo->pAllocationCallbacks : VmaEmptyAllocationCallbacks),
-16001 m_AllocationObjectAllocator(&m_AllocationCallbacks),
-16002 m_HeapSizeLimitMask(0),
-16003 m_DeviceMemoryCount(0),
-16004 m_PreferredLargeHeapBlockSize(0),
-16005 m_PhysicalDevice(pCreateInfo->physicalDevice),
-16006 m_CurrentFrameIndex(0),
-16007 m_GpuDefragmentationMemoryTypeBits(UINT32_MAX),
-
-16009 m_GlobalMemoryTypeBits(UINT32_MAX)
-
-16011 ,m_pRecorder(VMA_NULL)
-
-
-16014 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
-
-16016 m_UseKhrDedicatedAllocation =
false;
-16017 m_UseKhrBindMemory2 =
false;
-
-
-16020 if(VMA_DEBUG_DETECT_CORRUPTION)
-
-
-16023 VMA_ASSERT(VMA_DEBUG_MARGIN %
sizeof(uint32_t) == 0);
-
-
-
-
-16028 if(m_VulkanApiVersion < VK_MAKE_VERSION(1, 1, 0))
-
-16030 #if !(VMA_DEDICATED_ALLOCATION)
-
-
-16033 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT set but required extensions are disabled by preprocessor macros.");
-
-
-16036 #if !(VMA_BIND_MEMORY2)
-
-
-16039 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT set but required extension is disabled by preprocessor macros.");
-
-
+
+
+
+
+
+
+
+
+
+
+15985 VmaAllocationObjectAllocator::VmaAllocationObjectAllocator(
const VkAllocationCallbacks* pAllocationCallbacks) :
+15986 m_Allocator(pAllocationCallbacks, 1024)
+
+
+
+15990 template<
typename... Types>
VmaAllocation VmaAllocationObjectAllocator::Allocate(Types... args)
+
+15992 VmaMutexLock mutexLock(m_Mutex);
+15993 return m_Allocator.Alloc<Types...>(std::forward<Types>(args)...);
+
+
+15996 void VmaAllocationObjectAllocator::Free(
VmaAllocation hAlloc)
+
+15998 VmaMutexLock mutexLock(m_Mutex);
+15999 m_Allocator.Free(hAlloc);
+
+
+
+
+
+
+16007 m_VulkanApiVersion(pCreateInfo->vulkanApiVersion != 0 ? pCreateInfo->vulkanApiVersion : VK_API_VERSION_1_0),
+
+
+
+
+
+
+16014 m_hDevice(pCreateInfo->device),
+16015 m_hInstance(pCreateInfo->instance),
+16016 m_AllocationCallbacksSpecified(pCreateInfo->pAllocationCallbacks != VMA_NULL),
+16017 m_AllocationCallbacks(pCreateInfo->pAllocationCallbacks ?
+16018 *pCreateInfo->pAllocationCallbacks : VmaEmptyAllocationCallbacks),
+16019 m_AllocationObjectAllocator(&m_AllocationCallbacks),
+16020 m_HeapSizeLimitMask(0),
+16021 m_DeviceMemoryCount(0),
+16022 m_PreferredLargeHeapBlockSize(0),
+16023 m_PhysicalDevice(pCreateInfo->physicalDevice),
+16024 m_CurrentFrameIndex(0),
+16025 m_GpuDefragmentationMemoryTypeBits(UINT32_MAX),
+
+16027 m_GlobalMemoryTypeBits(UINT32_MAX)
+
+16029 ,m_pRecorder(VMA_NULL)
+
+
+16032 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
+
+16034 m_UseKhrDedicatedAllocation =
false;
+16035 m_UseKhrBindMemory2 =
false;
+
+
+16038 if(VMA_DEBUG_DETECT_CORRUPTION)
+
+
+16041 VMA_ASSERT(VMA_DEBUG_MARGIN %
sizeof(uint32_t) == 0);
-16043 #if !(VMA_MEMORY_BUDGET)
-
-
-16046 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT set but required extension is disabled by preprocessor macros.");
-
-
-16049 #if !(VMA_BUFFER_DEVICE_ADDRESS)
-16050 if(m_UseKhrBufferDeviceAddress)
-
-16052 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT is set but required extension or Vulkan 1.2 is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
-
-
-16055 #if VMA_VULKAN_VERSION < 1002000
-16056 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 2, 0))
-
-16058 VMA_ASSERT(0 &&
"vulkanApiVersion >= VK_API_VERSION_1_2 but required Vulkan version is disabled by preprocessor macros.");
-
-
-16061 #if VMA_VULKAN_VERSION < 1001000
-16062 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
+
+
+
+16046 if(m_VulkanApiVersion < VK_MAKE_VERSION(1, 1, 0))
+
+16048 #if !(VMA_DEDICATED_ALLOCATION)
+
+
+16051 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT set but required extensions are disabled by preprocessor macros.");
+
+
+16054 #if !(VMA_BIND_MEMORY2)
+
+
+16057 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT set but required extension is disabled by preprocessor macros.");
+
+
+
+16061 #if !(VMA_MEMORY_BUDGET)
+
-16064 VMA_ASSERT(0 &&
"vulkanApiVersion >= VK_API_VERSION_1_1 but required Vulkan version is disabled by preprocessor macros.");
+16064 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT set but required extension is disabled by preprocessor macros.");
-16067 #if !(VMA_MEMORY_PRIORITY)
-16068 if(m_UseExtMemoryPriority)
+16067 #if !(VMA_BUFFER_DEVICE_ADDRESS)
+16068 if(m_UseKhrBufferDeviceAddress)
-16070 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT is set but required extension is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
+16070 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT is set but required extension or Vulkan 1.2 is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
-
-16074 memset(&m_DeviceMemoryCallbacks, 0 ,
sizeof(m_DeviceMemoryCallbacks));
-16075 memset(&m_PhysicalDeviceProperties, 0,
sizeof(m_PhysicalDeviceProperties));
-16076 memset(&m_MemProps, 0,
sizeof(m_MemProps));
-
-16078 memset(&m_pBlockVectors, 0,
sizeof(m_pBlockVectors));
-16079 memset(&m_VulkanFunctions, 0,
sizeof(m_VulkanFunctions));
-
-
-
-
-
-
-
-
-
-
-16090 (*m_VulkanFunctions.vkGetPhysicalDeviceProperties)(m_PhysicalDevice, &m_PhysicalDeviceProperties);
-16091 (*m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties)(m_PhysicalDevice, &m_MemProps);
-
-16093 VMA_ASSERT(VmaIsPow2(VMA_DEBUG_ALIGNMENT));
-16094 VMA_ASSERT(VmaIsPow2(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY));
-16095 VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.bufferImageGranularity));
-16096 VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.nonCoherentAtomSize));
-
-
-
-
-16101 m_GlobalMemoryTypeBits = CalculateGlobalMemoryTypeBits();
-
-
-
-16105 for(uint32_t heapIndex = 0; heapIndex < GetMemoryHeapCount(); ++heapIndex)
-
-16107 const VkDeviceSize limit = pCreateInfo->
pHeapSizeLimit[heapIndex];
-16108 if(limit != VK_WHOLE_SIZE)
-
-16110 m_HeapSizeLimitMask |= 1u << heapIndex;
-16111 if(limit < m_MemProps.memoryHeaps[heapIndex].size)
-
-16113 m_MemProps.memoryHeaps[heapIndex].size = limit;
-
-
-
-
+16073 #if VMA_VULKAN_VERSION < 1002000
+16074 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 2, 0))
+
+16076 VMA_ASSERT(0 &&
"vulkanApiVersion >= VK_API_VERSION_1_2 but required Vulkan version is disabled by preprocessor macros.");
+
+
+16079 #if VMA_VULKAN_VERSION < 1001000
+16080 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
+
+16082 VMA_ASSERT(0 &&
"vulkanApiVersion >= VK_API_VERSION_1_1 but required Vulkan version is disabled by preprocessor macros.");
+
+
+16085 #if !(VMA_MEMORY_PRIORITY)
+16086 if(m_UseExtMemoryPriority)
+
+16088 VMA_ASSERT(0 &&
"VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT is set but required extension is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro.");
+
+
+
+16092 memset(&m_DeviceMemoryCallbacks, 0 ,
sizeof(m_DeviceMemoryCallbacks));
+16093 memset(&m_PhysicalDeviceProperties, 0,
sizeof(m_PhysicalDeviceProperties));
+16094 memset(&m_MemProps, 0,
sizeof(m_MemProps));
+
+16096 memset(&m_pBlockVectors, 0,
sizeof(m_pBlockVectors));
+16097 memset(&m_VulkanFunctions, 0,
sizeof(m_VulkanFunctions));
+
+
+
+
+
+
+
+
+
+
+16108 (*m_VulkanFunctions.vkGetPhysicalDeviceProperties)(m_PhysicalDevice, &m_PhysicalDeviceProperties);
+16109 (*m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties)(m_PhysicalDevice, &m_MemProps);
+
+16111 VMA_ASSERT(VmaIsPow2(VMA_MIN_ALIGNMENT));
+16112 VMA_ASSERT(VmaIsPow2(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY));
+16113 VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.bufferImageGranularity));
+16114 VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.nonCoherentAtomSize));
+
+
+
-16119 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
-
-16121 const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(memTypeIndex);
-
-16123 m_pBlockVectors[memTypeIndex] = vma_new(
this, VmaBlockVector)(
-
-
-
-16127 preferredBlockSize,
-
-
-16130 GetBufferImageGranularity(),
-
-
-
-
-
-
-
-
-
-
-
-16142 VkResult res = VK_SUCCESS;
-
-
-
-
-16147 #if VMA_RECORDING_ENABLED
-16148 m_pRecorder = vma_new(
this, VmaRecorder)();
-
-16150 if(res != VK_SUCCESS)
-
-
-
-16154 m_pRecorder->WriteConfiguration(
-16155 m_PhysicalDeviceProperties,
-
-16157 m_VulkanApiVersion,
-16158 m_UseKhrDedicatedAllocation,
-16159 m_UseKhrBindMemory2,
-16160 m_UseExtMemoryBudget,
-16161 m_UseAmdDeviceCoherentMemory);
-16162 m_pRecorder->RecordCreateAllocator(GetCurrentFrameIndex());
-
-16164 VMA_ASSERT(0 &&
"VmaAllocatorCreateInfo::pRecordSettings used, but not supported due to VMA_RECORDING_ENABLED not defined to 1.");
-16165 return VK_ERROR_FEATURE_NOT_PRESENT;
-
-
-
-16169 #if VMA_MEMORY_BUDGET
-16170 if(m_UseExtMemoryBudget)
-
-16172 UpdateVulkanBudget();
-
-
-
-
-
-
-16179 VmaAllocator_T::~VmaAllocator_T()
-
-16181 #if VMA_RECORDING_ENABLED
-16182 if(m_pRecorder != VMA_NULL)
-
-16184 m_pRecorder->RecordDestroyAllocator(GetCurrentFrameIndex());
-16185 vma_delete(
this, m_pRecorder);
+16119 m_GlobalMemoryTypeBits = CalculateGlobalMemoryTypeBits();
+
+
+
+16123 for(uint32_t heapIndex = 0; heapIndex < GetMemoryHeapCount(); ++heapIndex)
+
+16125 const VkDeviceSize limit = pCreateInfo->
pHeapSizeLimit[heapIndex];
+16126 if(limit != VK_WHOLE_SIZE)
+
+16128 m_HeapSizeLimitMask |= 1u << heapIndex;
+16129 if(limit < m_MemProps.memoryHeaps[heapIndex].size)
+
+16131 m_MemProps.memoryHeaps[heapIndex].size = limit;
+
+
+
+
+
+16137 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+
+16139 const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(memTypeIndex);
+
+16141 m_pBlockVectors[memTypeIndex] = vma_new(
this, VmaBlockVector)(
+
+
+
+16145 preferredBlockSize,
+
+
+16148 GetBufferImageGranularity(),
+
+
+
+
+16153 GetMemoryTypeMinAlignment(memTypeIndex));
+
+
+
+
+
+
+
+16161 VkResult res = VK_SUCCESS;
+
+
+
+
+16166 #if VMA_RECORDING_ENABLED
+16167 m_pRecorder = vma_new(
this, VmaRecorder)();
+
+16169 if(res != VK_SUCCESS)
+
+
+
+16173 m_pRecorder->WriteConfiguration(
+16174 m_PhysicalDeviceProperties,
+
+16176 m_VulkanApiVersion,
+16177 m_UseKhrDedicatedAllocation,
+16178 m_UseKhrBindMemory2,
+16179 m_UseExtMemoryBudget,
+16180 m_UseAmdDeviceCoherentMemory);
+16181 m_pRecorder->RecordCreateAllocator(GetCurrentFrameIndex());
+
+16183 VMA_ASSERT(0 &&
"VmaAllocatorCreateInfo::pRecordSettings used, but not supported due to VMA_RECORDING_ENABLED not defined to 1.");
+16184 return VK_ERROR_FEATURE_NOT_PRESENT;
+
-
-
-16189 VMA_ASSERT(m_Pools.IsEmpty());
-
-16191 for(
size_t memTypeIndex = GetMemoryTypeCount(); memTypeIndex--; )
-
-16193 if(!m_DedicatedAllocations[memTypeIndex].IsEmpty())
-
-16195 VMA_ASSERT(0 &&
"Unfreed dedicated allocations found.");
-
+
+16188 #if VMA_MEMORY_BUDGET
+16189 if(m_UseExtMemoryBudget)
+
+16191 UpdateVulkanBudget();
+
+
+
+
+
-16198 vma_delete(
this, m_pBlockVectors[memTypeIndex]);
-
-
-
-16202 void VmaAllocator_T::ImportVulkanFunctions(
const VmaVulkanFunctions* pVulkanFunctions)
-
-16204 #if VMA_STATIC_VULKAN_FUNCTIONS == 1
-16205 ImportVulkanFunctions_Static();
+16198 VmaAllocator_T::~VmaAllocator_T()
+
+16200 #if VMA_RECORDING_ENABLED
+16201 if(m_pRecorder != VMA_NULL)
+
+16203 m_pRecorder->RecordDestroyAllocator(GetCurrentFrameIndex());
+16204 vma_delete(
this, m_pRecorder);
+
-16208 if(pVulkanFunctions != VMA_NULL)
-
-16210 ImportVulkanFunctions_Custom(pVulkanFunctions);
-
-
-16213 #if VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
-16214 ImportVulkanFunctions_Dynamic();
-
+16208 VMA_ASSERT(m_Pools.IsEmpty());
+
+16210 for(
size_t memTypeIndex = GetMemoryTypeCount(); memTypeIndex--; )
+
+16212 if(!m_DedicatedAllocations[memTypeIndex].IsEmpty())
+
+16214 VMA_ASSERT(0 &&
"Unfreed dedicated allocations found.");
+
-16217 ValidateVulkanFunctions();
-
-
-16220 #if VMA_STATIC_VULKAN_FUNCTIONS == 1
-
-16222 void VmaAllocator_T::ImportVulkanFunctions_Static()
-
-
-16225 m_VulkanFunctions.vkGetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)vkGetPhysicalDeviceProperties;
-16226 m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties)vkGetPhysicalDeviceMemoryProperties;
-16227 m_VulkanFunctions.vkAllocateMemory = (PFN_vkAllocateMemory)vkAllocateMemory;
-16228 m_VulkanFunctions.vkFreeMemory = (PFN_vkFreeMemory)vkFreeMemory;
-16229 m_VulkanFunctions.vkMapMemory = (PFN_vkMapMemory)vkMapMemory;
-16230 m_VulkanFunctions.vkUnmapMemory = (PFN_vkUnmapMemory)vkUnmapMemory;
-16231 m_VulkanFunctions.vkFlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges)vkFlushMappedMemoryRanges;
-16232 m_VulkanFunctions.vkInvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges)vkInvalidateMappedMemoryRanges;
-16233 m_VulkanFunctions.vkBindBufferMemory = (PFN_vkBindBufferMemory)vkBindBufferMemory;
-16234 m_VulkanFunctions.vkBindImageMemory = (PFN_vkBindImageMemory)vkBindImageMemory;
-16235 m_VulkanFunctions.vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)vkGetBufferMemoryRequirements;
-16236 m_VulkanFunctions.vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)vkGetImageMemoryRequirements;
-16237 m_VulkanFunctions.vkCreateBuffer = (PFN_vkCreateBuffer)vkCreateBuffer;
-16238 m_VulkanFunctions.vkDestroyBuffer = (PFN_vkDestroyBuffer)vkDestroyBuffer;
-16239 m_VulkanFunctions.vkCreateImage = (PFN_vkCreateImage)vkCreateImage;
-16240 m_VulkanFunctions.vkDestroyImage = (PFN_vkDestroyImage)vkDestroyImage;
-16241 m_VulkanFunctions.vkCmdCopyBuffer = (PFN_vkCmdCopyBuffer)vkCmdCopyBuffer;
-
-
-16244 #if VMA_VULKAN_VERSION >= 1001000
-16245 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
-
-16247 m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2)vkGetBufferMemoryRequirements2;
-16248 m_VulkanFunctions.vkGetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2)vkGetImageMemoryRequirements2;
-16249 m_VulkanFunctions.vkBindBufferMemory2KHR = (PFN_vkBindBufferMemory2)vkBindBufferMemory2;
-16250 m_VulkanFunctions.vkBindImageMemory2KHR = (PFN_vkBindImageMemory2)vkBindImageMemory2;
-16251 m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties2KHR = (PFN_vkGetPhysicalDeviceMemoryProperties2)vkGetPhysicalDeviceMemoryProperties2;
-
-
-
-
-
-
-16258 void VmaAllocator_T::ImportVulkanFunctions_Custom(
const VmaVulkanFunctions* pVulkanFunctions)
-
-16260 VMA_ASSERT(pVulkanFunctions != VMA_NULL);
+16217 vma_delete(
this, m_pBlockVectors[memTypeIndex]);
+
+
+
+16221 void VmaAllocator_T::ImportVulkanFunctions(
const VmaVulkanFunctions* pVulkanFunctions)
+
+16223 #if VMA_STATIC_VULKAN_FUNCTIONS == 1
+16224 ImportVulkanFunctions_Static();
+
+
+16227 if(pVulkanFunctions != VMA_NULL)
+
+16229 ImportVulkanFunctions_Custom(pVulkanFunctions);
+
+
+16232 #if VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
+16233 ImportVulkanFunctions_Dynamic();
+
+
+16236 ValidateVulkanFunctions();
+
+
+16239 #if VMA_STATIC_VULKAN_FUNCTIONS == 1
+
+16241 void VmaAllocator_T::ImportVulkanFunctions_Static()
+
+
+16244 m_VulkanFunctions.vkGetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)vkGetPhysicalDeviceProperties;
+16245 m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties)vkGetPhysicalDeviceMemoryProperties;
+16246 m_VulkanFunctions.vkAllocateMemory = (PFN_vkAllocateMemory)vkAllocateMemory;
+16247 m_VulkanFunctions.vkFreeMemory = (PFN_vkFreeMemory)vkFreeMemory;
+16248 m_VulkanFunctions.vkMapMemory = (PFN_vkMapMemory)vkMapMemory;
+16249 m_VulkanFunctions.vkUnmapMemory = (PFN_vkUnmapMemory)vkUnmapMemory;
+16250 m_VulkanFunctions.vkFlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges)vkFlushMappedMemoryRanges;
+16251 m_VulkanFunctions.vkInvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges)vkInvalidateMappedMemoryRanges;
+16252 m_VulkanFunctions.vkBindBufferMemory = (PFN_vkBindBufferMemory)vkBindBufferMemory;
+16253 m_VulkanFunctions.vkBindImageMemory = (PFN_vkBindImageMemory)vkBindImageMemory;
+16254 m_VulkanFunctions.vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)vkGetBufferMemoryRequirements;
+16255 m_VulkanFunctions.vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)vkGetImageMemoryRequirements;
+16256 m_VulkanFunctions.vkCreateBuffer = (PFN_vkCreateBuffer)vkCreateBuffer;
+16257 m_VulkanFunctions.vkDestroyBuffer = (PFN_vkDestroyBuffer)vkDestroyBuffer;
+16258 m_VulkanFunctions.vkCreateImage = (PFN_vkCreateImage)vkCreateImage;
+16259 m_VulkanFunctions.vkDestroyImage = (PFN_vkDestroyImage)vkDestroyImage;
+16260 m_VulkanFunctions.vkCmdCopyBuffer = (PFN_vkCmdCopyBuffer)vkCmdCopyBuffer;
-16262 #define VMA_COPY_IF_NOT_NULL(funcName) \
-16263 if(pVulkanFunctions->funcName != VMA_NULL) m_VulkanFunctions.funcName = pVulkanFunctions->funcName;
-
-16265 VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceProperties);
-16266 VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceMemoryProperties);
-16267 VMA_COPY_IF_NOT_NULL(vkAllocateMemory);
-16268 VMA_COPY_IF_NOT_NULL(vkFreeMemory);
-16269 VMA_COPY_IF_NOT_NULL(vkMapMemory);
-16270 VMA_COPY_IF_NOT_NULL(vkUnmapMemory);
-16271 VMA_COPY_IF_NOT_NULL(vkFlushMappedMemoryRanges);
-16272 VMA_COPY_IF_NOT_NULL(vkInvalidateMappedMemoryRanges);
-16273 VMA_COPY_IF_NOT_NULL(vkBindBufferMemory);
-16274 VMA_COPY_IF_NOT_NULL(vkBindImageMemory);
-16275 VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements);
-16276 VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements);
-16277 VMA_COPY_IF_NOT_NULL(vkCreateBuffer);
-16278 VMA_COPY_IF_NOT_NULL(vkDestroyBuffer);
-16279 VMA_COPY_IF_NOT_NULL(vkCreateImage);
-16280 VMA_COPY_IF_NOT_NULL(vkDestroyImage);
-16281 VMA_COPY_IF_NOT_NULL(vkCmdCopyBuffer);
-
-16283 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
-16284 VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements2KHR);
-16285 VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements2KHR);
-
-
-16288 #if VMA_BIND_MEMORY2 || VMA_VULKAN_VERSION >= 1001000
-16289 VMA_COPY_IF_NOT_NULL(vkBindBufferMemory2KHR);
-16290 VMA_COPY_IF_NOT_NULL(vkBindImageMemory2KHR);
-
-
-16293 #if VMA_MEMORY_BUDGET
-16294 VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceMemoryProperties2KHR);
-
-
-16297 #undef VMA_COPY_IF_NOT_NULL
-
-
-16300 #if VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
+
+16263 #if VMA_VULKAN_VERSION >= 1001000
+16264 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
+
+16266 m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2)vkGetBufferMemoryRequirements2;
+16267 m_VulkanFunctions.vkGetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2)vkGetImageMemoryRequirements2;
+16268 m_VulkanFunctions.vkBindBufferMemory2KHR = (PFN_vkBindBufferMemory2)vkBindBufferMemory2;
+16269 m_VulkanFunctions.vkBindImageMemory2KHR = (PFN_vkBindImageMemory2)vkBindImageMemory2;
+16270 m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties2KHR = (PFN_vkGetPhysicalDeviceMemoryProperties2)vkGetPhysicalDeviceMemoryProperties2;
+
+
+
+
+
+
+16277 void VmaAllocator_T::ImportVulkanFunctions_Custom(
const VmaVulkanFunctions* pVulkanFunctions)
+
+16279 VMA_ASSERT(pVulkanFunctions != VMA_NULL);
+
+16281 #define VMA_COPY_IF_NOT_NULL(funcName) \
+16282 if(pVulkanFunctions->funcName != VMA_NULL) m_VulkanFunctions.funcName = pVulkanFunctions->funcName;
+
+16284 VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceProperties);
+16285 VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceMemoryProperties);
+16286 VMA_COPY_IF_NOT_NULL(vkAllocateMemory);
+16287 VMA_COPY_IF_NOT_NULL(vkFreeMemory);
+16288 VMA_COPY_IF_NOT_NULL(vkMapMemory);
+16289 VMA_COPY_IF_NOT_NULL(vkUnmapMemory);
+16290 VMA_COPY_IF_NOT_NULL(vkFlushMappedMemoryRanges);
+16291 VMA_COPY_IF_NOT_NULL(vkInvalidateMappedMemoryRanges);
+16292 VMA_COPY_IF_NOT_NULL(vkBindBufferMemory);
+16293 VMA_COPY_IF_NOT_NULL(vkBindImageMemory);
+16294 VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements);
+16295 VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements);
+16296 VMA_COPY_IF_NOT_NULL(vkCreateBuffer);
+16297 VMA_COPY_IF_NOT_NULL(vkDestroyBuffer);
+16298 VMA_COPY_IF_NOT_NULL(vkCreateImage);
+16299 VMA_COPY_IF_NOT_NULL(vkDestroyImage);
+16300 VMA_COPY_IF_NOT_NULL(vkCmdCopyBuffer);
-16302 void VmaAllocator_T::ImportVulkanFunctions_Dynamic()
-
-16304 #define VMA_FETCH_INSTANCE_FUNC(memberName, functionPointerType, functionNameString) \
-16305 if(m_VulkanFunctions.memberName == VMA_NULL) \
-16306 m_VulkanFunctions.memberName = \
-16307 (functionPointerType)vkGetInstanceProcAddr(m_hInstance, functionNameString);
-16308 #define VMA_FETCH_DEVICE_FUNC(memberName, functionPointerType, functionNameString) \
-16309 if(m_VulkanFunctions.memberName == VMA_NULL) \
-16310 m_VulkanFunctions.memberName = \
-16311 (functionPointerType)vkGetDeviceProcAddr(m_hDevice, functionNameString);
-
-16313 VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceProperties, PFN_vkGetPhysicalDeviceProperties,
"vkGetPhysicalDeviceProperties");
-16314 VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties, PFN_vkGetPhysicalDeviceMemoryProperties,
"vkGetPhysicalDeviceMemoryProperties");
-16315 VMA_FETCH_DEVICE_FUNC(vkAllocateMemory, PFN_vkAllocateMemory,
"vkAllocateMemory");
-16316 VMA_FETCH_DEVICE_FUNC(vkFreeMemory, PFN_vkFreeMemory,
"vkFreeMemory");
-16317 VMA_FETCH_DEVICE_FUNC(vkMapMemory, PFN_vkMapMemory,
"vkMapMemory");
-16318 VMA_FETCH_DEVICE_FUNC(vkUnmapMemory, PFN_vkUnmapMemory,
"vkUnmapMemory");
-16319 VMA_FETCH_DEVICE_FUNC(vkFlushMappedMemoryRanges, PFN_vkFlushMappedMemoryRanges,
"vkFlushMappedMemoryRanges");
-16320 VMA_FETCH_DEVICE_FUNC(vkInvalidateMappedMemoryRanges, PFN_vkInvalidateMappedMemoryRanges,
"vkInvalidateMappedMemoryRanges");
-16321 VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory, PFN_vkBindBufferMemory,
"vkBindBufferMemory");
-16322 VMA_FETCH_DEVICE_FUNC(vkBindImageMemory, PFN_vkBindImageMemory,
"vkBindImageMemory");
-16323 VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements, PFN_vkGetBufferMemoryRequirements,
"vkGetBufferMemoryRequirements");
-16324 VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements, PFN_vkGetImageMemoryRequirements,
"vkGetImageMemoryRequirements");
-16325 VMA_FETCH_DEVICE_FUNC(vkCreateBuffer, PFN_vkCreateBuffer,
"vkCreateBuffer");
-16326 VMA_FETCH_DEVICE_FUNC(vkDestroyBuffer, PFN_vkDestroyBuffer,
"vkDestroyBuffer");
-16327 VMA_FETCH_DEVICE_FUNC(vkCreateImage, PFN_vkCreateImage,
"vkCreateImage");
-16328 VMA_FETCH_DEVICE_FUNC(vkDestroyImage, PFN_vkDestroyImage,
"vkDestroyImage");
-16329 VMA_FETCH_DEVICE_FUNC(vkCmdCopyBuffer, PFN_vkCmdCopyBuffer,
"vkCmdCopyBuffer");
-
-16331 #if VMA_VULKAN_VERSION >= 1001000
-16332 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
-
-16334 VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements2KHR, PFN_vkGetBufferMemoryRequirements2,
"vkGetBufferMemoryRequirements2");
-16335 VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements2KHR, PFN_vkGetImageMemoryRequirements2,
"vkGetImageMemoryRequirements2");
-16336 VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory2KHR, PFN_vkBindBufferMemory2,
"vkBindBufferMemory2");
-16337 VMA_FETCH_DEVICE_FUNC(vkBindImageMemory2KHR, PFN_vkBindImageMemory2,
"vkBindImageMemory2");
-16338 VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2,
"vkGetPhysicalDeviceMemoryProperties2");
-
-
-
-16342 #if VMA_DEDICATED_ALLOCATION
-16343 if(m_UseKhrDedicatedAllocation)
-
-16345 VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements2KHR, PFN_vkGetBufferMemoryRequirements2KHR,
"vkGetBufferMemoryRequirements2KHR");
-16346 VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements2KHR, PFN_vkGetImageMemoryRequirements2KHR,
"vkGetImageMemoryRequirements2KHR");
-
-
+16302 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
+16303 VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements2KHR);
+16304 VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements2KHR);
+
+
+16307 #if VMA_BIND_MEMORY2 || VMA_VULKAN_VERSION >= 1001000
+16308 VMA_COPY_IF_NOT_NULL(vkBindBufferMemory2KHR);
+16309 VMA_COPY_IF_NOT_NULL(vkBindImageMemory2KHR);
+
+
+16312 #if VMA_MEMORY_BUDGET
+16313 VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceMemoryProperties2KHR);
+
+
+16316 #undef VMA_COPY_IF_NOT_NULL
+
+
+16319 #if VMA_DYNAMIC_VULKAN_FUNCTIONS == 1
+
+16321 void VmaAllocator_T::ImportVulkanFunctions_Dynamic()
+
+16323 #define VMA_FETCH_INSTANCE_FUNC(memberName, functionPointerType, functionNameString) \
+16324 if(m_VulkanFunctions.memberName == VMA_NULL) \
+16325 m_VulkanFunctions.memberName = \
+16326 (functionPointerType)vkGetInstanceProcAddr(m_hInstance, functionNameString);
+16327 #define VMA_FETCH_DEVICE_FUNC(memberName, functionPointerType, functionNameString) \
+16328 if(m_VulkanFunctions.memberName == VMA_NULL) \
+16329 m_VulkanFunctions.memberName = \
+16330 (functionPointerType)vkGetDeviceProcAddr(m_hDevice, functionNameString);
+
+16332 VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceProperties, PFN_vkGetPhysicalDeviceProperties,
"vkGetPhysicalDeviceProperties");
+16333 VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties, PFN_vkGetPhysicalDeviceMemoryProperties,
"vkGetPhysicalDeviceMemoryProperties");
+16334 VMA_FETCH_DEVICE_FUNC(vkAllocateMemory, PFN_vkAllocateMemory,
"vkAllocateMemory");
+16335 VMA_FETCH_DEVICE_FUNC(vkFreeMemory, PFN_vkFreeMemory,
"vkFreeMemory");
+16336 VMA_FETCH_DEVICE_FUNC(vkMapMemory, PFN_vkMapMemory,
"vkMapMemory");
+16337 VMA_FETCH_DEVICE_FUNC(vkUnmapMemory, PFN_vkUnmapMemory,
"vkUnmapMemory");
+16338 VMA_FETCH_DEVICE_FUNC(vkFlushMappedMemoryRanges, PFN_vkFlushMappedMemoryRanges,
"vkFlushMappedMemoryRanges");
+16339 VMA_FETCH_DEVICE_FUNC(vkInvalidateMappedMemoryRanges, PFN_vkInvalidateMappedMemoryRanges,
"vkInvalidateMappedMemoryRanges");
+16340 VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory, PFN_vkBindBufferMemory,
"vkBindBufferMemory");
+16341 VMA_FETCH_DEVICE_FUNC(vkBindImageMemory, PFN_vkBindImageMemory,
"vkBindImageMemory");
+16342 VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements, PFN_vkGetBufferMemoryRequirements,
"vkGetBufferMemoryRequirements");
+16343 VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements, PFN_vkGetImageMemoryRequirements,
"vkGetImageMemoryRequirements");
+16344 VMA_FETCH_DEVICE_FUNC(vkCreateBuffer, PFN_vkCreateBuffer,
"vkCreateBuffer");
+16345 VMA_FETCH_DEVICE_FUNC(vkDestroyBuffer, PFN_vkDestroyBuffer,
"vkDestroyBuffer");
+16346 VMA_FETCH_DEVICE_FUNC(vkCreateImage, PFN_vkCreateImage,
"vkCreateImage");
+16347 VMA_FETCH_DEVICE_FUNC(vkDestroyImage, PFN_vkDestroyImage,
"vkDestroyImage");
+16348 VMA_FETCH_DEVICE_FUNC(vkCmdCopyBuffer, PFN_vkCmdCopyBuffer,
"vkCmdCopyBuffer");
-16350 #if VMA_BIND_MEMORY2
-16351 if(m_UseKhrBindMemory2)
+16350 #if VMA_VULKAN_VERSION >= 1001000
+16351 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
-16353 VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory2KHR, PFN_vkBindBufferMemory2KHR,
"vkBindBufferMemory2KHR");
-16354 VMA_FETCH_DEVICE_FUNC(vkBindImageMemory2KHR, PFN_vkBindImageMemory2KHR,
"vkBindImageMemory2KHR");
-
-
-
-16358 #if VMA_MEMORY_BUDGET
-16359 if(m_UseExtMemoryBudget)
-
-16361 VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2KHR,
"vkGetPhysicalDeviceMemoryProperties2KHR");
-
-
-
-16365 #undef VMA_FETCH_DEVICE_FUNC
-16366 #undef VMA_FETCH_INSTANCE_FUNC
-
+16353 VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements2KHR, PFN_vkGetBufferMemoryRequirements2,
"vkGetBufferMemoryRequirements2");
+16354 VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements2KHR, PFN_vkGetImageMemoryRequirements2,
"vkGetImageMemoryRequirements2");
+16355 VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory2KHR, PFN_vkBindBufferMemory2,
"vkBindBufferMemory2");
+16356 VMA_FETCH_DEVICE_FUNC(vkBindImageMemory2KHR, PFN_vkBindImageMemory2,
"vkBindImageMemory2");
+16357 VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2,
"vkGetPhysicalDeviceMemoryProperties2");
+
+
+
+16361 #if VMA_DEDICATED_ALLOCATION
+16362 if(m_UseKhrDedicatedAllocation)
+
+16364 VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements2KHR, PFN_vkGetBufferMemoryRequirements2KHR,
"vkGetBufferMemoryRequirements2KHR");
+16365 VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements2KHR, PFN_vkGetImageMemoryRequirements2KHR,
"vkGetImageMemoryRequirements2KHR");
+
+
-
-
-16371 void VmaAllocator_T::ValidateVulkanFunctions()
-
-16373 VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceProperties != VMA_NULL);
-16374 VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties != VMA_NULL);
-16375 VMA_ASSERT(m_VulkanFunctions.vkAllocateMemory != VMA_NULL);
-16376 VMA_ASSERT(m_VulkanFunctions.vkFreeMemory != VMA_NULL);
-16377 VMA_ASSERT(m_VulkanFunctions.vkMapMemory != VMA_NULL);
-16378 VMA_ASSERT(m_VulkanFunctions.vkUnmapMemory != VMA_NULL);
-16379 VMA_ASSERT(m_VulkanFunctions.vkFlushMappedMemoryRanges != VMA_NULL);
-16380 VMA_ASSERT(m_VulkanFunctions.vkInvalidateMappedMemoryRanges != VMA_NULL);
-16381 VMA_ASSERT(m_VulkanFunctions.vkBindBufferMemory != VMA_NULL);
-16382 VMA_ASSERT(m_VulkanFunctions.vkBindImageMemory != VMA_NULL);
-16383 VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements != VMA_NULL);
-16384 VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements != VMA_NULL);
-16385 VMA_ASSERT(m_VulkanFunctions.vkCreateBuffer != VMA_NULL);
-16386 VMA_ASSERT(m_VulkanFunctions.vkDestroyBuffer != VMA_NULL);
-16387 VMA_ASSERT(m_VulkanFunctions.vkCreateImage != VMA_NULL);
-16388 VMA_ASSERT(m_VulkanFunctions.vkDestroyImage != VMA_NULL);
-16389 VMA_ASSERT(m_VulkanFunctions.vkCmdCopyBuffer != VMA_NULL);
-
-16391 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
-16392 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0) || m_UseKhrDedicatedAllocation)
-
-16394 VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR != VMA_NULL);
-16395 VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements2KHR != VMA_NULL);
-
-
-
-16399 #if VMA_BIND_MEMORY2 || VMA_VULKAN_VERSION >= 1001000
-16400 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0) || m_UseKhrBindMemory2)
-
-16402 VMA_ASSERT(m_VulkanFunctions.vkBindBufferMemory2KHR != VMA_NULL);
-16403 VMA_ASSERT(m_VulkanFunctions.vkBindImageMemory2KHR != VMA_NULL);
-
-
-
-16407 #if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000
-16408 if(m_UseExtMemoryBudget || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
-
-16410 VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties2KHR != VMA_NULL);
-
-
-
-
-16415 VkDeviceSize VmaAllocator_T::CalcPreferredBlockSize(uint32_t memTypeIndex)
-
-16417 const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
-16418 const VkDeviceSize heapSize = m_MemProps.memoryHeaps[heapIndex].size;
-16419 const bool isSmallHeap = heapSize <= VMA_SMALL_HEAP_MAX_SIZE;
-16420 return VmaAlignUp(isSmallHeap ? (heapSize / 8) : m_PreferredLargeHeapBlockSize, (VkDeviceSize)32);
-
-
-16423 VkResult VmaAllocator_T::AllocateMemoryOfType(
-
-16425 VkDeviceSize alignment,
-16426 bool dedicatedAllocation,
-16427 VkBuffer dedicatedBuffer,
-16428 VkBufferUsageFlags dedicatedBufferUsage,
-16429 VkImage dedicatedImage,
-
-16431 uint32_t memTypeIndex,
-16432 VmaSuballocationType suballocType,
-16433 size_t allocationCount,
-
+16369 #if VMA_BIND_MEMORY2
+16370 if(m_UseKhrBindMemory2)
+
+16372 VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory2KHR, PFN_vkBindBufferMemory2KHR,
"vkBindBufferMemory2KHR");
+16373 VMA_FETCH_DEVICE_FUNC(vkBindImageMemory2KHR, PFN_vkBindImageMemory2KHR,
"vkBindImageMemory2KHR");
+
+
+
+16377 #if VMA_MEMORY_BUDGET
+16378 if(m_UseExtMemoryBudget)
+
+16380 VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2KHR,
"vkGetPhysicalDeviceMemoryProperties2KHR");
+
+
+
+16384 #undef VMA_FETCH_DEVICE_FUNC
+16385 #undef VMA_FETCH_INSTANCE_FUNC
+
+
+
+
+16390 void VmaAllocator_T::ValidateVulkanFunctions()
+
+16392 VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceProperties != VMA_NULL);
+16393 VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties != VMA_NULL);
+16394 VMA_ASSERT(m_VulkanFunctions.vkAllocateMemory != VMA_NULL);
+16395 VMA_ASSERT(m_VulkanFunctions.vkFreeMemory != VMA_NULL);
+16396 VMA_ASSERT(m_VulkanFunctions.vkMapMemory != VMA_NULL);
+16397 VMA_ASSERT(m_VulkanFunctions.vkUnmapMemory != VMA_NULL);
+16398 VMA_ASSERT(m_VulkanFunctions.vkFlushMappedMemoryRanges != VMA_NULL);
+16399 VMA_ASSERT(m_VulkanFunctions.vkInvalidateMappedMemoryRanges != VMA_NULL);
+16400 VMA_ASSERT(m_VulkanFunctions.vkBindBufferMemory != VMA_NULL);
+16401 VMA_ASSERT(m_VulkanFunctions.vkBindImageMemory != VMA_NULL);
+16402 VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements != VMA_NULL);
+16403 VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements != VMA_NULL);
+16404 VMA_ASSERT(m_VulkanFunctions.vkCreateBuffer != VMA_NULL);
+16405 VMA_ASSERT(m_VulkanFunctions.vkDestroyBuffer != VMA_NULL);
+16406 VMA_ASSERT(m_VulkanFunctions.vkCreateImage != VMA_NULL);
+16407 VMA_ASSERT(m_VulkanFunctions.vkDestroyImage != VMA_NULL);
+16408 VMA_ASSERT(m_VulkanFunctions.vkCmdCopyBuffer != VMA_NULL);
+
+16410 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
+16411 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0) || m_UseKhrDedicatedAllocation)
+
+16413 VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR != VMA_NULL);
+16414 VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements2KHR != VMA_NULL);
+
+
+
+16418 #if VMA_BIND_MEMORY2 || VMA_VULKAN_VERSION >= 1001000
+16419 if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0) || m_UseKhrBindMemory2)
+
+16421 VMA_ASSERT(m_VulkanFunctions.vkBindBufferMemory2KHR != VMA_NULL);
+16422 VMA_ASSERT(m_VulkanFunctions.vkBindImageMemory2KHR != VMA_NULL);
+
+
+
+16426 #if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000
+16427 if(m_UseExtMemoryBudget || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
+
+16429 VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties2KHR != VMA_NULL);
+
+
+
+
+16434 VkDeviceSize VmaAllocator_T::CalcPreferredBlockSize(uint32_t memTypeIndex)
-16436 VMA_ASSERT(pAllocations != VMA_NULL);
-16437 VMA_DEBUG_LOG(
" AllocateMemory: MemoryTypeIndex=%u, AllocationCount=%zu, Size=%llu", memTypeIndex, allocationCount, size);
-
-
-
-
-
-16443 (m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
-
-
-
-
-
-
-
-
-
-16453 VmaBlockVector*
const blockVector = m_pBlockVectors[memTypeIndex];
-16454 VMA_ASSERT(blockVector);
-
-16456 const VkDeviceSize preferredBlockSize = blockVector->GetPreferredBlockSize();
-16457 bool preferDedicatedMemory =
-16458 VMA_DEBUG_ALWAYS_DEDICATED_MEMORY ||
-16459 dedicatedAllocation ||
-
-16461 size > preferredBlockSize / 2;
-
-16463 if(preferDedicatedMemory &&
-
-16465 finalCreateInfo.
pool == VK_NULL_HANDLE)
-
-
-
-
-
-
-
-
-16474 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-
-16478 return AllocateDedicatedMemory(
-
-
-
-
-
-
-
-
-
-16488 dedicatedBufferUsage,
-
-
-
-
-
-
-
-16496 VkResult res = blockVector->Allocate(
-16497 m_CurrentFrameIndex.load(),
-
-
-
-
-
-
-16504 if(res == VK_SUCCESS)
-
-
-
-
-
-
-
-16512 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-
-
-
-16518 if(m_DeviceMemoryCount.load() > m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount * 3 / 4)
-
-16520 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-16523 res = AllocateDedicatedMemory(
-
-
-
-
-
-
-
-
-
-16533 dedicatedBufferUsage,
-
-
-
-16537 if(res == VK_SUCCESS)
+16436 const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
+16437 const VkDeviceSize heapSize = m_MemProps.memoryHeaps[heapIndex].size;
+16438 const bool isSmallHeap = heapSize <= VMA_SMALL_HEAP_MAX_SIZE;
+16439 return VmaAlignUp(isSmallHeap ? (heapSize / 8) : m_PreferredLargeHeapBlockSize, (VkDeviceSize)32);
+
+
+16442 VkResult VmaAllocator_T::AllocateMemoryOfType(
+
+16444 VkDeviceSize alignment,
+16445 bool dedicatedAllocation,
+16446 VkBuffer dedicatedBuffer,
+16447 VkBufferUsageFlags dedicatedBufferUsage,
+16448 VkImage dedicatedImage,
+
+16450 uint32_t memTypeIndex,
+16451 VmaSuballocationType suballocType,
+16452 size_t allocationCount,
+
+
+16455 VMA_ASSERT(pAllocations != VMA_NULL);
+16456 VMA_DEBUG_LOG(
" AllocateMemory: MemoryTypeIndex=%u, AllocationCount=%zu, Size=%llu", memTypeIndex, allocationCount, size);
+
+
+
+
+
+16462 (m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
+
+
+
+
+
+
+
+
+
+16472 VmaBlockVector*
const blockVector = m_pBlockVectors[memTypeIndex];
+16473 VMA_ASSERT(blockVector);
+
+16475 const VkDeviceSize preferredBlockSize = blockVector->GetPreferredBlockSize();
+16476 bool preferDedicatedMemory =
+16477 VMA_DEBUG_ALWAYS_DEDICATED_MEMORY ||
+16478 dedicatedAllocation ||
+
+16480 size > preferredBlockSize / 2;
+
+16482 if(preferDedicatedMemory &&
+
+16484 finalCreateInfo.
pool == VK_NULL_HANDLE)
+
+
+
+
+
+
+
+
+16493 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+
+16497 return AllocateDedicatedMemory(
+
+
+
+
+
+
+
+
+
+16507 dedicatedBufferUsage,
+
+
+
+
+
+
+
+16515 VkResult res = blockVector->Allocate(
+16516 m_CurrentFrameIndex.load(),
+
+
+
+
+
+
+16523 if(res == VK_SUCCESS)
+
+
+
+
+
+
+
+16531 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+
+
+
+16537 if(m_DeviceMemoryCount.load() > m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount * 3 / 4)
-
-16540 VMA_DEBUG_LOG(
" Allocated as DedicatedMemory");
-
-
-
-
-
-16546 VMA_DEBUG_LOG(
" vkAllocateMemory FAILED");
-
-
-
-
-
-16552 VkResult VmaAllocator_T::AllocateDedicatedMemory(
-
-16554 VmaSuballocationType suballocType,
-16555 uint32_t memTypeIndex,
-
-
-16558 bool isUserDataString,
-
-
-16561 VkBuffer dedicatedBuffer,
-16562 VkBufferUsageFlags dedicatedBufferUsage,
-16563 VkImage dedicatedImage,
-16564 size_t allocationCount,
-
-
-16567 VMA_ASSERT(allocationCount > 0 && pAllocations);
-
-
-
-16571 const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
-
-16573 GetBudget(&heapBudget, heapIndex, 1);
-16574 if(heapBudget.
usage + size * allocationCount > heapBudget.
budget)
-
-16576 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-
-16580 VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
-16581 allocInfo.memoryTypeIndex = memTypeIndex;
-16582 allocInfo.allocationSize = size;
-
-16584 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
-16585 VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR };
-16586 if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
-
-16588 if(dedicatedBuffer != VK_NULL_HANDLE)
-
-16590 VMA_ASSERT(dedicatedImage == VK_NULL_HANDLE);
-16591 dedicatedAllocInfo.buffer = dedicatedBuffer;
-16592 VmaPnextChainPushFront(&allocInfo, &dedicatedAllocInfo);
-
-16594 else if(dedicatedImage != VK_NULL_HANDLE)
-
-16596 dedicatedAllocInfo.image = dedicatedImage;
-16597 VmaPnextChainPushFront(&allocInfo, &dedicatedAllocInfo);
-
-
-
-
-16602 #if VMA_BUFFER_DEVICE_ADDRESS
-16603 VkMemoryAllocateFlagsInfoKHR allocFlagsInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR };
-16604 if(m_UseKhrBufferDeviceAddress)
-
-16606 bool canContainBufferWithDeviceAddress =
true;
+16539 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+16542 res = AllocateDedicatedMemory(
+
+
+
+
+
+
+
+
+
+16552 dedicatedBufferUsage,
+
+
+
+16556 if(res == VK_SUCCESS)
+
+
+16559 VMA_DEBUG_LOG(
" Allocated as DedicatedMemory");
+
+
+
+
+
+16565 VMA_DEBUG_LOG(
" vkAllocateMemory FAILED");
+
+
+
+
+
+16571 VkResult VmaAllocator_T::AllocateDedicatedMemory(
+
+16573 VmaSuballocationType suballocType,
+16574 uint32_t memTypeIndex,
+
+
+16577 bool isUserDataString,
+
+
+16580 VkBuffer dedicatedBuffer,
+16581 VkBufferUsageFlags dedicatedBufferUsage,
+16582 VkImage dedicatedImage,
+16583 size_t allocationCount,
+
+
+16586 VMA_ASSERT(allocationCount > 0 && pAllocations);
+
+
+
+16590 const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
+
+16592 GetBudget(&heapBudget, heapIndex, 1);
+16593 if(heapBudget.
usage + size * allocationCount > heapBudget.
budget)
+
+16595 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+
+16599 VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
+16600 allocInfo.memoryTypeIndex = memTypeIndex;
+16601 allocInfo.allocationSize = size;
+
+16603 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
+16604 VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR };
+16605 if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
+
16607 if(dedicatedBuffer != VK_NULL_HANDLE)
-16609 canContainBufferWithDeviceAddress = dedicatedBufferUsage == UINT32_MAX ||
-16610 (dedicatedBufferUsage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT) != 0;
-
-16612 else if(dedicatedImage != VK_NULL_HANDLE)
-
-16614 canContainBufferWithDeviceAddress =
false;
-
-16616 if(canContainBufferWithDeviceAddress)
-
-16618 allocFlagsInfo.flags = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR;
-16619 VmaPnextChainPushFront(&allocInfo, &allocFlagsInfo);
-
-
-
-
-16624 #if VMA_MEMORY_PRIORITY
-16625 VkMemoryPriorityAllocateInfoEXT priorityInfo = { VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT };
-16626 if(m_UseExtMemoryPriority)
-
-16628 priorityInfo.priority = priority;
-16629 VmaPnextChainPushFront(&allocInfo, &priorityInfo);
-
-
-
-
-16634 VkResult res = VK_SUCCESS;
-16635 for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
-
-16637 res = AllocateDedicatedMemoryPage(
-
-
-
-
-
-
-
-16645 pAllocations + allocIndex);
-16646 if(res != VK_SUCCESS)
-
-
-
-
+16609 VMA_ASSERT(dedicatedImage == VK_NULL_HANDLE);
+16610 dedicatedAllocInfo.buffer = dedicatedBuffer;
+16611 VmaPnextChainPushFront(&allocInfo, &dedicatedAllocInfo);
+
+16613 else if(dedicatedImage != VK_NULL_HANDLE)
+
+16615 dedicatedAllocInfo.image = dedicatedImage;
+16616 VmaPnextChainPushFront(&allocInfo, &dedicatedAllocInfo);
+
+
+
+
+16621 #if VMA_BUFFER_DEVICE_ADDRESS
+16622 VkMemoryAllocateFlagsInfoKHR allocFlagsInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR };
+16623 if(m_UseKhrBufferDeviceAddress)
+
+16625 bool canContainBufferWithDeviceAddress =
true;
+16626 if(dedicatedBuffer != VK_NULL_HANDLE)
+
+16628 canContainBufferWithDeviceAddress = dedicatedBufferUsage == UINT32_MAX ||
+16629 (dedicatedBufferUsage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT) != 0;
+
+16631 else if(dedicatedImage != VK_NULL_HANDLE)
+
+16633 canContainBufferWithDeviceAddress =
false;
+
+16635 if(canContainBufferWithDeviceAddress)
+
+16637 allocFlagsInfo.flags = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR;
+16638 VmaPnextChainPushFront(&allocInfo, &allocFlagsInfo);
+
+
+
+
+16643 #if VMA_MEMORY_PRIORITY
+16644 VkMemoryPriorityAllocateInfoEXT priorityInfo = { VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT };
+16645 if(m_UseExtMemoryPriority)
+
+16647 priorityInfo.priority = priority;
+16648 VmaPnextChainPushFront(&allocInfo, &priorityInfo);
+
+
-16652 if(res == VK_SUCCESS)
-
-
-
-16656 VmaMutexLockWrite lock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
-16657 DedicatedAllocationLinkedList& dedicatedAllocations = m_DedicatedAllocations[memTypeIndex];
-16658 for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
-
-16660 dedicatedAllocations.PushBack(pAllocations[allocIndex]);
-
-
-
-16664 VMA_DEBUG_LOG(
" Allocated DedicatedMemory Count=%zu, MemoryTypeIndex=#%u", allocationCount, memTypeIndex);
-
-
-
-
-16669 while(allocIndex--)
-
-
-16672 VkDeviceMemory hMemory = currAlloc->GetMemory();
-
-
-
-
-
-
-
-
-
-
-
-16684 FreeVulkanMemory(memTypeIndex, currAlloc->GetSize(), hMemory);
-16685 m_Budget.RemoveAllocation(MemoryTypeIndexToHeapIndex(memTypeIndex), currAlloc->GetSize());
-16686 currAlloc->SetUserData(
this, VMA_NULL);
-16687 m_AllocationObjectAllocator.Free(currAlloc);
-
-
-16690 memset(pAllocations, 0,
sizeof(
VmaAllocation) * allocationCount);
-
+
+16653 VkResult res = VK_SUCCESS;
+16654 for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+
+16656 res = AllocateDedicatedMemoryPage(
+
+
+
+
+
+
+
+16664 pAllocations + allocIndex);
+16665 if(res != VK_SUCCESS)
+
+
+
+
+
+16671 if(res == VK_SUCCESS)
+
+
+
+16675 VmaMutexLockWrite lock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
+16676 DedicatedAllocationLinkedList& dedicatedAllocations = m_DedicatedAllocations[memTypeIndex];
+16677 for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+
+16679 dedicatedAllocations.PushBack(pAllocations[allocIndex]);
+
+
+
+16683 VMA_DEBUG_LOG(
" Allocated DedicatedMemory Count=%zu, MemoryTypeIndex=#%u", allocationCount, memTypeIndex);
+
+
+
+
+16688 while(allocIndex--)
+
+
+16691 VkDeviceMemory hMemory = currAlloc->GetMemory();
-
-
-
-16696 VkResult VmaAllocator_T::AllocateDedicatedMemoryPage(
-
-16698 VmaSuballocationType suballocType,
-16699 uint32_t memTypeIndex,
-16700 const VkMemoryAllocateInfo& allocInfo,
-
-16702 bool isUserDataString,
-
-
-
-16706 VkDeviceMemory hMemory = VK_NULL_HANDLE;
-16707 VkResult res = AllocateVulkanMemory(&allocInfo, &hMemory);
-
-
-16710 VMA_DEBUG_LOG(
" vkAllocateMemory FAILED");
-
-
-
-16714 void* pMappedData = VMA_NULL;
-
-
-16717 res = (*m_VulkanFunctions.vkMapMemory)(
-
-
-
-
-
-
-
-
-16726 VMA_DEBUG_LOG(
" vkMapMemory FAILED");
-16727 FreeVulkanMemory(memTypeIndex, size, hMemory);
-
-
-
-
-16732 *pAllocation = m_AllocationObjectAllocator.Allocate(m_CurrentFrameIndex.load(), isUserDataString);
-16733 (*pAllocation)->InitDedicatedAllocation(memTypeIndex, hMemory, suballocType, pMappedData, size);
-16734 (*pAllocation)->SetUserData(
this, pUserData);
-16735 m_Budget.AddAllocation(MemoryTypeIndexToHeapIndex(memTypeIndex), size);
-16736 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
-
-16738 FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
-
-
-
-
-
-16744 void VmaAllocator_T::GetBufferMemoryRequirements(
-
-16746 VkMemoryRequirements& memReq,
-16747 bool& requiresDedicatedAllocation,
-16748 bool& prefersDedicatedAllocation)
const
-
-16750 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
-16751 if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
-
-16753 VkBufferMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR };
-16754 memReqInfo.buffer = hBuffer;
-
-16756 VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
-
-16758 VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
-16759 VmaPnextChainPushFront(&memReq2, &memDedicatedReq);
-
-16761 (*m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
+
+
+
+
+
+
+
+
+
+
+16703 FreeVulkanMemory(memTypeIndex, currAlloc->GetSize(), hMemory);
+16704 m_Budget.RemoveAllocation(MemoryTypeIndexToHeapIndex(memTypeIndex), currAlloc->GetSize());
+16705 currAlloc->SetUserData(
this, VMA_NULL);
+16706 m_AllocationObjectAllocator.Free(currAlloc);
+
+
+16709 memset(pAllocations, 0,
sizeof(
VmaAllocation) * allocationCount);
+
+
+
+
+
+16715 VkResult VmaAllocator_T::AllocateDedicatedMemoryPage(
+
+16717 VmaSuballocationType suballocType,
+16718 uint32_t memTypeIndex,
+16719 const VkMemoryAllocateInfo& allocInfo,
+
+16721 bool isUserDataString,
+
+
+
+16725 VkDeviceMemory hMemory = VK_NULL_HANDLE;
+16726 VkResult res = AllocateVulkanMemory(&allocInfo, &hMemory);
+
+
+16729 VMA_DEBUG_LOG(
" vkAllocateMemory FAILED");
+
+
+
+16733 void* pMappedData = VMA_NULL;
+
+
+16736 res = (*m_VulkanFunctions.vkMapMemory)(
+
+
+
+
+
+
+
+
+16745 VMA_DEBUG_LOG(
" vkMapMemory FAILED");
+16746 FreeVulkanMemory(memTypeIndex, size, hMemory);
+
+
+
+
+16751 *pAllocation = m_AllocationObjectAllocator.Allocate(m_CurrentFrameIndex.load(), isUserDataString);
+16752 (*pAllocation)->InitDedicatedAllocation(memTypeIndex, hMemory, suballocType, pMappedData, size);
+16753 (*pAllocation)->SetUserData(
this, pUserData);
+16754 m_Budget.AddAllocation(MemoryTypeIndexToHeapIndex(memTypeIndex), size);
+16755 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
+
+16757 FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
+
+
+
+
-16763 memReq = memReq2.memoryRequirements;
-16764 requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE);
-16765 prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
-
-
-
-
-16770 (*m_VulkanFunctions.vkGetBufferMemoryRequirements)(m_hDevice, hBuffer, &memReq);
-16771 requiresDedicatedAllocation =
false;
-16772 prefersDedicatedAllocation =
false;
-
-
-
-16776 void VmaAllocator_T::GetImageMemoryRequirements(
-
-16778 VkMemoryRequirements& memReq,
-16779 bool& requiresDedicatedAllocation,
-16780 bool& prefersDedicatedAllocation)
const
-
-16782 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
-16783 if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
-
-16785 VkImageMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR };
-16786 memReqInfo.image = hImage;
-
-16788 VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
-
-16790 VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
-16791 VmaPnextChainPushFront(&memReq2, &memDedicatedReq);
-
-16793 (*m_VulkanFunctions.vkGetImageMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
+16763 void VmaAllocator_T::GetBufferMemoryRequirements(
+
+16765 VkMemoryRequirements& memReq,
+16766 bool& requiresDedicatedAllocation,
+16767 bool& prefersDedicatedAllocation)
const
+
+16769 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
+16770 if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
+
+16772 VkBufferMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR };
+16773 memReqInfo.buffer = hBuffer;
+
+16775 VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
+
+16777 VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
+16778 VmaPnextChainPushFront(&memReq2, &memDedicatedReq);
+
+16780 (*m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
+
+16782 memReq = memReq2.memoryRequirements;
+16783 requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE);
+16784 prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
+
+
+
+
+16789 (*m_VulkanFunctions.vkGetBufferMemoryRequirements)(m_hDevice, hBuffer, &memReq);
+16790 requiresDedicatedAllocation =
false;
+16791 prefersDedicatedAllocation =
false;
+
+
-16795 memReq = memReq2.memoryRequirements;
-16796 requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE);
-16797 prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
-
-
-
-
-16802 (*m_VulkanFunctions.vkGetImageMemoryRequirements)(m_hDevice, hImage, &memReq);
-16803 requiresDedicatedAllocation =
false;
-16804 prefersDedicatedAllocation =
false;
-
-
-
-16808 VkResult VmaAllocator_T::AllocateMemory(
-16809 const VkMemoryRequirements& vkMemReq,
-16810 bool requiresDedicatedAllocation,
-16811 bool prefersDedicatedAllocation,
-16812 VkBuffer dedicatedBuffer,
-16813 VkBufferUsageFlags dedicatedBufferUsage,
-16814 VkImage dedicatedImage,
-
-16816 VmaSuballocationType suballocType,
-16817 size_t allocationCount,
-
-
-16820 memset(pAllocations, 0,
sizeof(
VmaAllocation) * allocationCount);
-
-16822 VMA_ASSERT(VmaIsPow2(vkMemReq.alignment));
-
-16824 if(vkMemReq.size == 0)
-
-16826 return VK_ERROR_VALIDATION_FAILED_EXT;
-
-
-
-
-16831 VMA_ASSERT(0 &&
"Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT together with VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT makes no sense.");
-16832 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-
-
-16837 VMA_ASSERT(0 &&
"Specifying VMA_ALLOCATION_CREATE_MAPPED_BIT together with VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT is invalid.");
-16838 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-16840 if(requiresDedicatedAllocation)
-
-
-
-16844 VMA_ASSERT(0 &&
"VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT specified while dedicated allocation is required.");
-16845 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-16847 if(createInfo.
pool != VK_NULL_HANDLE)
-
-16849 VMA_ASSERT(0 &&
"Pool specified while dedicated allocation is required.");
-16850 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
+16795 void VmaAllocator_T::GetImageMemoryRequirements(
+
+16797 VkMemoryRequirements& memReq,
+16798 bool& requiresDedicatedAllocation,
+16799 bool& prefersDedicatedAllocation)
const
+
+16801 #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
+16802 if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
+
+16804 VkImageMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR };
+16805 memReqInfo.image = hImage;
+
+16807 VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
+
+16809 VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
+16810 VmaPnextChainPushFront(&memReq2, &memDedicatedReq);
+
+16812 (*m_VulkanFunctions.vkGetImageMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
+
+16814 memReq = memReq2.memoryRequirements;
+16815 requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE);
+16816 prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
+
+
+
+
+16821 (*m_VulkanFunctions.vkGetImageMemoryRequirements)(m_hDevice, hImage, &memReq);
+16822 requiresDedicatedAllocation =
false;
+16823 prefersDedicatedAllocation =
false;
+
+
+
+16827 VkResult VmaAllocator_T::AllocateMemory(
+16828 const VkMemoryRequirements& vkMemReq,
+16829 bool requiresDedicatedAllocation,
+16830 bool prefersDedicatedAllocation,
+16831 VkBuffer dedicatedBuffer,
+16832 VkBufferUsageFlags dedicatedBufferUsage,
+16833 VkImage dedicatedImage,
+
+16835 VmaSuballocationType suballocType,
+16836 size_t allocationCount,
+
+
+16839 memset(pAllocations, 0,
sizeof(
VmaAllocation) * allocationCount);
+
+16841 VMA_ASSERT(VmaIsPow2(vkMemReq.alignment));
+
+16843 if(vkMemReq.size == 0)
+
+16845 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+
+
+
+16850 VMA_ASSERT(0 &&
"Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT together with VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT makes no sense.");
+16851 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-16853 if((createInfo.
pool != VK_NULL_HANDLE) &&
-
+
+
-16856 VMA_ASSERT(0 &&
"Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT when pool != null is invalid.");
+16856 VMA_ASSERT(0 &&
"Specifying VMA_ALLOCATION_CREATE_MAPPED_BIT together with VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT is invalid.");
16857 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-16860 if(createInfo.
pool != VK_NULL_HANDLE)
-
-16862 const VkDeviceSize alignmentForPool = VMA_MAX(
-16863 vkMemReq.alignment,
-16864 GetMemoryTypeMinAlignment(createInfo.
pool->m_BlockVector.GetMemoryTypeIndex()));
-
-
-
-
-16869 (m_MemProps.memoryTypes[createInfo.
pool->m_BlockVector.GetMemoryTypeIndex()].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
-
-
-
-
-16874 return createInfo.
pool->m_BlockVector.Allocate(
-16875 m_CurrentFrameIndex.load(),
-
-
-
-
-
-
-
-
-
-
-16886 uint32_t memoryTypeBits = vkMemReq.memoryTypeBits;
-16887 uint32_t memTypeIndex = UINT32_MAX;
-
-16889 if(res == VK_SUCCESS)
-
-16891 VkDeviceSize alignmentForMemType = VMA_MAX(
-16892 vkMemReq.alignment,
-16893 GetMemoryTypeMinAlignment(memTypeIndex));
-
-16895 res = AllocateMemoryOfType(
-
-16897 alignmentForMemType,
-16898 requiresDedicatedAllocation || prefersDedicatedAllocation,
-
-16900 dedicatedBufferUsage,
-
-
-
-
-
-
-
-16908 if(res == VK_SUCCESS)
-
-
-
-
-
-
-
-
-
-16918 memoryTypeBits &= ~(1u << memTypeIndex);
-
-
-16921 if(res == VK_SUCCESS)
-
-16923 alignmentForMemType = VMA_MAX(
-16924 vkMemReq.alignment,
-16925 GetMemoryTypeMinAlignment(memTypeIndex));
-
-16927 res = AllocateMemoryOfType(
-
-16929 alignmentForMemType,
-16930 requiresDedicatedAllocation || prefersDedicatedAllocation,
-
-16932 dedicatedBufferUsage,
-
-
-
-
-
-
-
-16940 if(res == VK_SUCCESS)
-
-
-
-
-
-
-
-
-
-16950 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-
-
-
-
-
-
-
-
-
-16961 void VmaAllocator_T::FreeMemory(
-16962 size_t allocationCount,
-
-
-16965 VMA_ASSERT(pAllocations);
-
-16967 for(
size_t allocIndex = allocationCount; allocIndex--; )
-
-
-
-16971 if(allocation != VK_NULL_HANDLE)
-
-16973 if(TouchAllocation(allocation))
-
-16975 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
-
-16977 FillAllocation(allocation, VMA_ALLOCATION_FILL_PATTERN_DESTROYED);
-
-
-16980 switch(allocation->GetType())
-
-16982 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
-
-16984 VmaBlockVector* pBlockVector = VMA_NULL;
-16985 VmaPool hPool = allocation->GetBlock()->GetParentPool();
-16986 if(hPool != VK_NULL_HANDLE)
-
-16988 pBlockVector = &hPool->m_BlockVector;
-
-
-
-16992 const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
-16993 pBlockVector = m_pBlockVectors[memTypeIndex];
-
-16995 pBlockVector->Free(allocation);
-
-
-16998 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
-16999 FreeDedicatedMemory(allocation);
-
-
-
-
-
-
-
-17007 m_Budget.RemoveAllocation(MemoryTypeIndexToHeapIndex(allocation->GetMemoryTypeIndex()), allocation->GetSize());
-17008 allocation->SetUserData(
this, VMA_NULL);
-17009 m_AllocationObjectAllocator.Free(allocation);
-
-
-
-
-17014 void VmaAllocator_T::CalculateStats(
VmaStats* pStats)
-
-
-17017 InitStatInfo(pStats->
total);
-17018 for(
size_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i)
-
-17020 for(
size_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i)
-
-
-
-17024 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
-
-17026 VmaBlockVector*
const pBlockVector = m_pBlockVectors[memTypeIndex];
-17027 VMA_ASSERT(pBlockVector);
-17028 pBlockVector->AddStats(pStats);
-
-
-
+16859 if(requiresDedicatedAllocation)
+
+
+
+16863 VMA_ASSERT(0 &&
"VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT specified while dedicated allocation is required.");
+16864 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+16866 if(createInfo.
pool != VK_NULL_HANDLE)
+
+16868 VMA_ASSERT(0 &&
"Pool specified while dedicated allocation is required.");
+16869 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+16872 if((createInfo.
pool != VK_NULL_HANDLE) &&
+
+
+16875 VMA_ASSERT(0 &&
"Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT when pool != null is invalid.");
+16876 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+16879 if(createInfo.
pool != VK_NULL_HANDLE)
+
+
+
+
+16884 (m_MemProps.memoryTypes[createInfo.
pool->m_BlockVector.GetMemoryTypeIndex()].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
+
+
+
+
+16889 return createInfo.
pool->m_BlockVector.Allocate(
+16890 m_CurrentFrameIndex.load(),
+
+16892 vkMemReq.alignment,
+
+
+
+
+
+
+
+
+16901 uint32_t memoryTypeBits = vkMemReq.memoryTypeBits;
+16902 uint32_t memTypeIndex = UINT32_MAX;
+
+16904 if(res == VK_SUCCESS)
+
+16906 res = AllocateMemoryOfType(
+
+16908 vkMemReq.alignment,
+16909 requiresDedicatedAllocation || prefersDedicatedAllocation,
+
+16911 dedicatedBufferUsage,
+
+
+
+
+
+
+
+16919 if(res == VK_SUCCESS)
+
+
+
+
+
+
+
+
+
+16929 memoryTypeBits &= ~(1u << memTypeIndex);
+
+
+16932 if(res == VK_SUCCESS)
+
+16934 res = AllocateMemoryOfType(
+
+16936 vkMemReq.alignment,
+16937 requiresDedicatedAllocation || prefersDedicatedAllocation,
+
+16939 dedicatedBufferUsage,
+
+
+
+
+
+
+
+16947 if(res == VK_SUCCESS)
+
+
+
+
+
+
+
+
+
+16957 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+
+
+
+
+
+
+
+
+
+16968 void VmaAllocator_T::FreeMemory(
+16969 size_t allocationCount,
+
+
+16972 VMA_ASSERT(pAllocations);
+
+16974 for(
size_t allocIndex = allocationCount; allocIndex--; )
+
+
+
+16978 if(allocation != VK_NULL_HANDLE)
+
+16980 if(TouchAllocation(allocation))
+
+16982 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
+
+16984 FillAllocation(allocation, VMA_ALLOCATION_FILL_PATTERN_DESTROYED);
+
+
+16987 switch(allocation->GetType())
+
+16989 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+
+16991 VmaBlockVector* pBlockVector = VMA_NULL;
+16992 VmaPool hPool = allocation->GetBlock()->GetParentPool();
+16993 if(hPool != VK_NULL_HANDLE)
+
+16995 pBlockVector = &hPool->m_BlockVector;
+
+
+
+16999 const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
+17000 pBlockVector = m_pBlockVectors[memTypeIndex];
+
+17002 pBlockVector->Free(allocation);
+
+
+17005 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+17006 FreeDedicatedMemory(allocation);
+
+
+
+
+
+
+
+17014 m_Budget.RemoveAllocation(MemoryTypeIndexToHeapIndex(allocation->GetMemoryTypeIndex()), allocation->GetSize());
+17015 allocation->SetUserData(
this, VMA_NULL);
+17016 m_AllocationObjectAllocator.Free(allocation);
+
+
+
+
+17021 void VmaAllocator_T::CalculateStats(
VmaStats* pStats)
+
+
+17024 InitStatInfo(pStats->
total);
+17025 for(
size_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i)
+
+17027 for(
size_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i)
+
+
+
+17031 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
-17033 VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
-17034 for(
VmaPool pool = m_Pools.Front(); pool != VMA_NULL; pool = m_Pools.GetNext(pool))
-
-17036 pool->m_BlockVector.AddStats(pStats);
-
-
-
-
-17041 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
-
-17043 const uint32_t memHeapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
-17044 VmaMutexLockRead dedicatedAllocationsLock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
-17045 DedicatedAllocationLinkedList& dedicatedAllocList = m_DedicatedAllocations[memTypeIndex];
-
-17047 alloc != VMA_NULL; alloc = dedicatedAllocList.GetNext(alloc))
-
-
-17050 alloc->DedicatedAllocCalcStatsInfo(allocationStatInfo);
-17051 VmaAddStatInfo(pStats->
total, allocationStatInfo);
-17052 VmaAddStatInfo(pStats->
memoryType[memTypeIndex], allocationStatInfo);
-17053 VmaAddStatInfo(pStats->
memoryHeap[memHeapIndex], allocationStatInfo);
-
-
-
-
-17058 VmaPostprocessCalcStatInfo(pStats->
total);
-17059 for(
size_t i = 0; i < GetMemoryTypeCount(); ++i)
-17060 VmaPostprocessCalcStatInfo(pStats->
memoryType[i]);
-17061 for(
size_t i = 0; i < GetMemoryHeapCount(); ++i)
-17062 VmaPostprocessCalcStatInfo(pStats->
memoryHeap[i]);
-
-
-17065 void VmaAllocator_T::GetBudget(
VmaBudget* outBudget, uint32_t firstHeap, uint32_t heapCount)
-
-17067 #if VMA_MEMORY_BUDGET
-17068 if(m_UseExtMemoryBudget)
-
-17070 if(m_Budget.m_OperationsSinceBudgetFetch < 30)
-
-17072 VmaMutexLockRead lockRead(m_Budget.m_BudgetMutex, m_UseMutex);
-17073 for(uint32_t i = 0; i < heapCount; ++i, ++outBudget)
-
-17075 const uint32_t heapIndex = firstHeap + i;
-
-17077 outBudget->
blockBytes = m_Budget.m_BlockBytes[heapIndex];
-
-
-17080 if(m_Budget.m_VulkanUsage[heapIndex] + outBudget->
blockBytes > m_Budget.m_BlockBytesAtBudgetFetch[heapIndex])
-
-17082 outBudget->
usage = m_Budget.m_VulkanUsage[heapIndex] +
-17083 outBudget->
blockBytes - m_Budget.m_BlockBytesAtBudgetFetch[heapIndex];
-
-
-
-17087 outBudget->
usage = 0;
-
-
-
-17091 outBudget->
budget = VMA_MIN(
-17092 m_Budget.m_VulkanBudget[heapIndex], m_MemProps.memoryHeaps[heapIndex].size);
-
-
-
-
-17097 UpdateVulkanBudget();
-17098 GetBudget(outBudget, firstHeap, heapCount);
-
-
-
-
-
-17104 for(uint32_t i = 0; i < heapCount; ++i, ++outBudget)
-
-17106 const uint32_t heapIndex = firstHeap + i;
-
-17108 outBudget->
blockBytes = m_Budget.m_BlockBytes[heapIndex];
-
-
-
-17112 outBudget->
budget = m_MemProps.memoryHeaps[heapIndex].size * 8 / 10;
-
-
-
-
-17117 static const uint32_t VMA_VENDOR_ID_AMD = 4098;
-
-17119 VkResult VmaAllocator_T::DefragmentationBegin(
-
-
-
-
-
-
-
-
-
-17129 *pContext = vma_new(
this, VmaDefragmentationContext_T)(
-17130 this, m_CurrentFrameIndex.load(), info.
flags, pStats);
-
-
-17133 (*pContext)->AddAllocations(
-
+17033 VmaBlockVector*
const pBlockVector = m_pBlockVectors[memTypeIndex];
+17034 VMA_ASSERT(pBlockVector);
+17035 pBlockVector->AddStats(pStats);
+
+
+
+
+17040 VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
+17041 for(
VmaPool pool = m_Pools.Front(); pool != VMA_NULL; pool = m_Pools.GetNext(pool))
+
+17043 pool->m_BlockVector.AddStats(pStats);
+
+
+
+
+17048 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+
+17050 const uint32_t memHeapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
+17051 VmaMutexLockRead dedicatedAllocationsLock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
+17052 DedicatedAllocationLinkedList& dedicatedAllocList = m_DedicatedAllocations[memTypeIndex];
+
+17054 alloc != VMA_NULL; alloc = dedicatedAllocList.GetNext(alloc))
+
+
+17057 alloc->DedicatedAllocCalcStatsInfo(allocationStatInfo);
+17058 VmaAddStatInfo(pStats->
total, allocationStatInfo);
+17059 VmaAddStatInfo(pStats->
memoryType[memTypeIndex], allocationStatInfo);
+17060 VmaAddStatInfo(pStats->
memoryHeap[memHeapIndex], allocationStatInfo);
+
+
+
+
+17065 VmaPostprocessCalcStatInfo(pStats->
total);
+17066 for(
size_t i = 0; i < GetMemoryTypeCount(); ++i)
+17067 VmaPostprocessCalcStatInfo(pStats->
memoryType[i]);
+17068 for(
size_t i = 0; i < GetMemoryHeapCount(); ++i)
+17069 VmaPostprocessCalcStatInfo(pStats->
memoryHeap[i]);
+
+
+17072 void VmaAllocator_T::GetBudget(
VmaBudget* outBudget, uint32_t firstHeap, uint32_t heapCount)
+
+17074 #if VMA_MEMORY_BUDGET
+17075 if(m_UseExtMemoryBudget)
+
+17077 if(m_Budget.m_OperationsSinceBudgetFetch < 30)
+
+17079 VmaMutexLockRead lockRead(m_Budget.m_BudgetMutex, m_UseMutex);
+17080 for(uint32_t i = 0; i < heapCount; ++i, ++outBudget)
+
+17082 const uint32_t heapIndex = firstHeap + i;
+
+17084 outBudget->
blockBytes = m_Budget.m_BlockBytes[heapIndex];
+
+
+17087 if(m_Budget.m_VulkanUsage[heapIndex] + outBudget->
blockBytes > m_Budget.m_BlockBytesAtBudgetFetch[heapIndex])
+
+17089 outBudget->
usage = m_Budget.m_VulkanUsage[heapIndex] +
+17090 outBudget->
blockBytes - m_Budget.m_BlockBytesAtBudgetFetch[heapIndex];
+
+
+
+17094 outBudget->
usage = 0;
+
+
+
+17098 outBudget->
budget = VMA_MIN(
+17099 m_Budget.m_VulkanBudget[heapIndex], m_MemProps.memoryHeaps[heapIndex].size);
+
+
+
+
+17104 UpdateVulkanBudget();
+17105 GetBudget(outBudget, firstHeap, heapCount);
+
+
+
+
+
+17111 for(uint32_t i = 0; i < heapCount; ++i, ++outBudget)
+
+17113 const uint32_t heapIndex = firstHeap + i;
+
+17115 outBudget->
blockBytes = m_Budget.m_BlockBytes[heapIndex];
+
+
+
+17119 outBudget->
budget = m_MemProps.memoryHeaps[heapIndex].size * 8 / 10;
+
+
+
+
+17124 static const uint32_t VMA_VENDOR_ID_AMD = 4098;
+
+17126 VkResult VmaAllocator_T::DefragmentationBegin(
+
+
+
+
+
+
+
+
-17136 VkResult res = (*pContext)->Defragment(
-
-
-
-
-17141 if(res != VK_NOT_READY)
-
-17143 vma_delete(
this, *pContext);
-17144 *pContext = VMA_NULL;
-
-
-
-
-
-17150 VkResult VmaAllocator_T::DefragmentationEnd(
-
-
-17153 vma_delete(
this, context);
-
+17136 *pContext = vma_new(
this, VmaDefragmentationContext_T)(
+17137 this, m_CurrentFrameIndex.load(), info.
flags, pStats);
+
+
+17140 (*pContext)->AddAllocations(
+
+
+17143 VkResult res = (*pContext)->Defragment(
+
+
+
+
+17148 if(res != VK_NOT_READY)
+
+17150 vma_delete(
this, *pContext);
+17151 *pContext = VMA_NULL;
+
+
+
-17157 VkResult VmaAllocator_T::DefragmentationPassBegin(
-
-
-
-17161 return context->DefragmentPassBegin(pInfo);
+17157 VkResult VmaAllocator_T::DefragmentationEnd(
+
+
+17160 vma_delete(
this, context);
+
-17163 VkResult VmaAllocator_T::DefragmentationPassEnd(
-
-
-17166 return context->DefragmentPassEnd();
-
-
-
-
-
-17172 if(hAllocation->CanBecomeLost())
-
-
-
-
-
-17178 const uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
-17179 uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
-
-
-17182 if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST)
-
-
-
-17186 pAllocationInfo->
offset = 0;
-17187 pAllocationInfo->
size = hAllocation->GetSize();
-
-17189 pAllocationInfo->
pUserData = hAllocation->GetUserData();
-
-
-17192 else if(localLastUseFrameIndex == localCurrFrameIndex)
-
-17194 pAllocationInfo->
memoryType = hAllocation->GetMemoryTypeIndex();
-17195 pAllocationInfo->
deviceMemory = hAllocation->GetMemory();
-17196 pAllocationInfo->
offset = hAllocation->GetOffset();
-17197 pAllocationInfo->
size = hAllocation->GetSize();
-
-17199 pAllocationInfo->
pUserData = hAllocation->GetUserData();
-
-
-
-
-17204 if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
-
-17206 localLastUseFrameIndex = localCurrFrameIndex;
-
+
+17164 VkResult VmaAllocator_T::DefragmentationPassBegin(
+
+
+
+17168 return context->DefragmentPassBegin(pInfo);
+
+17170 VkResult VmaAllocator_T::DefragmentationPassEnd(
+
+
+17173 return context->DefragmentPassEnd();
+
+
+
+
+
+17179 if(hAllocation->CanBecomeLost())
+
+
+
+
+
+17185 const uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
+17186 uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
+
+
+17189 if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST)
+
+
+
+17193 pAllocationInfo->
offset = 0;
+17194 pAllocationInfo->
size = hAllocation->GetSize();
+
+17196 pAllocationInfo->
pUserData = hAllocation->GetUserData();
+
+
+17199 else if(localLastUseFrameIndex == localCurrFrameIndex)
+
+17201 pAllocationInfo->
memoryType = hAllocation->GetMemoryTypeIndex();
+17202 pAllocationInfo->
deviceMemory = hAllocation->GetMemory();
+17203 pAllocationInfo->
offset = hAllocation->GetOffset();
+17204 pAllocationInfo->
size = hAllocation->GetSize();
+
+17206 pAllocationInfo->
pUserData = hAllocation->GetUserData();
+
-
-
-
-
-17213 #if VMA_STATS_STRING_ENABLED
-17214 uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
-17215 uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
-
-
-17218 VMA_ASSERT(localLastUseFrameIndex != VMA_FRAME_INDEX_LOST);
-17219 if(localLastUseFrameIndex == localCurrFrameIndex)
-
-
-
-
-
-17225 if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
-
-17227 localLastUseFrameIndex = localCurrFrameIndex;
-
+
+
+17211 if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
+
+17213 localLastUseFrameIndex = localCurrFrameIndex;
+
+
+
+
+
+
+17220 #if VMA_STATS_STRING_ENABLED
+17221 uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
+17222 uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
+
+
+17225 VMA_ASSERT(localLastUseFrameIndex != VMA_FRAME_INDEX_LOST);
+17226 if(localLastUseFrameIndex == localCurrFrameIndex)
+
+
-
-
-
-17233 pAllocationInfo->
memoryType = hAllocation->GetMemoryTypeIndex();
-17234 pAllocationInfo->
deviceMemory = hAllocation->GetMemory();
-17235 pAllocationInfo->
offset = hAllocation->GetOffset();
-17236 pAllocationInfo->
size = hAllocation->GetSize();
-17237 pAllocationInfo->
pMappedData = hAllocation->GetMappedData();
-17238 pAllocationInfo->
pUserData = hAllocation->GetUserData();
-
-
-
-17242 bool VmaAllocator_T::TouchAllocation(
VmaAllocation hAllocation)
-
-
-17245 if(hAllocation->CanBecomeLost())
-
-17247 uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
-17248 uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
-
-
-17251 if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST)
-
-
-
-17255 else if(localLastUseFrameIndex == localCurrFrameIndex)
-
-
-
-
-
-17261 if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
-
-17263 localLastUseFrameIndex = localCurrFrameIndex;
-
+
+
+17232 if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
+
+17234 localLastUseFrameIndex = localCurrFrameIndex;
+
+
+
+
+
+17240 pAllocationInfo->
memoryType = hAllocation->GetMemoryTypeIndex();
+17241 pAllocationInfo->
deviceMemory = hAllocation->GetMemory();
+17242 pAllocationInfo->
offset = hAllocation->GetOffset();
+17243 pAllocationInfo->
size = hAllocation->GetSize();
+17244 pAllocationInfo->
pMappedData = hAllocation->GetMappedData();
+17245 pAllocationInfo->
pUserData = hAllocation->GetUserData();
+
+
+
+17249 bool VmaAllocator_T::TouchAllocation(
VmaAllocation hAllocation)
+
+
+17252 if(hAllocation->CanBecomeLost())
+
+17254 uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
+17255 uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
+
+
+17258 if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST)
+
+
+
+17262 else if(localLastUseFrameIndex == localCurrFrameIndex)
+
+
-
-
-
-
-17270 #if VMA_STATS_STRING_ENABLED
-17271 uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
-17272 uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
-
-
-17275 VMA_ASSERT(localLastUseFrameIndex != VMA_FRAME_INDEX_LOST);
-17276 if(localLastUseFrameIndex == localCurrFrameIndex)
-
-
-
-
-
-17282 if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
-
-17284 localLastUseFrameIndex = localCurrFrameIndex;
-
+
+
+17268 if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
+
+17270 localLastUseFrameIndex = localCurrFrameIndex;
+
+
+
+
+
+
+17277 #if VMA_STATS_STRING_ENABLED
+17278 uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
+17279 uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
+
+
+17282 VMA_ASSERT(localLastUseFrameIndex != VMA_FRAME_INDEX_LOST);
+17283 if(localLastUseFrameIndex == localCurrFrameIndex)
+
+
-
-
-
-
-
-
-
-
-
-17296 VMA_DEBUG_LOG(
" CreatePool: MemoryTypeIndex=%u, flags=%u", pCreateInfo->
memoryTypeIndex, pCreateInfo->
flags);
-
-
-
-
-
-
-
-
-
-17306 return VK_ERROR_INITIALIZATION_FAILED;
-
-
-
-17310 ((1u << pCreateInfo->
memoryTypeIndex) & m_GlobalMemoryTypeBits) == 0)
-
-17312 return VK_ERROR_FEATURE_NOT_PRESENT;
-
-
-17315 const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(newCreateInfo.
memoryTypeIndex);
-
-17317 *pPool = vma_new(
this, VmaPool_T)(
this, newCreateInfo, preferredBlockSize);
-
-17319 VkResult res = (*pPool)->m_BlockVector.CreateMinBlocks();
-17320 if(res != VK_SUCCESS)
-
-17322 vma_delete(
this, *pPool);
-
-
-
-
-
-
-17329 VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
-17330 (*pPool)->SetId(m_NextPoolId++);
-17331 m_Pools.PushBack(*pPool);
-
-
-
-
-
-17337 void VmaAllocator_T::DestroyPool(
VmaPool pool)
-
-
-
-17341 VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
-17342 m_Pools.Remove(pool);
+
+
+17289 if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
+
+17291 localLastUseFrameIndex = localCurrFrameIndex;
+
+
+
+
+
+
+
+
+
+
+
+17303 VMA_DEBUG_LOG(
" CreatePool: MemoryTypeIndex=%u, flags=%u", pCreateInfo->
memoryTypeIndex, pCreateInfo->
flags);
+
+
+
+
+
+
+
+
+
+17313 return VK_ERROR_INITIALIZATION_FAILED;
+
+
+
+17317 ((1u << pCreateInfo->
memoryTypeIndex) & m_GlobalMemoryTypeBits) == 0)
+
+17319 return VK_ERROR_FEATURE_NOT_PRESENT;
+
+
+
+
+
+
+17326 const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(newCreateInfo.
memoryTypeIndex);
+
+17328 *pPool = vma_new(
this, VmaPool_T)(
this, newCreateInfo, preferredBlockSize);
+
+17330 VkResult res = (*pPool)->m_BlockVector.CreateMinBlocks();
+17331 if(res != VK_SUCCESS)
+
+17333 vma_delete(
this, *pPool);
+
+
+
+
+
+
+17340 VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
+17341 (*pPool)->SetId(m_NextPoolId++);
+17342 m_Pools.PushBack(*pPool);
-17345 vma_delete(
this, pool);
+
-
+17348 void VmaAllocator_T::DestroyPool(
VmaPool pool)
-17350 pool->m_BlockVector.GetPoolStats(pPoolStats);
-
-
-17353 void VmaAllocator_T::SetCurrentFrameIndex(uint32_t frameIndex)
-
-17355 m_CurrentFrameIndex.store(frameIndex);
-
-17357 #if VMA_MEMORY_BUDGET
-17358 if(m_UseExtMemoryBudget)
-
-17360 UpdateVulkanBudget();
-
-
-
-
-17365 void VmaAllocator_T::MakePoolAllocationsLost(
-
-17367 size_t* pLostAllocationCount)
-
-17369 hPool->m_BlockVector.MakePoolAllocationsLost(
-17370 m_CurrentFrameIndex.load(),
-17371 pLostAllocationCount);
-
-
-17374 VkResult VmaAllocator_T::CheckPoolCorruption(
VmaPool hPool)
-
-17376 return hPool->m_BlockVector.CheckCorruption();
-
-
-17379 VkResult VmaAllocator_T::CheckCorruption(uint32_t memoryTypeBits)
-
-17381 VkResult finalRes = VK_ERROR_FEATURE_NOT_PRESENT;
-
-
-17384 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
-
-17386 if(((1u << memTypeIndex) & memoryTypeBits) != 0)
-
-17388 VmaBlockVector*
const pBlockVector = m_pBlockVectors[memTypeIndex];
-17389 VMA_ASSERT(pBlockVector);
-17390 VkResult localRes = pBlockVector->CheckCorruption();
-
-
-17393 case VK_ERROR_FEATURE_NOT_PRESENT:
-
-
-17396 finalRes = VK_SUCCESS;
-
-
-
-
-
-
-
-
-
-17406 VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
-17407 for(
VmaPool pool = m_Pools.Front(); pool != VMA_NULL; pool = m_Pools.GetNext(pool))
-
-17409 if(((1u << pool->m_BlockVector.GetMemoryTypeIndex()) & memoryTypeBits) != 0)
-
-17411 VkResult localRes = pool->m_BlockVector.CheckCorruption();
-
-
-17414 case VK_ERROR_FEATURE_NOT_PRESENT:
-
-
-17417 finalRes = VK_SUCCESS;
-
-
-
-
-
-
-
-
-
-
-
-17429 void VmaAllocator_T::CreateLostAllocation(
VmaAllocation* pAllocation)
-
-17431 *pAllocation = m_AllocationObjectAllocator.Allocate(VMA_FRAME_INDEX_LOST,
false);
-17432 (*pAllocation)->InitLost();
-
-
-
-17436 template<
typename T>
-17437 struct AtomicTransactionalIncrement
-
-
-17440 typedef std::atomic<T> AtomicT;
-17441 ~AtomicTransactionalIncrement()
-
-
-
-
-17446 T Increment(AtomicT* atomic)
-
-
-17449 return m_Atomic->fetch_add(1);
-
-
-
-17453 m_Atomic =
nullptr;
-
-
-
-17457 AtomicT* m_Atomic =
nullptr;
-
-
-17460 VkResult VmaAllocator_T::AllocateVulkanMemory(
const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory)
-
-17462 AtomicTransactionalIncrement<uint32_t> deviceMemoryCountIncrement;
-17463 const uint64_t prevDeviceMemoryCount = deviceMemoryCountIncrement.Increment(&m_DeviceMemoryCount);
-17464 #if VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT
-17465 if(prevDeviceMemoryCount >= m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount)
-
-17467 return VK_ERROR_TOO_MANY_OBJECTS;
-
-
+
+
+17352 VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
+17353 m_Pools.Remove(pool);
+
+
+17356 vma_delete(
this, pool);
+
+
+
+
+17361 pool->m_BlockVector.GetPoolStats(pPoolStats);
+
+
+17364 void VmaAllocator_T::SetCurrentFrameIndex(uint32_t frameIndex)
+
+17366 m_CurrentFrameIndex.store(frameIndex);
+
+17368 #if VMA_MEMORY_BUDGET
+17369 if(m_UseExtMemoryBudget)
+
+17371 UpdateVulkanBudget();
+
+
+
+
+17376 void VmaAllocator_T::MakePoolAllocationsLost(
+
+17378 size_t* pLostAllocationCount)
+
+17380 hPool->m_BlockVector.MakePoolAllocationsLost(
+17381 m_CurrentFrameIndex.load(),
+17382 pLostAllocationCount);
+
+
+17385 VkResult VmaAllocator_T::CheckPoolCorruption(
VmaPool hPool)
+
+17387 return hPool->m_BlockVector.CheckCorruption();
+
+
+17390 VkResult VmaAllocator_T::CheckCorruption(uint32_t memoryTypeBits)
+
+17392 VkResult finalRes = VK_ERROR_FEATURE_NOT_PRESENT;
+
+
+17395 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+
+17397 if(((1u << memTypeIndex) & memoryTypeBits) != 0)
+
+17399 VmaBlockVector*
const pBlockVector = m_pBlockVectors[memTypeIndex];
+17400 VMA_ASSERT(pBlockVector);
+17401 VkResult localRes = pBlockVector->CheckCorruption();
+
+
+17404 case VK_ERROR_FEATURE_NOT_PRESENT:
+
+
+17407 finalRes = VK_SUCCESS;
+
+
+
+
+
+
+
+
+
+17417 VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
+17418 for(
VmaPool pool = m_Pools.Front(); pool != VMA_NULL; pool = m_Pools.GetNext(pool))
+
+17420 if(((1u << pool->m_BlockVector.GetMemoryTypeIndex()) & memoryTypeBits) != 0)
+
+17422 VkResult localRes = pool->m_BlockVector.CheckCorruption();
+
+
+17425 case VK_ERROR_FEATURE_NOT_PRESENT:
+
+
+17428 finalRes = VK_SUCCESS;
+
+
+
+
+
+
+
+
+
+
+
+17440 void VmaAllocator_T::CreateLostAllocation(
VmaAllocation* pAllocation)
+
+17442 *pAllocation = m_AllocationObjectAllocator.Allocate(VMA_FRAME_INDEX_LOST,
false);
+17443 (*pAllocation)->InitLost();
+
+
+
+17447 template<
typename T>
+17448 struct AtomicTransactionalIncrement
+
+
+17451 typedef std::atomic<T> AtomicT;
+17452 ~AtomicTransactionalIncrement()
+
+
+
+
+17457 T Increment(AtomicT* atomic)
+
+
+17460 return m_Atomic->fetch_add(1);
+
+
+
+17464 m_Atomic =
nullptr;
+
+
+
+17468 AtomicT* m_Atomic =
nullptr;
+
-17471 const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(pAllocateInfo->memoryTypeIndex);
-
-
-17474 if((m_HeapSizeLimitMask & (1u << heapIndex)) != 0)
-
-17476 const VkDeviceSize heapSize = m_MemProps.memoryHeaps[heapIndex].size;
-17477 VkDeviceSize blockBytes = m_Budget.m_BlockBytes[heapIndex];
-
-
-17480 const VkDeviceSize blockBytesAfterAllocation = blockBytes + pAllocateInfo->allocationSize;
-17481 if(blockBytesAfterAllocation > heapSize)
-
-17483 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
-
-17485 if(m_Budget.m_BlockBytes[heapIndex].compare_exchange_strong(blockBytes, blockBytesAfterAllocation))
-
-
-
-
-
-
-
-17493 m_Budget.m_BlockBytes[heapIndex] += pAllocateInfo->allocationSize;
-
-
-
-17497 VkResult res = (*m_VulkanFunctions.vkAllocateMemory)(m_hDevice, pAllocateInfo, GetAllocationCallbacks(), pMemory);
-
-17499 if(res == VK_SUCCESS)
-
-17501 #if VMA_MEMORY_BUDGET
-17502 ++m_Budget.m_OperationsSinceBudgetFetch;
-
-
-
-17506 if(m_DeviceMemoryCallbacks.
pfnAllocate != VMA_NULL)
-
-17508 (*m_DeviceMemoryCallbacks.
pfnAllocate)(
this, pAllocateInfo->memoryTypeIndex, *pMemory, pAllocateInfo->allocationSize, m_DeviceMemoryCallbacks.
pUserData);
-
-
-17511 deviceMemoryCountIncrement.Commit();
-
-
-
-17515 m_Budget.m_BlockBytes[heapIndex] -= pAllocateInfo->allocationSize;
-
-
-
-
-
-17521 void VmaAllocator_T::FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory)
-
-
-17524 if(m_DeviceMemoryCallbacks.
pfnFree != VMA_NULL)
+17471 VkResult VmaAllocator_T::AllocateVulkanMemory(
const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory)
+
+17473 AtomicTransactionalIncrement<uint32_t> deviceMemoryCountIncrement;
+17474 const uint64_t prevDeviceMemoryCount = deviceMemoryCountIncrement.Increment(&m_DeviceMemoryCount);
+17475 #if VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT
+17476 if(prevDeviceMemoryCount >= m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount)
+
+17478 return VK_ERROR_TOO_MANY_OBJECTS;
+
+
+
+17482 const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(pAllocateInfo->memoryTypeIndex);
+
+
+17485 if((m_HeapSizeLimitMask & (1u << heapIndex)) != 0)
+
+17487 const VkDeviceSize heapSize = m_MemProps.memoryHeaps[heapIndex].size;
+17488 VkDeviceSize blockBytes = m_Budget.m_BlockBytes[heapIndex];
+
+
+17491 const VkDeviceSize blockBytesAfterAllocation = blockBytes + pAllocateInfo->allocationSize;
+17492 if(blockBytesAfterAllocation > heapSize)
+
+17494 return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+17496 if(m_Budget.m_BlockBytes[heapIndex].compare_exchange_strong(blockBytes, blockBytesAfterAllocation))
+
+
+
+
+
+
+
+17504 m_Budget.m_BlockBytes[heapIndex] += pAllocateInfo->allocationSize;
+
+
+
+17508 VkResult res = (*m_VulkanFunctions.vkAllocateMemory)(m_hDevice, pAllocateInfo, GetAllocationCallbacks(), pMemory);
+
+17510 if(res == VK_SUCCESS)
+
+17512 #if VMA_MEMORY_BUDGET
+17513 ++m_Budget.m_OperationsSinceBudgetFetch;
+
+
+
+17517 if(m_DeviceMemoryCallbacks.
pfnAllocate != VMA_NULL)
+
+17519 (*m_DeviceMemoryCallbacks.
pfnAllocate)(
this, pAllocateInfo->memoryTypeIndex, *pMemory, pAllocateInfo->allocationSize, m_DeviceMemoryCallbacks.
pUserData);
+
+
+17522 deviceMemoryCountIncrement.Commit();
+
+
-17526 (*m_DeviceMemoryCallbacks.
pfnFree)(
this, memoryType, hMemory, size, m_DeviceMemoryCallbacks.
pUserData);
+17526 m_Budget.m_BlockBytes[heapIndex] -= pAllocateInfo->allocationSize;
-
-17530 (*m_VulkanFunctions.vkFreeMemory)(m_hDevice, hMemory, GetAllocationCallbacks());
+
+
-17532 m_Budget.m_BlockBytes[MemoryTypeIndexToHeapIndex(memoryType)] -= size;
-
-17534 --m_DeviceMemoryCount;
-
-
-17537 VkResult VmaAllocator_T::BindVulkanBuffer(
-17538 VkDeviceMemory memory,
-17539 VkDeviceSize memoryOffset,
-
-
-
-17543 if(pNext != VMA_NULL)
-
-17545 #if VMA_VULKAN_VERSION >= 1001000 || VMA_BIND_MEMORY2
-17546 if((m_UseKhrBindMemory2 || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
-17547 m_VulkanFunctions.vkBindBufferMemory2KHR != VMA_NULL)
-
-17549 VkBindBufferMemoryInfoKHR bindBufferMemoryInfo = { VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR };
-17550 bindBufferMemoryInfo.pNext = pNext;
-17551 bindBufferMemoryInfo.buffer = buffer;
-17552 bindBufferMemoryInfo.memory = memory;
-17553 bindBufferMemoryInfo.memoryOffset = memoryOffset;
-17554 return (*m_VulkanFunctions.vkBindBufferMemory2KHR)(m_hDevice, 1, &bindBufferMemoryInfo);
-
-
-
-
-17559 return VK_ERROR_EXTENSION_NOT_PRESENT;
-
-
-
-
-17564 return (*m_VulkanFunctions.vkBindBufferMemory)(m_hDevice, buffer, memory, memoryOffset);
-
-
-
-17568 VkResult VmaAllocator_T::BindVulkanImage(
-17569 VkDeviceMemory memory,
-17570 VkDeviceSize memoryOffset,
-
-
-
-17574 if(pNext != VMA_NULL)
-
-17576 #if VMA_VULKAN_VERSION >= 1001000 || VMA_BIND_MEMORY2
-17577 if((m_UseKhrBindMemory2 || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
-17578 m_VulkanFunctions.vkBindImageMemory2KHR != VMA_NULL)
-
-17580 VkBindImageMemoryInfoKHR bindBufferMemoryInfo = { VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR };
-17581 bindBufferMemoryInfo.pNext = pNext;
-17582 bindBufferMemoryInfo.image = image;
-17583 bindBufferMemoryInfo.memory = memory;
-17584 bindBufferMemoryInfo.memoryOffset = memoryOffset;
-17585 return (*m_VulkanFunctions.vkBindImageMemory2KHR)(m_hDevice, 1, &bindBufferMemoryInfo);
-
-
-
-
-17590 return VK_ERROR_EXTENSION_NOT_PRESENT;
-
-
-
-
-17595 return (*m_VulkanFunctions.vkBindImageMemory)(m_hDevice, image, memory, memoryOffset);
-
-
-
-17599 VkResult VmaAllocator_T::Map(
VmaAllocation hAllocation,
void** ppData)
-
-17601 if(hAllocation->CanBecomeLost())
-
-17603 return VK_ERROR_MEMORY_MAP_FAILED;
-
-
-17606 switch(hAllocation->GetType())
-
-17608 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
-
-17610 VmaDeviceMemoryBlock*
const pBlock = hAllocation->GetBlock();
-17611 char *pBytes = VMA_NULL;
-17612 VkResult res = pBlock->Map(
this, 1, (
void**)&pBytes);
-17613 if(res == VK_SUCCESS)
-
-17615 *ppData = pBytes + (ptrdiff_t)hAllocation->GetOffset();
-17616 hAllocation->BlockAllocMap();
-
-
-
-17620 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
-17621 return hAllocation->DedicatedAllocMap(
this, ppData);
-
-
-17624 return VK_ERROR_MEMORY_MAP_FAILED;
-
-
-
-
-
-17630 switch(hAllocation->GetType())
-
-17632 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
-
-17634 VmaDeviceMemoryBlock*
const pBlock = hAllocation->GetBlock();
-17635 hAllocation->BlockAllocUnmap();
-17636 pBlock->Unmap(
this, 1);
-
-
-17639 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
-17640 hAllocation->DedicatedAllocUnmap(
this);
-
-
-
-
-
-
-17647 VkResult VmaAllocator_T::BindBufferMemory(
-
-17649 VkDeviceSize allocationLocalOffset,
-
-
-
-17653 VkResult res = VK_SUCCESS;
-17654 switch(hAllocation->GetType())
-
-17656 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
-17657 res = BindVulkanBuffer(hAllocation->GetMemory(), allocationLocalOffset, hBuffer, pNext);
-
-17659 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
-
-17661 VmaDeviceMemoryBlock*
const pBlock = hAllocation->GetBlock();
-17662 VMA_ASSERT(pBlock &&
"Binding buffer to allocation that doesn't belong to any block. Is the allocation lost?");
-17663 res = pBlock->BindBufferMemory(
this, hAllocation, allocationLocalOffset, hBuffer, pNext);
-
-
-
-
-
-
-
-
-17672 VkResult VmaAllocator_T::BindImageMemory(
-
-17674 VkDeviceSize allocationLocalOffset,
-
-
-
-17678 VkResult res = VK_SUCCESS;
-17679 switch(hAllocation->GetType())
-
-17681 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
-17682 res = BindVulkanImage(hAllocation->GetMemory(), allocationLocalOffset, hImage, pNext);
-
-17684 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
-
-17686 VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock();
-17687 VMA_ASSERT(pBlock &&
"Binding image to allocation that doesn't belong to any block. Is the allocation lost?");
-17688 res = pBlock->BindImageMemory(
this, hAllocation, allocationLocalOffset, hImage, pNext);
-
-
-
-
-
-
-
-
-17697 VkResult VmaAllocator_T::FlushOrInvalidateAllocation(
-
-17699 VkDeviceSize offset, VkDeviceSize size,
-17700 VMA_CACHE_OPERATION op)
-
-17702 VkResult res = VK_SUCCESS;
-
-17704 VkMappedMemoryRange memRange = {};
-17705 if(GetFlushOrInvalidateRange(hAllocation, offset, size, memRange))
-
-
-
-17709 case VMA_CACHE_FLUSH:
-17710 res = (*GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hDevice, 1, &memRange);
-
-17712 case VMA_CACHE_INVALIDATE:
-17713 res = (*GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hDevice, 1, &memRange);
-
-
-
-
-
-
-
-
-
-17723 VkResult VmaAllocator_T::FlushOrInvalidateAllocations(
-17724 uint32_t allocationCount,
-
-17726 const VkDeviceSize* offsets,
const VkDeviceSize* sizes,
-17727 VMA_CACHE_OPERATION op)
-
-17729 typedef VmaStlAllocator<VkMappedMemoryRange> RangeAllocator;
-17730 typedef VmaSmallVector<VkMappedMemoryRange, RangeAllocator, 16> RangeVector;
-17731 RangeVector ranges = RangeVector(RangeAllocator(GetAllocationCallbacks()));
-
-17733 for(uint32_t allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
-
-
-17736 const VkDeviceSize offset = offsets != VMA_NULL ? offsets[allocIndex] : 0;
-17737 const VkDeviceSize size = sizes != VMA_NULL ? sizes[allocIndex] : VK_WHOLE_SIZE;
-17738 VkMappedMemoryRange newRange;
-17739 if(GetFlushOrInvalidateRange(alloc, offset, size, newRange))
-
-17741 ranges.push_back(newRange);
-
-
-
-17745 VkResult res = VK_SUCCESS;
-17746 if(!ranges.empty())
-
-
-
-17750 case VMA_CACHE_FLUSH:
-17751 res = (*GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hDevice, (uint32_t)ranges.size(), ranges.data());
-
-17753 case VMA_CACHE_INVALIDATE:
-17754 res = (*GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hDevice, (uint32_t)ranges.size(), ranges.data());
-
-
-
-
-
-
-
-
-
-17764 void VmaAllocator_T::FreeDedicatedMemory(
const VmaAllocation allocation)
-
-17766 VMA_ASSERT(allocation && allocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
-
-17768 const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
-
-17770 VmaMutexLockWrite lock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
-17771 DedicatedAllocationLinkedList& dedicatedAllocations = m_DedicatedAllocations[memTypeIndex];
-17772 dedicatedAllocations.Remove(allocation);
-
+17532 void VmaAllocator_T::FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory)
+
+
+17535 if(m_DeviceMemoryCallbacks.
pfnFree != VMA_NULL)
+
+17537 (*m_DeviceMemoryCallbacks.
pfnFree)(
this, memoryType, hMemory, size, m_DeviceMemoryCallbacks.
pUserData);
+
+
+
+17541 (*m_VulkanFunctions.vkFreeMemory)(m_hDevice, hMemory, GetAllocationCallbacks());
+
+17543 m_Budget.m_BlockBytes[MemoryTypeIndexToHeapIndex(memoryType)] -= size;
+
+17545 --m_DeviceMemoryCount;
+
+
+17548 VkResult VmaAllocator_T::BindVulkanBuffer(
+17549 VkDeviceMemory memory,
+17550 VkDeviceSize memoryOffset,
+
+
+
+17554 if(pNext != VMA_NULL)
+
+17556 #if VMA_VULKAN_VERSION >= 1001000 || VMA_BIND_MEMORY2
+17557 if((m_UseKhrBindMemory2 || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
+17558 m_VulkanFunctions.vkBindBufferMemory2KHR != VMA_NULL)
+
+17560 VkBindBufferMemoryInfoKHR bindBufferMemoryInfo = { VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR };
+17561 bindBufferMemoryInfo.pNext = pNext;
+17562 bindBufferMemoryInfo.buffer = buffer;
+17563 bindBufferMemoryInfo.memory = memory;
+17564 bindBufferMemoryInfo.memoryOffset = memoryOffset;
+17565 return (*m_VulkanFunctions.vkBindBufferMemory2KHR)(m_hDevice, 1, &bindBufferMemoryInfo);
+
+
+
+
+17570 return VK_ERROR_EXTENSION_NOT_PRESENT;
+
+
+
+
+17575 return (*m_VulkanFunctions.vkBindBufferMemory)(m_hDevice, buffer, memory, memoryOffset);
+
+
+
+17579 VkResult VmaAllocator_T::BindVulkanImage(
+17580 VkDeviceMemory memory,
+17581 VkDeviceSize memoryOffset,
+
+
+
+17585 if(pNext != VMA_NULL)
+
+17587 #if VMA_VULKAN_VERSION >= 1001000 || VMA_BIND_MEMORY2
+17588 if((m_UseKhrBindMemory2 || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
+17589 m_VulkanFunctions.vkBindImageMemory2KHR != VMA_NULL)
+
+17591 VkBindImageMemoryInfoKHR bindBufferMemoryInfo = { VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR };
+17592 bindBufferMemoryInfo.pNext = pNext;
+17593 bindBufferMemoryInfo.image = image;
+17594 bindBufferMemoryInfo.memory = memory;
+17595 bindBufferMemoryInfo.memoryOffset = memoryOffset;
+17596 return (*m_VulkanFunctions.vkBindImageMemory2KHR)(m_hDevice, 1, &bindBufferMemoryInfo);
+
+
+
+
+17601 return VK_ERROR_EXTENSION_NOT_PRESENT;
+
+
+
+
+17606 return (*m_VulkanFunctions.vkBindImageMemory)(m_hDevice, image, memory, memoryOffset);
+
+
+
+17610 VkResult VmaAllocator_T::Map(
VmaAllocation hAllocation,
void** ppData)
+
+17612 if(hAllocation->CanBecomeLost())
+
+17614 return VK_ERROR_MEMORY_MAP_FAILED;
+
+
+17617 switch(hAllocation->GetType())
+
+17619 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+
+17621 VmaDeviceMemoryBlock*
const pBlock = hAllocation->GetBlock();
+17622 char *pBytes = VMA_NULL;
+17623 VkResult res = pBlock->Map(
this, 1, (
void**)&pBytes);
+17624 if(res == VK_SUCCESS)
+
+17626 *ppData = pBytes + (ptrdiff_t)hAllocation->GetOffset();
+17627 hAllocation->BlockAllocMap();
+
+
+
+17631 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+17632 return hAllocation->DedicatedAllocMap(
this, ppData);
+
+
+17635 return VK_ERROR_MEMORY_MAP_FAILED;
+
+
+
+
+
+17641 switch(hAllocation->GetType())
+
+17643 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+
+17645 VmaDeviceMemoryBlock*
const pBlock = hAllocation->GetBlock();
+17646 hAllocation->BlockAllocUnmap();
+17647 pBlock->Unmap(
this, 1);
+
+
+17650 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+17651 hAllocation->DedicatedAllocUnmap(
this);
+
+
+
+
+
+
+17658 VkResult VmaAllocator_T::BindBufferMemory(
+
+17660 VkDeviceSize allocationLocalOffset,
+
+
+
+17664 VkResult res = VK_SUCCESS;
+17665 switch(hAllocation->GetType())
+
+17667 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+17668 res = BindVulkanBuffer(hAllocation->GetMemory(), allocationLocalOffset, hBuffer, pNext);
+
+17670 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+
+17672 VmaDeviceMemoryBlock*
const pBlock = hAllocation->GetBlock();
+17673 VMA_ASSERT(pBlock &&
"Binding buffer to allocation that doesn't belong to any block. Is the allocation lost?");
+17674 res = pBlock->BindBufferMemory(
this, hAllocation, allocationLocalOffset, hBuffer, pNext);
+
+
+
+
+
+
+
+
+17683 VkResult VmaAllocator_T::BindImageMemory(
+
+17685 VkDeviceSize allocationLocalOffset,
+
+
+
+17689 VkResult res = VK_SUCCESS;
+17690 switch(hAllocation->GetType())
+
+17692 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+17693 res = BindVulkanImage(hAllocation->GetMemory(), allocationLocalOffset, hImage, pNext);
+
+17695 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+
+17697 VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock();
+17698 VMA_ASSERT(pBlock &&
"Binding image to allocation that doesn't belong to any block. Is the allocation lost?");
+17699 res = pBlock->BindImageMemory(
this, hAllocation, allocationLocalOffset, hImage, pNext);
+
+
+
+
+
+
+
+
+17708 VkResult VmaAllocator_T::FlushOrInvalidateAllocation(
+
+17710 VkDeviceSize offset, VkDeviceSize size,
+17711 VMA_CACHE_OPERATION op)
+
+17713 VkResult res = VK_SUCCESS;
+
+17715 VkMappedMemoryRange memRange = {};
+17716 if(GetFlushOrInvalidateRange(hAllocation, offset, size, memRange))
+
+
+
+17720 case VMA_CACHE_FLUSH:
+17721 res = (*GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hDevice, 1, &memRange);
+
+17723 case VMA_CACHE_INVALIDATE:
+17724 res = (*GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hDevice, 1, &memRange);
+
+
+
+
+
+
+
+
+
+17734 VkResult VmaAllocator_T::FlushOrInvalidateAllocations(
+17735 uint32_t allocationCount,
+
+17737 const VkDeviceSize* offsets,
const VkDeviceSize* sizes,
+17738 VMA_CACHE_OPERATION op)
+
+17740 typedef VmaStlAllocator<VkMappedMemoryRange> RangeAllocator;
+17741 typedef VmaSmallVector<VkMappedMemoryRange, RangeAllocator, 16> RangeVector;
+17742 RangeVector ranges = RangeVector(RangeAllocator(GetAllocationCallbacks()));
+
+17744 for(uint32_t allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+
+
+17747 const VkDeviceSize offset = offsets != VMA_NULL ? offsets[allocIndex] : 0;
+17748 const VkDeviceSize size = sizes != VMA_NULL ? sizes[allocIndex] : VK_WHOLE_SIZE;
+17749 VkMappedMemoryRange newRange;
+17750 if(GetFlushOrInvalidateRange(alloc, offset, size, newRange))
+
+17752 ranges.push_back(newRange);
+
+
+
+17756 VkResult res = VK_SUCCESS;
+17757 if(!ranges.empty())
+
+
+
+17761 case VMA_CACHE_FLUSH:
+17762 res = (*GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hDevice, (uint32_t)ranges.size(), ranges.data());
+
+17764 case VMA_CACHE_INVALIDATE:
+17765 res = (*GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hDevice, (uint32_t)ranges.size(), ranges.data());
+
+
+
+
+
+
+
+
-17775 VkDeviceMemory hMemory = allocation->GetMemory();
-
-
-
-
-
-
-
-
-
-
-
-17787 FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory);
-
-17789 VMA_DEBUG_LOG(
" Freed DedicatedMemory MemoryTypeIndex=%u", memTypeIndex);
-
-
-17792 uint32_t VmaAllocator_T::CalculateGpuDefragmentationMemoryTypeBits()
const
-
-17794 VkBufferCreateInfo dummyBufCreateInfo;
-17795 VmaFillGpuDefragmentationBufferCreateInfo(dummyBufCreateInfo);
-
-17797 uint32_t memoryTypeBits = 0;
-
-
-17800 VkBuffer buf = VK_NULL_HANDLE;
-17801 VkResult res = (*GetVulkanFunctions().vkCreateBuffer)(
-17802 m_hDevice, &dummyBufCreateInfo, GetAllocationCallbacks(), &buf);
-17803 if(res == VK_SUCCESS)
-
-
-17806 VkMemoryRequirements memReq;
-17807 (*GetVulkanFunctions().vkGetBufferMemoryRequirements)(m_hDevice, buf, &memReq);
-17808 memoryTypeBits = memReq.memoryTypeBits;
+17775 void VmaAllocator_T::FreeDedicatedMemory(
const VmaAllocation allocation)
+
+17777 VMA_ASSERT(allocation && allocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
+
+17779 const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
+
+17781 VmaMutexLockWrite lock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
+17782 DedicatedAllocationLinkedList& dedicatedAllocations = m_DedicatedAllocations[memTypeIndex];
+17783 dedicatedAllocations.Remove(allocation);
+
+
+17786 VkDeviceMemory hMemory = allocation->GetMemory();
+
+
+
+
+
+
+
+
+
+
+
+17798 FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory);
+
+17800 VMA_DEBUG_LOG(
" Freed DedicatedMemory MemoryTypeIndex=%u", memTypeIndex);
+
+
+17803 uint32_t VmaAllocator_T::CalculateGpuDefragmentationMemoryTypeBits()
const
+
+17805 VkBufferCreateInfo dummyBufCreateInfo;
+17806 VmaFillGpuDefragmentationBufferCreateInfo(dummyBufCreateInfo);
+
+17808 uint32_t memoryTypeBits = 0;
-
-17811 (*GetVulkanFunctions().vkDestroyBuffer)(m_hDevice, buf, GetAllocationCallbacks());
-
-
-17814 return memoryTypeBits;
-
-
-17817 uint32_t VmaAllocator_T::CalculateGlobalMemoryTypeBits()
const
-
-
-17820 VMA_ASSERT(GetMemoryTypeCount() > 0);
-
-17822 uint32_t memoryTypeBits = UINT32_MAX;
-
-17824 if(!m_UseAmdDeviceCoherentMemory)
-
-
-17827 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
-
-17829 if((m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY) != 0)
-
-17831 memoryTypeBits &= ~(1u << memTypeIndex);
-
-
-
-
-17836 return memoryTypeBits;
-
-
-17839 bool VmaAllocator_T::GetFlushOrInvalidateRange(
-
-17841 VkDeviceSize offset, VkDeviceSize size,
-17842 VkMappedMemoryRange& outRange)
const
-
-17844 const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
-17845 if(size > 0 && IsMemoryTypeNonCoherent(memTypeIndex))
-
-17847 const VkDeviceSize nonCoherentAtomSize = m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
-17848 const VkDeviceSize allocationSize = allocation->GetSize();
-17849 VMA_ASSERT(offset <= allocationSize);
-
-17851 outRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
-17852 outRange.pNext = VMA_NULL;
-17853 outRange.memory = allocation->GetMemory();
-
-17855 switch(allocation->GetType())
-
-17857 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
-17858 outRange.offset = VmaAlignDown(offset, nonCoherentAtomSize);
-17859 if(size == VK_WHOLE_SIZE)
-
-17861 outRange.size = allocationSize - outRange.offset;
-
-
-
-17865 VMA_ASSERT(offset + size <= allocationSize);
-17866 outRange.size = VMA_MIN(
-17867 VmaAlignUp(size + (offset - outRange.offset), nonCoherentAtomSize),
-17868 allocationSize - outRange.offset);
-
-
-17871 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
-
-
-17874 outRange.offset = VmaAlignDown(offset, nonCoherentAtomSize);
-17875 if(size == VK_WHOLE_SIZE)
-
-17877 size = allocationSize - offset;
-
-
-
-17881 VMA_ASSERT(offset + size <= allocationSize);
-
-17883 outRange.size = VmaAlignUp(size + (offset - outRange.offset), nonCoherentAtomSize);
-
-
-17886 const VkDeviceSize allocationOffset = allocation->GetOffset();
-17887 VMA_ASSERT(allocationOffset % nonCoherentAtomSize == 0);
-17888 const VkDeviceSize blockSize = allocation->GetBlock()->m_pMetadata->GetSize();
-17889 outRange.offset += allocationOffset;
-17890 outRange.size = VMA_MIN(outRange.size, blockSize - outRange.offset);
-
-
-
-
-
-
-
-
-
-
-
-17902 #if VMA_MEMORY_BUDGET
-
-17904 void VmaAllocator_T::UpdateVulkanBudget()
-
-17906 VMA_ASSERT(m_UseExtMemoryBudget);
-
-17908 VkPhysicalDeviceMemoryProperties2KHR memProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR };
-
-17910 VkPhysicalDeviceMemoryBudgetPropertiesEXT budgetProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT };
-17911 VmaPnextChainPushFront(&memProps, &budgetProps);
+
+17811 VkBuffer buf = VK_NULL_HANDLE;
+17812 VkResult res = (*GetVulkanFunctions().vkCreateBuffer)(
+17813 m_hDevice, &dummyBufCreateInfo, GetAllocationCallbacks(), &buf);
+17814 if(res == VK_SUCCESS)
+
+
+17817 VkMemoryRequirements memReq;
+17818 (*GetVulkanFunctions().vkGetBufferMemoryRequirements)(m_hDevice, buf, &memReq);
+17819 memoryTypeBits = memReq.memoryTypeBits;
+
+
+17822 (*GetVulkanFunctions().vkDestroyBuffer)(m_hDevice, buf, GetAllocationCallbacks());
+
+
+17825 return memoryTypeBits;
+
+
+17828 uint32_t VmaAllocator_T::CalculateGlobalMemoryTypeBits()
const
+
+
+17831 VMA_ASSERT(GetMemoryTypeCount() > 0);
+
+17833 uint32_t memoryTypeBits = UINT32_MAX;
+
+17835 if(!m_UseAmdDeviceCoherentMemory)
+
+
+17838 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+
+17840 if((m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY) != 0)
+
+17842 memoryTypeBits &= ~(1u << memTypeIndex);
+
+
+
+
+17847 return memoryTypeBits;
+
+
+17850 bool VmaAllocator_T::GetFlushOrInvalidateRange(
+
+17852 VkDeviceSize offset, VkDeviceSize size,
+17853 VkMappedMemoryRange& outRange)
const
+
+17855 const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
+17856 if(size > 0 && IsMemoryTypeNonCoherent(memTypeIndex))
+
+17858 const VkDeviceSize nonCoherentAtomSize = m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
+17859 const VkDeviceSize allocationSize = allocation->GetSize();
+17860 VMA_ASSERT(offset <= allocationSize);
+
+17862 outRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
+17863 outRange.pNext = VMA_NULL;
+17864 outRange.memory = allocation->GetMemory();
+
+17866 switch(allocation->GetType())
+
+17868 case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+17869 outRange.offset = VmaAlignDown(offset, nonCoherentAtomSize);
+17870 if(size == VK_WHOLE_SIZE)
+
+17872 outRange.size = allocationSize - outRange.offset;
+
+
+
+17876 VMA_ASSERT(offset + size <= allocationSize);
+17877 outRange.size = VMA_MIN(
+17878 VmaAlignUp(size + (offset - outRange.offset), nonCoherentAtomSize),
+17879 allocationSize - outRange.offset);
+
+
+17882 case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+
+
+17885 outRange.offset = VmaAlignDown(offset, nonCoherentAtomSize);
+17886 if(size == VK_WHOLE_SIZE)
+
+17888 size = allocationSize - offset;
+
+
+
+17892 VMA_ASSERT(offset + size <= allocationSize);
+
+17894 outRange.size = VmaAlignUp(size + (offset - outRange.offset), nonCoherentAtomSize);
+
+
+17897 const VkDeviceSize allocationOffset = allocation->GetOffset();
+17898 VMA_ASSERT(allocationOffset % nonCoherentAtomSize == 0);
+17899 const VkDeviceSize blockSize = allocation->GetBlock()->m_pMetadata->GetSize();
+17900 outRange.offset += allocationOffset;
+17901 outRange.size = VMA_MIN(outRange.size, blockSize - outRange.offset);
+
+
+
+
+
+
+
+
+
+
-17913 GetVulkanFunctions().vkGetPhysicalDeviceMemoryProperties2KHR(m_PhysicalDevice, &memProps);
+17913 #if VMA_MEMORY_BUDGET
-
-17916 VmaMutexLockWrite lockWrite(m_Budget.m_BudgetMutex, m_UseMutex);
-
-17918 for(uint32_t heapIndex = 0; heapIndex < GetMemoryHeapCount(); ++heapIndex)
-
-17920 m_Budget.m_VulkanUsage[heapIndex] = budgetProps.heapUsage[heapIndex];
-17921 m_Budget.m_VulkanBudget[heapIndex] = budgetProps.heapBudget[heapIndex];
-17922 m_Budget.m_BlockBytesAtBudgetFetch[heapIndex] = m_Budget.m_BlockBytes[heapIndex].load();
+17915 void VmaAllocator_T::UpdateVulkanBudget()
+
+17917 VMA_ASSERT(m_UseExtMemoryBudget);
+
+17919 VkPhysicalDeviceMemoryProperties2KHR memProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR };
+
+17921 VkPhysicalDeviceMemoryBudgetPropertiesEXT budgetProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT };
+17922 VmaPnextChainPushFront(&memProps, &budgetProps);
-
-17925 if(m_Budget.m_VulkanBudget[heapIndex] == 0)
-
-17927 m_Budget.m_VulkanBudget[heapIndex] = m_MemProps.memoryHeaps[heapIndex].size * 8 / 10;
-
-17929 else if(m_Budget.m_VulkanBudget[heapIndex] > m_MemProps.memoryHeaps[heapIndex].size)
-
-17931 m_Budget.m_VulkanBudget[heapIndex] = m_MemProps.memoryHeaps[heapIndex].size;
-
-17933 if(m_Budget.m_VulkanUsage[heapIndex] == 0 && m_Budget.m_BlockBytesAtBudgetFetch[heapIndex] > 0)
-
-17935 m_Budget.m_VulkanUsage[heapIndex] = m_Budget.m_BlockBytesAtBudgetFetch[heapIndex];
-
-
-17938 m_Budget.m_OperationsSinceBudgetFetch = 0;
-
-
-
-
-
-17944 void VmaAllocator_T::FillAllocation(
const VmaAllocation hAllocation, uint8_t pattern)
-
-17946 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS &&
-17947 !hAllocation->CanBecomeLost() &&
-17948 (m_MemProps.memoryTypes[hAllocation->GetMemoryTypeIndex()].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0)
-
-17950 void* pData = VMA_NULL;
-17951 VkResult res = Map(hAllocation, &pData);
-17952 if(res == VK_SUCCESS)
-
-17954 memset(pData, (
int)pattern, (
size_t)hAllocation->GetSize());
-17955 FlushOrInvalidateAllocation(hAllocation, 0, VK_WHOLE_SIZE, VMA_CACHE_FLUSH);
-17956 Unmap(hAllocation);
-
-
-
-17960 VMA_ASSERT(0 &&
"VMA_DEBUG_INITIALIZE_ALLOCATIONS is enabled, but couldn't map memory to fill allocation.");
-
-
-
-
-17965 uint32_t VmaAllocator_T::GetGpuDefragmentationMemoryTypeBits()
-
-17967 uint32_t memoryTypeBits = m_GpuDefragmentationMemoryTypeBits.load();
-17968 if(memoryTypeBits == UINT32_MAX)
-
-17970 memoryTypeBits = CalculateGpuDefragmentationMemoryTypeBits();
-17971 m_GpuDefragmentationMemoryTypeBits.store(memoryTypeBits);
-
-17973 return memoryTypeBits;
+17924 GetVulkanFunctions().vkGetPhysicalDeviceMemoryProperties2KHR(m_PhysicalDevice, &memProps);
+
+
+17927 VmaMutexLockWrite lockWrite(m_Budget.m_BudgetMutex, m_UseMutex);
+
+17929 for(uint32_t heapIndex = 0; heapIndex < GetMemoryHeapCount(); ++heapIndex)
+
+17931 m_Budget.m_VulkanUsage[heapIndex] = budgetProps.heapUsage[heapIndex];
+17932 m_Budget.m_VulkanBudget[heapIndex] = budgetProps.heapBudget[heapIndex];
+17933 m_Budget.m_BlockBytesAtBudgetFetch[heapIndex] = m_Budget.m_BlockBytes[heapIndex].load();
+
+
+17936 if(m_Budget.m_VulkanBudget[heapIndex] == 0)
+
+17938 m_Budget.m_VulkanBudget[heapIndex] = m_MemProps.memoryHeaps[heapIndex].size * 8 / 10;
+
+17940 else if(m_Budget.m_VulkanBudget[heapIndex] > m_MemProps.memoryHeaps[heapIndex].size)
+
+17942 m_Budget.m_VulkanBudget[heapIndex] = m_MemProps.memoryHeaps[heapIndex].size;
+
+17944 if(m_Budget.m_VulkanUsage[heapIndex] == 0 && m_Budget.m_BlockBytesAtBudgetFetch[heapIndex] > 0)
+
+17946 m_Budget.m_VulkanUsage[heapIndex] = m_Budget.m_BlockBytesAtBudgetFetch[heapIndex];
+
+
+17949 m_Budget.m_OperationsSinceBudgetFetch = 0;
+
+
+
+
+
+17955 void VmaAllocator_T::FillAllocation(
const VmaAllocation hAllocation, uint8_t pattern)
+
+17957 if(VMA_DEBUG_INITIALIZE_ALLOCATIONS &&
+17958 !hAllocation->CanBecomeLost() &&
+17959 (m_MemProps.memoryTypes[hAllocation->GetMemoryTypeIndex()].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0)
+
+17961 void* pData = VMA_NULL;
+17962 VkResult res = Map(hAllocation, &pData);
+17963 if(res == VK_SUCCESS)
+
+17965 memset(pData, (
int)pattern, (
size_t)hAllocation->GetSize());
+17966 FlushOrInvalidateAllocation(hAllocation, 0, VK_WHOLE_SIZE, VMA_CACHE_FLUSH);
+17967 Unmap(hAllocation);
+
+
+
+17971 VMA_ASSERT(0 &&
"VMA_DEBUG_INITIALIZE_ALLOCATIONS is enabled, but couldn't map memory to fill allocation.");
+
+
-17976 #if VMA_STATS_STRING_ENABLED
-
-17978 void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json)
-
-17980 bool dedicatedAllocationsStarted =
false;
-17981 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
-
-17983 VmaMutexLockRead dedicatedAllocationsLock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
-17984 DedicatedAllocationLinkedList& dedicatedAllocList = m_DedicatedAllocations[memTypeIndex];
-17985 if(!dedicatedAllocList.IsEmpty())
-
-17987 if(dedicatedAllocationsStarted ==
false)
-
-17989 dedicatedAllocationsStarted =
true;
-17990 json.WriteString(
"DedicatedAllocations");
-17991 json.BeginObject();
-
-
-17994 json.BeginString(
"Type ");
-17995 json.ContinueString(memTypeIndex);
-
-
-
-
-
-18001 alloc != VMA_NULL; alloc = dedicatedAllocList.GetNext(alloc))
-
-18003 json.BeginObject(
true);
-18004 alloc->PrintParameters(json);
-
-
-
-
-
-
-18011 if(dedicatedAllocationsStarted)
-
-
-
-
-
-18017 bool allocationsStarted =
false;
-18018 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
-
-18020 if(m_pBlockVectors[memTypeIndex]->IsEmpty() ==
false)
-
-18022 if(allocationsStarted ==
false)
-
-18024 allocationsStarted =
true;
-18025 json.WriteString(
"DefaultPools");
-18026 json.BeginObject();
-
-
-18029 json.BeginString(
"Type ");
-18030 json.ContinueString(memTypeIndex);
-
-
-18033 m_pBlockVectors[memTypeIndex]->PrintDetailedMap(json);
-
-
-18036 if(allocationsStarted)
-
-
-
-
-
-
-
-18044 VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
-18045 if(!m_Pools.IsEmpty())
-
-18047 json.WriteString(
"Pools");
-18048 json.BeginObject();
-18049 for(
VmaPool pool = m_Pools.Front(); pool != VMA_NULL; pool = m_Pools.GetNext(pool))
-
-18051 json.BeginString();
-18052 json.ContinueString(pool->GetId());
-
-
-18055 pool->m_BlockVector.PrintDetailedMap(json);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-18071 VMA_ASSERT(pCreateInfo && pAllocator);
-
-
-18074 VMA_DEBUG_LOG(
"vmaCreateAllocator");
-
-18076 return (*pAllocator)->Init(pCreateInfo);
-
-
-
-
+17976 uint32_t VmaAllocator_T::GetGpuDefragmentationMemoryTypeBits()
+
+17978 uint32_t memoryTypeBits = m_GpuDefragmentationMemoryTypeBits.load();
+17979 if(memoryTypeBits == UINT32_MAX)
+
+17981 memoryTypeBits = CalculateGpuDefragmentationMemoryTypeBits();
+17982 m_GpuDefragmentationMemoryTypeBits.store(memoryTypeBits);
+
+17984 return memoryTypeBits;
+
+
+17987 #if VMA_STATS_STRING_ENABLED
+
+17989 void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json)
+
+17991 bool dedicatedAllocationsStarted =
false;
+17992 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+
+17994 VmaMutexLockRead dedicatedAllocationsLock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
+17995 DedicatedAllocationLinkedList& dedicatedAllocList = m_DedicatedAllocations[memTypeIndex];
+17996 if(!dedicatedAllocList.IsEmpty())
+
+17998 if(dedicatedAllocationsStarted ==
false)
+
+18000 dedicatedAllocationsStarted =
true;
+18001 json.WriteString(
"DedicatedAllocations");
+18002 json.BeginObject();
+
+
+18005 json.BeginString(
"Type ");
+18006 json.ContinueString(memTypeIndex);
+
+
+
+
+
+18012 alloc != VMA_NULL; alloc = dedicatedAllocList.GetNext(alloc))
+
+18014 json.BeginObject(
true);
+18015 alloc->PrintParameters(json);
+
+
+
+
+
+
+18022 if(dedicatedAllocationsStarted)
+
+
+
+
+
+18028 bool allocationsStarted =
false;
+18029 for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+
+18031 if(m_pBlockVectors[memTypeIndex]->IsEmpty() ==
false)
+
+18033 if(allocationsStarted ==
false)
+
+18035 allocationsStarted =
true;
+18036 json.WriteString(
"DefaultPools");
+18037 json.BeginObject();
+
+
+18040 json.BeginString(
"Type ");
+18041 json.ContinueString(memTypeIndex);
+
+
+18044 m_pBlockVectors[memTypeIndex]->PrintDetailedMap(json);
+
+
+18047 if(allocationsStarted)
+
+
+
+
+
+
+
+18055 VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
+18056 if(!m_Pools.IsEmpty())
+
+18058 json.WriteString(
"Pools");
+18059 json.BeginObject();
+18060 for(
VmaPool pool = m_Pools.Front(); pool != VMA_NULL; pool = m_Pools.GetNext(pool))
+
+18062 json.BeginString();
+18063 json.ContinueString(pool->GetId());
+
+
+18066 pool->m_BlockVector.PrintDetailedMap(json);
+
+
+
+
+
+
+
+
+
+
+
+
+
-18082 if(allocator != VK_NULL_HANDLE)
-
-18084 VMA_DEBUG_LOG(
"vmaDestroyAllocator");
-18085 VkAllocationCallbacks allocationCallbacks = allocator->m_AllocationCallbacks;
-18086 vma_delete(&allocationCallbacks, allocator);
-
+18082 VMA_ASSERT(pCreateInfo && pAllocator);
+
+
+18085 VMA_DEBUG_LOG(
"vmaCreateAllocator");
+
+18087 return (*pAllocator)->Init(pCreateInfo);
-
-
-18092 VMA_ASSERT(allocator && pAllocatorInfo);
-18093 pAllocatorInfo->
instance = allocator->m_hInstance;
-18094 pAllocatorInfo->
physicalDevice = allocator->GetPhysicalDevice();
-18095 pAllocatorInfo->
device = allocator->m_hDevice;
-
-
-
-
-18100 const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties)
-
-18102 VMA_ASSERT(allocator && ppPhysicalDeviceProperties);
-18103 *ppPhysicalDeviceProperties = &allocator->m_PhysicalDeviceProperties;
-
-
-
-
-18108 const VkPhysicalDeviceMemoryProperties** ppPhysicalDeviceMemoryProperties)
-
-18110 VMA_ASSERT(allocator && ppPhysicalDeviceMemoryProperties);
-18111 *ppPhysicalDeviceMemoryProperties = &allocator->m_MemProps;
-
-
-
-
-18116 uint32_t memoryTypeIndex,
-18117 VkMemoryPropertyFlags* pFlags)
-
-18119 VMA_ASSERT(allocator && pFlags);
-18120 VMA_ASSERT(memoryTypeIndex < allocator->GetMemoryTypeCount());
-18121 *pFlags = allocator->m_MemProps.memoryTypes[memoryTypeIndex].propertyFlags;
-
-
-
-
-18126 uint32_t frameIndex)
-
-18128 VMA_ASSERT(allocator);
-18129 VMA_ASSERT(frameIndex != VMA_FRAME_INDEX_LOST);
-
-18131 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18133 allocator->SetCurrentFrameIndex(frameIndex);
-
-
-
-
-
-
-18140 VMA_ASSERT(allocator && pStats);
-18141 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-18142 allocator->CalculateStats(pStats);
-
-
-
-
-
-
-18149 VMA_ASSERT(allocator && pBudget);
-18150 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-18151 allocator->GetBudget(pBudget, 0, allocator->GetMemoryHeapCount());
-
-
-18154 #if VMA_STATS_STRING_ENABLED
+
+
+
+18093 if(allocator != VK_NULL_HANDLE)
+
+18095 VMA_DEBUG_LOG(
"vmaDestroyAllocator");
+18096 VkAllocationCallbacks allocationCallbacks = allocator->m_AllocationCallbacks;
+18097 vma_delete(&allocationCallbacks, allocator);
+
+
+
+
+
+18103 VMA_ASSERT(allocator && pAllocatorInfo);
+18104 pAllocatorInfo->
instance = allocator->m_hInstance;
+18105 pAllocatorInfo->
physicalDevice = allocator->GetPhysicalDevice();
+18106 pAllocatorInfo->
device = allocator->m_hDevice;
+
+
+
+
+18111 const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties)
+
+18113 VMA_ASSERT(allocator && ppPhysicalDeviceProperties);
+18114 *ppPhysicalDeviceProperties = &allocator->m_PhysicalDeviceProperties;
+
+
+
+
+18119 const VkPhysicalDeviceMemoryProperties** ppPhysicalDeviceMemoryProperties)
+
+18121 VMA_ASSERT(allocator && ppPhysicalDeviceMemoryProperties);
+18122 *ppPhysicalDeviceMemoryProperties = &allocator->m_MemProps;
+
+
+
+
+18127 uint32_t memoryTypeIndex,
+18128 VkMemoryPropertyFlags* pFlags)
+
+18130 VMA_ASSERT(allocator && pFlags);
+18131 VMA_ASSERT(memoryTypeIndex < allocator->GetMemoryTypeCount());
+18132 *pFlags = allocator->m_MemProps.memoryTypes[memoryTypeIndex].propertyFlags;
+
+
+
+
+18137 uint32_t frameIndex)
+
+18139 VMA_ASSERT(allocator);
+18140 VMA_ASSERT(frameIndex != VMA_FRAME_INDEX_LOST);
+
+18142 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18144 allocator->SetCurrentFrameIndex(frameIndex);
+
+
+
+
+
+
+18151 VMA_ASSERT(allocator && pStats);
+18152 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+18153 allocator->CalculateStats(pStats);
+
-
+
-18158 char** ppStatsString,
-18159 VkBool32 detailedMap)
-
-18161 VMA_ASSERT(allocator && ppStatsString);
-18162 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18164 VmaStringBuilder sb(allocator);
-
-18166 VmaJsonWriter json(allocator->GetAllocationCallbacks(), sb);
-18167 json.BeginObject();
-
-
-18170 allocator->GetBudget(budget, 0, allocator->GetMemoryHeapCount());
-
-
-18173 allocator->CalculateStats(&stats);
+
+
+18160 VMA_ASSERT(allocator && pBudget);
+18161 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+18162 allocator->GetBudget(pBudget, 0, allocator->GetMemoryHeapCount());
+
+
+18165 #if VMA_STATS_STRING_ENABLED
+
+
+
+18169 char** ppStatsString,
+18170 VkBool32 detailedMap)
+
+18172 VMA_ASSERT(allocator && ppStatsString);
+18173 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-18175 json.WriteString(
"Total");
-18176 VmaPrintStatInfo(json, stats.
total);
-
-18178 for(uint32_t heapIndex = 0; heapIndex < allocator->GetMemoryHeapCount(); ++heapIndex)
-
-18180 json.BeginString(
"Heap ");
-18181 json.ContinueString(heapIndex);
-
-18183 json.BeginObject();
-
-18185 json.WriteString(
"Size");
-18186 json.WriteNumber(allocator->m_MemProps.memoryHeaps[heapIndex].size);
-
-18188 json.WriteString(
"Flags");
-18189 json.BeginArray(
true);
-18190 if((allocator->m_MemProps.memoryHeaps[heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) != 0)
-
-18192 json.WriteString(
"DEVICE_LOCAL");
-
-
+18175 VmaStringBuilder sb(allocator);
+
+18177 VmaJsonWriter json(allocator->GetAllocationCallbacks(), sb);
+18178 json.BeginObject();
+
+
+18181 allocator->GetBudget(budget, 0, allocator->GetMemoryHeapCount());
+
+
+18184 allocator->CalculateStats(&stats);
+
+18186 json.WriteString(
"Total");
+18187 VmaPrintStatInfo(json, stats.
total);
+
+18189 for(uint32_t heapIndex = 0; heapIndex < allocator->GetMemoryHeapCount(); ++heapIndex)
+
+18191 json.BeginString(
"Heap ");
+18192 json.ContinueString(heapIndex);
+
+18194 json.BeginObject();
-18196 json.WriteString(
"Budget");
-18197 json.BeginObject();
-
-18199 json.WriteString(
"BlockBytes");
-18200 json.WriteNumber(budget[heapIndex].blockBytes);
-18201 json.WriteString(
"AllocationBytes");
-18202 json.WriteNumber(budget[heapIndex].allocationBytes);
-18203 json.WriteString(
"Usage");
-18204 json.WriteNumber(budget[heapIndex].usage);
-18205 json.WriteString(
"Budget");
-18206 json.WriteNumber(budget[heapIndex].budget);
-
-
-
-
-
-18212 json.WriteString(
"Stats");
-18213 VmaPrintStatInfo(json, stats.
memoryHeap[heapIndex]);
-
-
-18216 for(uint32_t typeIndex = 0; typeIndex < allocator->GetMemoryTypeCount(); ++typeIndex)
-
-18218 if(allocator->MemoryTypeIndexToHeapIndex(typeIndex) == heapIndex)
-
-18220 json.BeginString(
"Type ");
-18221 json.ContinueString(typeIndex);
-
-
-18224 json.BeginObject();
-
-18226 json.WriteString(
"Flags");
-18227 json.BeginArray(
true);
-18228 VkMemoryPropertyFlags flags = allocator->m_MemProps.memoryTypes[typeIndex].propertyFlags;
-18229 if((flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0)
-
-18231 json.WriteString(
"DEVICE_LOCAL");
-
-18233 if((flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0)
-
-18235 json.WriteString(
"HOST_VISIBLE");
-
-18237 if((flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) != 0)
-
-18239 json.WriteString(
"HOST_COHERENT");
-
-18241 if((flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) != 0)
-
-18243 json.WriteString(
"HOST_CACHED");
-
-18245 if((flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) != 0)
-
-18247 json.WriteString(
"LAZILY_ALLOCATED");
-
-18249 #if VMA_VULKAN_VERSION >= 1001000
-18250 if((flags & VK_MEMORY_PROPERTY_PROTECTED_BIT) != 0)
-
-18252 json.WriteString(
"PROTECTED");
-
-
-18255 #if VK_AMD_device_coherent_memory
-18256 if((flags & VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY) != 0)
+18196 json.WriteString(
"Size");
+18197 json.WriteNumber(allocator->m_MemProps.memoryHeaps[heapIndex].size);
+
+18199 json.WriteString(
"Flags");
+18200 json.BeginArray(
true);
+18201 if((allocator->m_MemProps.memoryHeaps[heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) != 0)
+
+18203 json.WriteString(
"DEVICE_LOCAL");
+
+
+
+18207 json.WriteString(
"Budget");
+18208 json.BeginObject();
+
+18210 json.WriteString(
"BlockBytes");
+18211 json.WriteNumber(budget[heapIndex].blockBytes);
+18212 json.WriteString(
"AllocationBytes");
+18213 json.WriteNumber(budget[heapIndex].allocationBytes);
+18214 json.WriteString(
"Usage");
+18215 json.WriteNumber(budget[heapIndex].usage);
+18216 json.WriteString(
"Budget");
+18217 json.WriteNumber(budget[heapIndex].budget);
+
+
+
+
+
+18223 json.WriteString(
"Stats");
+18224 VmaPrintStatInfo(json, stats.
memoryHeap[heapIndex]);
+
+
+18227 for(uint32_t typeIndex = 0; typeIndex < allocator->GetMemoryTypeCount(); ++typeIndex)
+
+18229 if(allocator->MemoryTypeIndexToHeapIndex(typeIndex) == heapIndex)
+
+18231 json.BeginString(
"Type ");
+18232 json.ContinueString(typeIndex);
+
+
+18235 json.BeginObject();
+
+18237 json.WriteString(
"Flags");
+18238 json.BeginArray(
true);
+18239 VkMemoryPropertyFlags flags = allocator->m_MemProps.memoryTypes[typeIndex].propertyFlags;
+18240 if((flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0)
+
+18242 json.WriteString(
"DEVICE_LOCAL");
+
+18244 if((flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0)
+
+18246 json.WriteString(
"HOST_VISIBLE");
+
+18248 if((flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) != 0)
+
+18250 json.WriteString(
"HOST_COHERENT");
+
+18252 if((flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) != 0)
+
+18254 json.WriteString(
"HOST_CACHED");
+
+18256 if((flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) != 0)
-18258 json.WriteString(
"DEVICE_COHERENT");
+18258 json.WriteString(
"LAZILY_ALLOCATED");
-18260 if((flags & VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY) != 0)
-
-18262 json.WriteString(
"DEVICE_UNCACHED");
-
-
-
-
-
+18260 #if VMA_VULKAN_VERSION >= 1001000
+18261 if((flags & VK_MEMORY_PROPERTY_PROTECTED_BIT) != 0)
+
+18263 json.WriteString(
"PROTECTED");
+
+
+18266 #if VK_AMD_device_coherent_memory
+18267 if((flags & VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY) != 0)
-18269 json.WriteString(
"Stats");
-18270 VmaPrintStatInfo(json, stats.
memoryType[typeIndex]);
-
-
-
-
-
-
-
-
-18279 if(detailedMap == VK_TRUE)
-
-18281 allocator->PrintDetailedMap(json);
-
+18269 json.WriteString(
"DEVICE_COHERENT");
+
+18271 if((flags & VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY) != 0)
+
+18273 json.WriteString(
"DEVICE_UNCACHED");
+
+
+
+
+
+
+18280 json.WriteString(
"Stats");
+18281 VmaPrintStatInfo(json, stats.
memoryType[typeIndex]);
+
-
-
-
-18287 const size_t len = sb.GetLength();
-18288 char*
const pChars = vma_new_array(allocator,
char, len + 1);
-
-
-18291 memcpy(pChars, sb.GetData(), len);
-
-18293 pChars[len] =
'\0';
-18294 *ppStatsString = pChars;
-
-
-
-
-18299 char* pStatsString)
-
-18301 if(pStatsString != VMA_NULL)
-
-18303 VMA_ASSERT(allocator);
-18304 size_t len = strlen(pStatsString);
-18305 vma_delete_array(allocator, pStatsString, len + 1);
-
-
-
-
-
-
-
-
-
-
-18316 uint32_t memoryTypeBits,
-
-18318 uint32_t* pMemoryTypeIndex)
-
-18320 VMA_ASSERT(allocator != VK_NULL_HANDLE);
-18321 VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
-18322 VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
-
-18324 memoryTypeBits &= allocator->GetGlobalMemoryTypeBits();
-
-
-
-
-
-
-18331 uint32_t requiredFlags = pAllocationCreateInfo->
requiredFlags;
-18332 uint32_t preferredFlags = pAllocationCreateInfo->
preferredFlags;
-18333 uint32_t notPreferredFlags = 0;
+
+
+
+
+
+
+18290 if(detailedMap == VK_TRUE)
+
+18292 allocator->PrintDetailedMap(json);
+
+
+
+
+
+18298 const size_t len = sb.GetLength();
+18299 char*
const pChars = vma_new_array(allocator,
char, len + 1);
+
+
+18302 memcpy(pChars, sb.GetData(), len);
+
+18304 pChars[len] =
'\0';
+18305 *ppStatsString = pChars;
+
+
+
+
+18310 char* pStatsString)
+
+18312 if(pStatsString != VMA_NULL)
+
+18314 VMA_ASSERT(allocator);
+18315 size_t len = strlen(pStatsString);
+18316 vma_delete_array(allocator, pStatsString, len + 1);
+
+
+
+
+
+
+
+
+
+
+18327 uint32_t memoryTypeBits,
+
+18329 uint32_t* pMemoryTypeIndex)
+
+18331 VMA_ASSERT(allocator != VK_NULL_HANDLE);
+18332 VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
+18333 VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
-
-18336 switch(pAllocationCreateInfo->
usage)
-
-
-
-
-18341 if(!allocator->IsIntegratedGpu() || (preferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
-
-18343 preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
-
-
-
-18347 requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
-
-
-18350 requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
-18351 if(!allocator->IsIntegratedGpu() || (preferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
-
-18353 preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
-
-
-
-18357 requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
-18358 preferredFlags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
+18335 memoryTypeBits &= allocator->GetGlobalMemoryTypeBits();
+
+
+
+
+
+
+18342 uint32_t requiredFlags = pAllocationCreateInfo->
requiredFlags;
+18343 uint32_t preferredFlags = pAllocationCreateInfo->
preferredFlags;
+18344 uint32_t notPreferredFlags = 0;
+
+
+18347 switch(pAllocationCreateInfo->
usage)
+
+
+
+
+18352 if(!allocator->IsIntegratedGpu() || (preferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
+
+18354 preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+
+
+
+18358 requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
-
-18361 notPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
-
-
-18364 requiredFlags |= VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT;
-
-
-
-
-
-
-
-
-18373 (VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY | VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY)) == 0)
-
-18375 notPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY;
-
-
-18378 *pMemoryTypeIndex = UINT32_MAX;
-18379 uint32_t minCost = UINT32_MAX;
-18380 for(uint32_t memTypeIndex = 0, memTypeBit = 1;
-18381 memTypeIndex < allocator->GetMemoryTypeCount();
-18382 ++memTypeIndex, memTypeBit <<= 1)
-
-
-18385 if((memTypeBit & memoryTypeBits) != 0)
-
-18387 const VkMemoryPropertyFlags currFlags =
-18388 allocator->m_MemProps.memoryTypes[memTypeIndex].propertyFlags;
-
-18390 if((requiredFlags & ~currFlags) == 0)
-
-
-18393 uint32_t currCost = VmaCountBitsSet(preferredFlags & ~currFlags) +
-18394 VmaCountBitsSet(currFlags & notPreferredFlags);
-
-18396 if(currCost < minCost)
-
-18398 *pMemoryTypeIndex = memTypeIndex;
-
-
-
-
-18403 minCost = currCost;
-
-
-
-
-18408 return (*pMemoryTypeIndex != UINT32_MAX) ? VK_SUCCESS : VK_ERROR_FEATURE_NOT_PRESENT;
-
-
-
-
-18413 const VkBufferCreateInfo* pBufferCreateInfo,
-
-18415 uint32_t* pMemoryTypeIndex)
-
-18417 VMA_ASSERT(allocator != VK_NULL_HANDLE);
-18418 VMA_ASSERT(pBufferCreateInfo != VMA_NULL);
-18419 VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
-18420 VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
+
+18361 requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+18362 if(!allocator->IsIntegratedGpu() || (preferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
+
+18364 preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+
+
+
+18368 requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+18369 preferredFlags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
+
+
+18372 notPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+
+
+18375 requiredFlags |= VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT;
+
+
+
+
+
+
+
+
+18384 (VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY | VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY)) == 0)
+
+18386 notPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY;
+
+
+18389 *pMemoryTypeIndex = UINT32_MAX;
+18390 uint32_t minCost = UINT32_MAX;
+18391 for(uint32_t memTypeIndex = 0, memTypeBit = 1;
+18392 memTypeIndex < allocator->GetMemoryTypeCount();
+18393 ++memTypeIndex, memTypeBit <<= 1)
+
+
+18396 if((memTypeBit & memoryTypeBits) != 0)
+
+18398 const VkMemoryPropertyFlags currFlags =
+18399 allocator->m_MemProps.memoryTypes[memTypeIndex].propertyFlags;
+
+18401 if((requiredFlags & ~currFlags) == 0)
+
+
+18404 uint32_t currCost = VmaCountBitsSet(preferredFlags & ~currFlags) +
+18405 VmaCountBitsSet(currFlags & notPreferredFlags);
+
+18407 if(currCost < minCost)
+
+18409 *pMemoryTypeIndex = memTypeIndex;
+
+
+
+
+18414 minCost = currCost;
+
+
+
+
+18419 return (*pMemoryTypeIndex != UINT32_MAX) ? VK_SUCCESS : VK_ERROR_FEATURE_NOT_PRESENT;
+
-18422 const VkDevice hDev = allocator->m_hDevice;
-18423 VkBuffer hBuffer = VK_NULL_HANDLE;
-18424 VkResult res = allocator->GetVulkanFunctions().vkCreateBuffer(
-18425 hDev, pBufferCreateInfo, allocator->GetAllocationCallbacks(), &hBuffer);
-18426 if(res == VK_SUCCESS)
-
-18428 VkMemoryRequirements memReq = {};
-18429 allocator->GetVulkanFunctions().vkGetBufferMemoryRequirements(
-18430 hDev, hBuffer, &memReq);
-
-
-
-18434 memReq.memoryTypeBits,
-18435 pAllocationCreateInfo,
-
-
-18438 allocator->GetVulkanFunctions().vkDestroyBuffer(
-18439 hDev, hBuffer, allocator->GetAllocationCallbacks());
-
-
-
-
-
-
-18446 const VkImageCreateInfo* pImageCreateInfo,
-
-18448 uint32_t* pMemoryTypeIndex)
-
-18450 VMA_ASSERT(allocator != VK_NULL_HANDLE);
-18451 VMA_ASSERT(pImageCreateInfo != VMA_NULL);
-18452 VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
-18453 VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
+
+
+18424 const VkBufferCreateInfo* pBufferCreateInfo,
+
+18426 uint32_t* pMemoryTypeIndex)
+
+18428 VMA_ASSERT(allocator != VK_NULL_HANDLE);
+18429 VMA_ASSERT(pBufferCreateInfo != VMA_NULL);
+18430 VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
+18431 VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
+
+18433 const VkDevice hDev = allocator->m_hDevice;
+18434 VkBuffer hBuffer = VK_NULL_HANDLE;
+18435 VkResult res = allocator->GetVulkanFunctions().vkCreateBuffer(
+18436 hDev, pBufferCreateInfo, allocator->GetAllocationCallbacks(), &hBuffer);
+18437 if(res == VK_SUCCESS)
+
+18439 VkMemoryRequirements memReq = {};
+18440 allocator->GetVulkanFunctions().vkGetBufferMemoryRequirements(
+18441 hDev, hBuffer, &memReq);
+
+
+
+18445 memReq.memoryTypeBits,
+18446 pAllocationCreateInfo,
+
+
+18449 allocator->GetVulkanFunctions().vkDestroyBuffer(
+18450 hDev, hBuffer, allocator->GetAllocationCallbacks());
+
+
+
-18455 const VkDevice hDev = allocator->m_hDevice;
-18456 VkImage hImage = VK_NULL_HANDLE;
-18457 VkResult res = allocator->GetVulkanFunctions().vkCreateImage(
-18458 hDev, pImageCreateInfo, allocator->GetAllocationCallbacks(), &hImage);
-18459 if(res == VK_SUCCESS)
-
-18461 VkMemoryRequirements memReq = {};
-18462 allocator->GetVulkanFunctions().vkGetImageMemoryRequirements(
-18463 hDev, hImage, &memReq);
-
-
-
-18467 memReq.memoryTypeBits,
-18468 pAllocationCreateInfo,
-
-
-18471 allocator->GetVulkanFunctions().vkDestroyImage(
-18472 hDev, hImage, allocator->GetAllocationCallbacks());
-
-
-
-
-
-
-
-
-
-18482 VMA_ASSERT(allocator && pCreateInfo && pPool);
-
-18484 VMA_DEBUG_LOG(
"vmaCreatePool");
-
-18486 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+
+18457 const VkImageCreateInfo* pImageCreateInfo,
+
+18459 uint32_t* pMemoryTypeIndex)
+
+18461 VMA_ASSERT(allocator != VK_NULL_HANDLE);
+18462 VMA_ASSERT(pImageCreateInfo != VMA_NULL);
+18463 VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
+18464 VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
+
+18466 const VkDevice hDev = allocator->m_hDevice;
+18467 VkImage hImage = VK_NULL_HANDLE;
+18468 VkResult res = allocator->GetVulkanFunctions().vkCreateImage(
+18469 hDev, pImageCreateInfo, allocator->GetAllocationCallbacks(), &hImage);
+18470 if(res == VK_SUCCESS)
+
+18472 VkMemoryRequirements memReq = {};
+18473 allocator->GetVulkanFunctions().vkGetImageMemoryRequirements(
+18474 hDev, hImage, &memReq);
+
+
+
+18478 memReq.memoryTypeBits,
+18479 pAllocationCreateInfo,
+
+
+18482 allocator->GetVulkanFunctions().vkDestroyImage(
+18483 hDev, hImage, allocator->GetAllocationCallbacks());
+
+
+
-18488 VkResult res = allocator->CreatePool(pCreateInfo, pPool);
-
-18490 #if VMA_RECORDING_ENABLED
-18491 if(allocator->GetRecorder() != VMA_NULL)
-
-18493 allocator->GetRecorder()->RecordCreatePool(allocator->GetCurrentFrameIndex(), *pCreateInfo, *pPool);
-
-
+
+
+
+
+
+18493 VMA_ASSERT(allocator && pCreateInfo && pPool);
+
+18495 VMA_DEBUG_LOG(
"vmaCreatePool");
-
-
-
-
-
-
-
-18504 VMA_ASSERT(allocator);
-
-18506 if(pool == VK_NULL_HANDLE)
-
-
-
+18497 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18499 VkResult res = allocator->CreatePool(pCreateInfo, pPool);
+
+18501 #if VMA_RECORDING_ENABLED
+18502 if(allocator->GetRecorder() != VMA_NULL)
+
+18504 allocator->GetRecorder()->RecordCreatePool(allocator->GetCurrentFrameIndex(), *pCreateInfo, *pPool);
+
+
+
+
+
-18511 VMA_DEBUG_LOG(
"vmaDestroyPool");
-
-18513 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18515 #if VMA_RECORDING_ENABLED
-18516 if(allocator->GetRecorder() != VMA_NULL)
-
-18518 allocator->GetRecorder()->RecordDestroyPool(allocator->GetCurrentFrameIndex(), pool);
-
-
+
+
+
+
+18515 VMA_ASSERT(allocator);
+
+18517 if(pool == VK_NULL_HANDLE)
+
+
+
-18522 allocator->DestroyPool(pool);
-
-
-
-
-
-
-
-18530 VMA_ASSERT(allocator && pool && pPoolStats);
-
-18532 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18534 allocator->GetPoolStats(pool, pPoolStats);
-
-
-
-
-
-18540 size_t* pLostAllocationCount)
-
-18542 VMA_ASSERT(allocator && pool);
-
-18544 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18546 #if VMA_RECORDING_ENABLED
-18547 if(allocator->GetRecorder() != VMA_NULL)
-
-18549 allocator->GetRecorder()->RecordMakePoolAllocationsLost(allocator->GetCurrentFrameIndex(), pool);
-
-
-
-18553 allocator->MakePoolAllocationsLost(pool, pLostAllocationCount);
-
-
-
-
-18558 VMA_ASSERT(allocator && pool);
-
-18560 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18562 VMA_DEBUG_LOG(
"vmaCheckPoolCorruption");
+18522 VMA_DEBUG_LOG(
"vmaDestroyPool");
+
+18524 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18526 #if VMA_RECORDING_ENABLED
+18527 if(allocator->GetRecorder() != VMA_NULL)
+
+18529 allocator->GetRecorder()->RecordDestroyPool(allocator->GetCurrentFrameIndex(), pool);
+
+
+
+18533 allocator->DestroyPool(pool);
+
+
+
+
+
+
+
+18541 VMA_ASSERT(allocator && pool && pPoolStats);
+
+18543 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18545 allocator->GetPoolStats(pool, pPoolStats);
+
+
+
+
+
+18551 size_t* pLostAllocationCount)
+
+18553 VMA_ASSERT(allocator && pool);
+
+18555 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18557 #if VMA_RECORDING_ENABLED
+18558 if(allocator->GetRecorder() != VMA_NULL)
+
+18560 allocator->GetRecorder()->RecordMakePoolAllocationsLost(allocator->GetCurrentFrameIndex(), pool);
+
+
-18564 return allocator->CheckPoolCorruption(pool);
+18564 allocator->MakePoolAllocationsLost(pool, pLostAllocationCount);
-
-
-
-18570 const char** ppName)
-
-18572 VMA_ASSERT(allocator && pool && ppName);
-
-18574 VMA_DEBUG_LOG(
"vmaGetPoolName");
-
-18576 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+
+18569 VMA_ASSERT(allocator && pool);
+
+18571 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18573 VMA_DEBUG_LOG(
"vmaCheckPoolCorruption");
+
+18575 return allocator->CheckPoolCorruption(pool);
+
-18578 *ppName = pool->GetName();
-
-
-
-
-
-
-
-18586 VMA_ASSERT(allocator && pool);
-
-18588 VMA_DEBUG_LOG(
"vmaSetPoolName");
-
-18590 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+
+
+18581 const char** ppName)
+
+18583 VMA_ASSERT(allocator && pool && ppName);
+
+18585 VMA_DEBUG_LOG(
"vmaGetPoolName");
+
+18587 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18589 *ppName = pool->GetName();
+
-18592 pool->SetName(pName);
-
-18594 #if VMA_RECORDING_ENABLED
-18595 if(allocator->GetRecorder() != VMA_NULL)
-
-18597 allocator->GetRecorder()->RecordSetPoolName(allocator->GetCurrentFrameIndex(), pool, pName);
-
-
-
-
-
-
-18604 const VkMemoryRequirements* pVkMemoryRequirements,
-
-
-
-
-18609 VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocation);
-
-18611 VMA_DEBUG_LOG(
"vmaAllocateMemory");
+
+
+
+
+
+18597 VMA_ASSERT(allocator && pool);
+
+18599 VMA_DEBUG_LOG(
"vmaSetPoolName");
+
+18601 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18603 pool->SetName(pName);
+
+18605 #if VMA_RECORDING_ENABLED
+18606 if(allocator->GetRecorder() != VMA_NULL)
+
+18608 allocator->GetRecorder()->RecordSetPoolName(allocator->GetCurrentFrameIndex(), pool, pName);
+
+
+
-18613 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18615 VkResult result = allocator->AllocateMemory(
-18616 *pVkMemoryRequirements,
-
-
-
-
-
-
-18623 VMA_SUBALLOCATION_TYPE_UNKNOWN,
-
-
-
-18627 #if VMA_RECORDING_ENABLED
-18628 if(allocator->GetRecorder() != VMA_NULL)
-
-18630 allocator->GetRecorder()->RecordAllocateMemory(
-18631 allocator->GetCurrentFrameIndex(),
-18632 *pVkMemoryRequirements,
-
-
-
-
+
+
+18615 const VkMemoryRequirements* pVkMemoryRequirements,
+
+
+
+
+18620 VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocation);
+
+18622 VMA_DEBUG_LOG(
"vmaAllocateMemory");
+
+18624 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18626 VkResult result = allocator->AllocateMemory(
+18627 *pVkMemoryRequirements,
+
+
+
+
+
+
+18634 VMA_SUBALLOCATION_TYPE_UNKNOWN,
+
+
-18638 if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS)
-
-18640 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
-
-
-
-
-
-
-
-18648 const VkMemoryRequirements* pVkMemoryRequirements,
-
-18650 size_t allocationCount,
-
-
-
-18654 if(allocationCount == 0)
-
-
-
-
-18659 VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocations);
-
-18661 VMA_DEBUG_LOG(
"vmaAllocateMemoryPages");
-
-18663 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18665 VkResult result = allocator->AllocateMemory(
-18666 *pVkMemoryRequirements,
-
-
-
-
-
-
-18673 VMA_SUBALLOCATION_TYPE_UNKNOWN,
-
-
-
-18677 #if VMA_RECORDING_ENABLED
-18678 if(allocator->GetRecorder() != VMA_NULL)
-
-18680 allocator->GetRecorder()->RecordAllocateMemoryPages(
-18681 allocator->GetCurrentFrameIndex(),
-18682 *pVkMemoryRequirements,
-
-18684 (uint64_t)allocationCount,
-
-
-
-
-18689 if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS)
+18638 #if VMA_RECORDING_ENABLED
+18639 if(allocator->GetRecorder() != VMA_NULL)
+
+18641 allocator->GetRecorder()->RecordAllocateMemory(
+18642 allocator->GetCurrentFrameIndex(),
+18643 *pVkMemoryRequirements,
+
+
+
+
+
+18649 if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS)
+
+18651 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+
+
+
+
+
+
+
+18659 const VkMemoryRequirements* pVkMemoryRequirements,
+
+18661 size_t allocationCount,
+
+
+
+18665 if(allocationCount == 0)
+
+
+
+
+18670 VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocations);
+
+18672 VMA_DEBUG_LOG(
"vmaAllocateMemoryPages");
+
+18674 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18676 VkResult result = allocator->AllocateMemory(
+18677 *pVkMemoryRequirements,
+
+
+
+
+
+
+18684 VMA_SUBALLOCATION_TYPE_UNKNOWN,
+
+
+
+18688 #if VMA_RECORDING_ENABLED
+18689 if(allocator->GetRecorder() != VMA_NULL)
-18691 for(
size_t i = 0; i < allocationCount; ++i)
-
-18693 allocator->GetAllocationInfo(pAllocations[i], pAllocationInfo + i);
-
-
-
-
-
+18691 allocator->GetRecorder()->RecordAllocateMemoryPages(
+18692 allocator->GetCurrentFrameIndex(),
+18693 *pVkMemoryRequirements,
+
+18695 (uint64_t)allocationCount,
+
+
+
-
-
-
-
-
-
-
-18707 VMA_ASSERT(allocator && buffer != VK_NULL_HANDLE && pCreateInfo && pAllocation);
-
-18709 VMA_DEBUG_LOG(
"vmaAllocateMemoryForBuffer");
+18700 if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS)
+
+18702 for(
size_t i = 0; i < allocationCount; ++i)
+
+18704 allocator->GetAllocationInfo(pAllocations[i], pAllocationInfo + i);
+
+
+
+
+
-18711 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18713 VkMemoryRequirements vkMemReq = {};
-18714 bool requiresDedicatedAllocation =
false;
-18715 bool prefersDedicatedAllocation =
false;
-18716 allocator->GetBufferMemoryRequirements(buffer, vkMemReq,
-18717 requiresDedicatedAllocation,
-18718 prefersDedicatedAllocation);
+
+
+
+
+
+
+
+18718 VMA_ASSERT(allocator && buffer != VK_NULL_HANDLE && pCreateInfo && pAllocation);
-18720 VkResult result = allocator->AllocateMemory(
-
-18722 requiresDedicatedAllocation,
-18723 prefersDedicatedAllocation,
-
-
-
-
-18728 VMA_SUBALLOCATION_TYPE_BUFFER,
-
-
-
-18732 #if VMA_RECORDING_ENABLED
-18733 if(allocator->GetRecorder() != VMA_NULL)
-
-18735 allocator->GetRecorder()->RecordAllocateMemoryForBuffer(
-18736 allocator->GetCurrentFrameIndex(),
-
-18738 requiresDedicatedAllocation,
-18739 prefersDedicatedAllocation,
-
-
-
-
-
-18745 if(pAllocationInfo && result == VK_SUCCESS)
-
-18747 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
-
-
-
-
-
-
-
-
-
-
-
-
-18760 VMA_ASSERT(allocator && image != VK_NULL_HANDLE && pCreateInfo && pAllocation);
-
-18762 VMA_DEBUG_LOG(
"vmaAllocateMemoryForImage");
+18720 VMA_DEBUG_LOG(
"vmaAllocateMemoryForBuffer");
+
+18722 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18724 VkMemoryRequirements vkMemReq = {};
+18725 bool requiresDedicatedAllocation =
false;
+18726 bool prefersDedicatedAllocation =
false;
+18727 allocator->GetBufferMemoryRequirements(buffer, vkMemReq,
+18728 requiresDedicatedAllocation,
+18729 prefersDedicatedAllocation);
+
+18731 VkResult result = allocator->AllocateMemory(
+
+18733 requiresDedicatedAllocation,
+18734 prefersDedicatedAllocation,
+
+
+
+
+18739 VMA_SUBALLOCATION_TYPE_BUFFER,
+
+
+
+18743 #if VMA_RECORDING_ENABLED
+18744 if(allocator->GetRecorder() != VMA_NULL)
+
+18746 allocator->GetRecorder()->RecordAllocateMemoryForBuffer(
+18747 allocator->GetCurrentFrameIndex(),
+
+18749 requiresDedicatedAllocation,
+18750 prefersDedicatedAllocation,
+
+
+
+
+
+18756 if(pAllocationInfo && result == VK_SUCCESS)
+
+18758 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+
+
+
+
-18764 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18766 VkMemoryRequirements vkMemReq = {};
-18767 bool requiresDedicatedAllocation =
false;
-18768 bool prefersDedicatedAllocation =
false;
-18769 allocator->GetImageMemoryRequirements(image, vkMemReq,
-18770 requiresDedicatedAllocation, prefersDedicatedAllocation);
-
-18772 VkResult result = allocator->AllocateMemory(
-
-18774 requiresDedicatedAllocation,
-18775 prefersDedicatedAllocation,
-
-
-
-
-18780 VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN,
-
-
-
-18784 #if VMA_RECORDING_ENABLED
-18785 if(allocator->GetRecorder() != VMA_NULL)
-
-18787 allocator->GetRecorder()->RecordAllocateMemoryForImage(
-18788 allocator->GetCurrentFrameIndex(),
-
-18790 requiresDedicatedAllocation,
-18791 prefersDedicatedAllocation,
-
-
-
-
-
-18797 if(pAllocationInfo && result == VK_SUCCESS)
-
-18799 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
-
-
-
-
-
-
-
-
-
-18809 VMA_ASSERT(allocator);
-
-18811 if(allocation == VK_NULL_HANDLE)
-
-
-
+
+
+
+
+
+
+
+18771 VMA_ASSERT(allocator && image != VK_NULL_HANDLE && pCreateInfo && pAllocation);
+
+18773 VMA_DEBUG_LOG(
"vmaAllocateMemoryForImage");
+
+18775 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18777 VkMemoryRequirements vkMemReq = {};
+18778 bool requiresDedicatedAllocation =
false;
+18779 bool prefersDedicatedAllocation =
false;
+18780 allocator->GetImageMemoryRequirements(image, vkMemReq,
+18781 requiresDedicatedAllocation, prefersDedicatedAllocation);
+
+18783 VkResult result = allocator->AllocateMemory(
+
+18785 requiresDedicatedAllocation,
+18786 prefersDedicatedAllocation,
+
+
+
+
+18791 VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN,
+
+
+
+18795 #if VMA_RECORDING_ENABLED
+18796 if(allocator->GetRecorder() != VMA_NULL)
+
+18798 allocator->GetRecorder()->RecordAllocateMemoryForImage(
+18799 allocator->GetCurrentFrameIndex(),
+
+18801 requiresDedicatedAllocation,
+18802 prefersDedicatedAllocation,
+
+
+
+
+
+18808 if(pAllocationInfo && result == VK_SUCCESS)
+
+18810 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+
+
+
+
-18816 VMA_DEBUG_LOG(
"vmaFreeMemory");
-
-18818 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18820 #if VMA_RECORDING_ENABLED
-18821 if(allocator->GetRecorder() != VMA_NULL)
-
-18823 allocator->GetRecorder()->RecordFreeMemory(
-18824 allocator->GetCurrentFrameIndex(),
-
-
-
+
+
+
+
+18820 VMA_ASSERT(allocator);
+
+18822 if(allocation == VK_NULL_HANDLE)
+
+
+
+
+18827 VMA_DEBUG_LOG(
"vmaFreeMemory");
-18829 allocator->FreeMemory(
-
-
-
-
-
-
-18836 size_t allocationCount,
-
-
-18839 if(allocationCount == 0)
-
-
-
-
-18844 VMA_ASSERT(allocator);
-
-18846 VMA_DEBUG_LOG(
"vmaFreeMemoryPages");
-
-18848 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18850 #if VMA_RECORDING_ENABLED
-18851 if(allocator->GetRecorder() != VMA_NULL)
-
-18853 allocator->GetRecorder()->RecordFreeMemoryPages(
-18854 allocator->GetCurrentFrameIndex(),
-18855 (uint64_t)allocationCount,
-
-
-
-
-18860 allocator->FreeMemory(allocationCount, pAllocations);
-
-
-
-
-
-
-
-18868 VMA_ASSERT(allocator && allocation && pAllocationInfo);
-
-18870 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18872 #if VMA_RECORDING_ENABLED
-18873 if(allocator->GetRecorder() != VMA_NULL)
-
-18875 allocator->GetRecorder()->RecordGetAllocationInfo(
-18876 allocator->GetCurrentFrameIndex(),
-
-
-
+18829 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18831 #if VMA_RECORDING_ENABLED
+18832 if(allocator->GetRecorder() != VMA_NULL)
+
+18834 allocator->GetRecorder()->RecordFreeMemory(
+18835 allocator->GetCurrentFrameIndex(),
+
+
+
+
+18840 allocator->FreeMemory(
+
+
+
+
+
+
+18847 size_t allocationCount,
+
+
+18850 if(allocationCount == 0)
+
+
+
+
+18855 VMA_ASSERT(allocator);
+
+18857 VMA_DEBUG_LOG(
"vmaFreeMemoryPages");
+
+18859 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18861 #if VMA_RECORDING_ENABLED
+18862 if(allocator->GetRecorder() != VMA_NULL)
+
+18864 allocator->GetRecorder()->RecordFreeMemoryPages(
+18865 allocator->GetCurrentFrameIndex(),
+18866 (uint64_t)allocationCount,
+
+
+
+
+18871 allocator->FreeMemory(allocationCount, pAllocations);
+
+
+
+
+
+
+
+18879 VMA_ASSERT(allocator && allocation && pAllocationInfo);
-18881 allocator->GetAllocationInfo(allocation, pAllocationInfo);
-
-
-
-
-
-
-18888 VMA_ASSERT(allocator && allocation);
-
-18890 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+18881 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18883 #if VMA_RECORDING_ENABLED
+18884 if(allocator->GetRecorder() != VMA_NULL)
+
+18886 allocator->GetRecorder()->RecordGetAllocationInfo(
+18887 allocator->GetCurrentFrameIndex(),
+
+
+
-18892 #if VMA_RECORDING_ENABLED
-18893 if(allocator->GetRecorder() != VMA_NULL)
-
-18895 allocator->GetRecorder()->RecordTouchAllocation(
-18896 allocator->GetCurrentFrameIndex(),
-
-
-
+18892 allocator->GetAllocationInfo(allocation, pAllocationInfo);
+
+
+
+
+
+
+18899 VMA_ASSERT(allocator && allocation);
-18901 return allocator->TouchAllocation(allocation);
-
-
-
-
-
-
-
-18909 VMA_ASSERT(allocator && allocation);
-
-18911 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18913 allocation->SetUserData(allocator, pUserData);
+18901 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18903 #if VMA_RECORDING_ENABLED
+18904 if(allocator->GetRecorder() != VMA_NULL)
+
+18906 allocator->GetRecorder()->RecordTouchAllocation(
+18907 allocator->GetCurrentFrameIndex(),
+
+
+
+
+18912 return allocator->TouchAllocation(allocation);
+
-18915 #if VMA_RECORDING_ENABLED
-18916 if(allocator->GetRecorder() != VMA_NULL)
-
-18918 allocator->GetRecorder()->RecordSetAllocationUserData(
-18919 allocator->GetCurrentFrameIndex(),
-
-
-
-
-
+
+
+
+
+
+18920 VMA_ASSERT(allocator && allocation);
+
+18922 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18924 allocation->SetUserData(allocator, pUserData);
-
-
-
-
-18930 VMA_ASSERT(allocator && pAllocation);
-
-18932 VMA_DEBUG_GLOBAL_MUTEX_LOCK;
-
-18934 allocator->CreateLostAllocation(pAllocation);
-
-18936 #if VMA_RECORDING_ENABLED
-18937 if(allocator->GetRecorder() != VMA_NULL)
-
-18939 allocator->GetRecorder()->RecordCreateLostAllocation(
-18940 allocator->GetCurrentFrameIndex(),
-
-
-
-
-
-
-
-
-
-
-18951 VMA_ASSERT(allocator && allocation && ppData);
-
-18953 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-18955 VkResult res = allocator->Map(allocation, ppData);
+18926 #if VMA_RECORDING_ENABLED
+18927 if(allocator->GetRecorder() != VMA_NULL)
+
+18929 allocator->GetRecorder()->RecordSetAllocationUserData(
+18930 allocator->GetCurrentFrameIndex(),
+
+
+
+
+
+
+
+
+
+
+18941 VMA_ASSERT(allocator && pAllocation);
+
+18943 VMA_DEBUG_GLOBAL_MUTEX_LOCK;
+
+18945 allocator->CreateLostAllocation(pAllocation);
+
+18947 #if VMA_RECORDING_ENABLED
+18948 if(allocator->GetRecorder() != VMA_NULL)
+
+18950 allocator->GetRecorder()->RecordCreateLostAllocation(
+18951 allocator->GetCurrentFrameIndex(),
+
+
+
+
-18957 #if VMA_RECORDING_ENABLED
-18958 if(allocator->GetRecorder() != VMA_NULL)
-
-18960 allocator->GetRecorder()->RecordMapMemory(
-18961 allocator->GetCurrentFrameIndex(),
-
-
-
+
+
+
+
+
+18962 VMA_ASSERT(allocator && allocation && ppData);
+
+18964 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-
-
-
-
-
-
-18973 VMA_ASSERT(allocator && allocation);
-
-18975 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+18966 VkResult res = allocator->Map(allocation, ppData);
+
+18968 #if VMA_RECORDING_ENABLED
+18969 if(allocator->GetRecorder() != VMA_NULL)
+
+18971 allocator->GetRecorder()->RecordMapMemory(
+18972 allocator->GetCurrentFrameIndex(),
+
+
+
-18977 #if VMA_RECORDING_ENABLED
-18978 if(allocator->GetRecorder() != VMA_NULL)
-
-18980 allocator->GetRecorder()->RecordUnmapMemory(
-18981 allocator->GetCurrentFrameIndex(),
-
-
-
+
+
+
+
+
+
+
+18984 VMA_ASSERT(allocator && allocation);
-18986 allocator->Unmap(allocation);
-
-
-
-
-18991 VMA_ASSERT(allocator && allocation);
-
-18993 VMA_DEBUG_LOG(
"vmaFlushAllocation");
-
-18995 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+18986 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+18988 #if VMA_RECORDING_ENABLED
+18989 if(allocator->GetRecorder() != VMA_NULL)
+
+18991 allocator->GetRecorder()->RecordUnmapMemory(
+18992 allocator->GetCurrentFrameIndex(),
+
+
+
-18997 const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_FLUSH);
-
-18999 #if VMA_RECORDING_ENABLED
-19000 if(allocator->GetRecorder() != VMA_NULL)
-
-19002 allocator->GetRecorder()->RecordFlushAllocation(
-19003 allocator->GetCurrentFrameIndex(),
-19004 allocation, offset, size);
-
-
+18997 allocator->Unmap(allocation);
+
+
+
+
+19002 VMA_ASSERT(allocator && allocation);
+
+19004 VMA_DEBUG_LOG(
"vmaFlushAllocation");
+
+19006 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-
-
-
-
-19013 VMA_ASSERT(allocator && allocation);
-
-19015 VMA_DEBUG_LOG(
"vmaInvalidateAllocation");
-
-19017 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+19008 const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_FLUSH);
+
+19010 #if VMA_RECORDING_ENABLED
+19011 if(allocator->GetRecorder() != VMA_NULL)
+
+19013 allocator->GetRecorder()->RecordFlushAllocation(
+19014 allocator->GetCurrentFrameIndex(),
+19015 allocation, offset, size);
+
+
-19019 const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_INVALIDATE);
-
-19021 #if VMA_RECORDING_ENABLED
-19022 if(allocator->GetRecorder() != VMA_NULL)
-
-19024 allocator->GetRecorder()->RecordInvalidateAllocation(
-19025 allocator->GetCurrentFrameIndex(),
-19026 allocation, offset, size);
-
-
+
+
+
+
+
+19024 VMA_ASSERT(allocator && allocation);
+
+19026 VMA_DEBUG_LOG(
"vmaInvalidateAllocation");
+
+19028 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-
-
-
-
-19035 uint32_t allocationCount,
-
-19037 const VkDeviceSize* offsets,
-19038 const VkDeviceSize* sizes)
-
-19040 VMA_ASSERT(allocator);
-
-19042 if(allocationCount == 0)
-
-
-
-
-19047 VMA_ASSERT(allocations);
-
-19049 VMA_DEBUG_LOG(
"vmaFlushAllocations");
-
-19051 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+19030 const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_INVALIDATE);
+
+19032 #if VMA_RECORDING_ENABLED
+19033 if(allocator->GetRecorder() != VMA_NULL)
+
+19035 allocator->GetRecorder()->RecordInvalidateAllocation(
+19036 allocator->GetCurrentFrameIndex(),
+19037 allocation, offset, size);
+
+
+
+
+
+
+
+
+19046 uint32_t allocationCount,
+
+19048 const VkDeviceSize* offsets,
+19049 const VkDeviceSize* sizes)
+
+19051 VMA_ASSERT(allocator);
-19053 const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_FLUSH);
-
-19055 #if VMA_RECORDING_ENABLED
-19056 if(allocator->GetRecorder() != VMA_NULL)
-
-
-
-
+19053 if(allocationCount == 0)
+
+
+
+
+19058 VMA_ASSERT(allocations);
+
+19060 VMA_DEBUG_LOG(
"vmaFlushAllocations");
-
-
-
-
-
-19067 uint32_t allocationCount,
-
-19069 const VkDeviceSize* offsets,
-19070 const VkDeviceSize* sizes)
-
-19072 VMA_ASSERT(allocator);
-
-19074 if(allocationCount == 0)
-
-
-
-
-19079 VMA_ASSERT(allocations);
-
-19081 VMA_DEBUG_LOG(
"vmaInvalidateAllocations");
-
-19083 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+19062 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19064 const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_FLUSH);
+
+19066 #if VMA_RECORDING_ENABLED
+19067 if(allocator->GetRecorder() != VMA_NULL)
+
+
+
+
+
+
+
+
+
+
+19078 uint32_t allocationCount,
+
+19080 const VkDeviceSize* offsets,
+19081 const VkDeviceSize* sizes)
+
+19083 VMA_ASSERT(allocator);
-19085 const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_INVALIDATE);
-
-19087 #if VMA_RECORDING_ENABLED
-19088 if(allocator->GetRecorder() != VMA_NULL)
-
-
-
-
+19085 if(allocationCount == 0)
+
+
+
+
+19090 VMA_ASSERT(allocations);
+
+19092 VMA_DEBUG_LOG(
"vmaInvalidateAllocations");
-
-
-
-
-
-19099 VMA_ASSERT(allocator);
-
-19101 VMA_DEBUG_LOG(
"vmaCheckCorruption");
-
-19103 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+19094 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19096 const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_INVALIDATE);
+
+19098 #if VMA_RECORDING_ENABLED
+19099 if(allocator->GetRecorder() != VMA_NULL)
+
+
+
+
-19105 return allocator->CheckCorruption(memoryTypeBits);
+
-
-
-
-19111 size_t allocationCount,
-19112 VkBool32* pAllocationsChanged,
-
-
-
-
-
-
-
-
-
-19122 if(pDefragmentationInfo != VMA_NULL)
-
-
-
-
-
-
-
-
-
-
-
-
-
-19136 if(res == VK_NOT_READY)
-
-
-
-
-
-
-
-
-
-
-
-
-19149 VMA_ASSERT(allocator && pInfo && pContext);
-
-
-
-
-
-
-
-
-
-
-19160 VMA_HEAVY_ASSERT(VmaValidatePointerArray(pInfo->
poolCount, pInfo->
pPools));
+
+
+19110 VMA_ASSERT(allocator);
+
+19112 VMA_DEBUG_LOG(
"vmaCheckCorruption");
+
+19114 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19116 return allocator->CheckCorruption(memoryTypeBits);
+
+
+
+
+
+19122 size_t allocationCount,
+19123 VkBool32* pAllocationsChanged,
+
+
+
+
+
+
+
+
+
+19133 if(pDefragmentationInfo != VMA_NULL)
+
+
+
+
+
+
+
+
+
+
+
+
+
+19147 if(res == VK_NOT_READY)
+
+
+
+
+
+
+
+
+
+
+
+
+19160 VMA_ASSERT(allocator && pInfo && pContext);
-19162 VMA_DEBUG_LOG(
"vmaDefragmentationBegin");
-
-19164 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-19166 VkResult res = allocator->DefragmentationBegin(*pInfo, pStats, pContext);
+
+
+
+
+
-19168 #if VMA_RECORDING_ENABLED
-19169 if(allocator->GetRecorder() != VMA_NULL)
-
-19171 allocator->GetRecorder()->RecordDefragmentationBegin(
-19172 allocator->GetCurrentFrameIndex(), *pInfo, *pContext);
-
-
-
-
-
+
+
+
+19171 VMA_HEAVY_ASSERT(VmaValidatePointerArray(pInfo->
poolCount, pInfo->
pPools));
+
+19173 VMA_DEBUG_LOG(
"vmaDefragmentationBegin");
+
+19175 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19177 VkResult res = allocator->DefragmentationBegin(*pInfo, pStats, pContext);
-
-
-
-
-19183 VMA_ASSERT(allocator);
-
-19185 VMA_DEBUG_LOG(
"vmaDefragmentationEnd");
+19179 #if VMA_RECORDING_ENABLED
+19180 if(allocator->GetRecorder() != VMA_NULL)
+
+19182 allocator->GetRecorder()->RecordDefragmentationBegin(
+19183 allocator->GetCurrentFrameIndex(), *pInfo, *pContext);
+
+
-19187 if(context != VK_NULL_HANDLE)
-
-19189 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-19191 #if VMA_RECORDING_ENABLED
-19192 if(allocator->GetRecorder() != VMA_NULL)
-
-19194 allocator->GetRecorder()->RecordDefragmentationEnd(
-19195 allocator->GetCurrentFrameIndex(), context);
-
-
-
-19199 return allocator->DefragmentationEnd(context);
-
-
-
-
-
-
-
-
-
-
-
-
-
-19213 VMA_ASSERT(allocator);
-
-
-19216 VMA_DEBUG_LOG(
"vmaBeginDefragmentationPass");
+
+
+
+
+
+
+
+19194 VMA_ASSERT(allocator);
+
+19196 VMA_DEBUG_LOG(
"vmaDefragmentationEnd");
+
+19198 if(context != VK_NULL_HANDLE)
+
+19200 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19202 #if VMA_RECORDING_ENABLED
+19203 if(allocator->GetRecorder() != VMA_NULL)
+
+19205 allocator->GetRecorder()->RecordDefragmentationEnd(
+19206 allocator->GetCurrentFrameIndex(), context);
+
+
+
+19210 return allocator->DefragmentationEnd(context);
+
+
+
+
+
+
-19218 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-19220 if(context == VK_NULL_HANDLE)
-
-
-
-
-
-19226 return allocator->DefragmentationPassBegin(pInfo, context);
-
-
-
-
-
-19232 VMA_ASSERT(allocator);
-
-19234 VMA_DEBUG_LOG(
"vmaEndDefragmentationPass");
-19235 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+
+
+
+
+
+19224 VMA_ASSERT(allocator);
+
+
+19227 VMA_DEBUG_LOG(
"vmaBeginDefragmentationPass");
+
+19229 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19231 if(context == VK_NULL_HANDLE)
+
+
+
+
-19237 if(context == VK_NULL_HANDLE)
-
-
-19240 return allocator->DefragmentationPassEnd(context);
-
-
-
-
-
-
-
-19248 VMA_ASSERT(allocator && allocation && buffer);
-
-19250 VMA_DEBUG_LOG(
"vmaBindBufferMemory");
-
-19252 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+19237 return allocator->DefragmentationPassBegin(pInfo, context);
+
+
+
+
+
+19243 VMA_ASSERT(allocator);
+
+19245 VMA_DEBUG_LOG(
"vmaEndDefragmentationPass");
+19246 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19248 if(context == VK_NULL_HANDLE)
+
+
+19251 return allocator->DefragmentationPassEnd(context);
+
-19254 return allocator->BindBufferMemory(allocation, 0, buffer, VMA_NULL);
-
-
-
-
-
-19260 VkDeviceSize allocationLocalOffset,
-
-
-
-19264 VMA_ASSERT(allocator && allocation && buffer);
-
-19266 VMA_DEBUG_LOG(
"vmaBindBufferMemory2");
+
+
+
+
+
+19259 VMA_ASSERT(allocator && allocation && buffer);
+
+19261 VMA_DEBUG_LOG(
"vmaBindBufferMemory");
+
+19263 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19265 return allocator->BindBufferMemory(allocation, 0, buffer, VMA_NULL);
+
-19268 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-19270 return allocator->BindBufferMemory(allocation, allocationLocalOffset, buffer, pNext);
-
-
-
-
-
-
-
-19278 VMA_ASSERT(allocator && allocation && image);
-
-19280 VMA_DEBUG_LOG(
"vmaBindImageMemory");
-
-19282 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+
+
+19271 VkDeviceSize allocationLocalOffset,
+
+
+
+19275 VMA_ASSERT(allocator && allocation && buffer);
+
+19277 VMA_DEBUG_LOG(
"vmaBindBufferMemory2");
+
+19279 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19281 return allocator->BindBufferMemory(allocation, allocationLocalOffset, buffer, pNext);
+
-19284 return allocator->BindImageMemory(allocation, 0, image, VMA_NULL);
-
-
-
-
-
-19290 VkDeviceSize allocationLocalOffset,
-
-
-
-19294 VMA_ASSERT(allocator && allocation && image);
-
-19296 VMA_DEBUG_LOG(
"vmaBindImageMemory2");
+
+
+
+
+
+19289 VMA_ASSERT(allocator && allocation && image);
+
+19291 VMA_DEBUG_LOG(
"vmaBindImageMemory");
+
+19293 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19295 return allocator->BindImageMemory(allocation, 0, image, VMA_NULL);
+
-19298 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-19300 return allocator->BindImageMemory(allocation, allocationLocalOffset, image, pNext);
-
-
-
-
-19305 const VkBufferCreateInfo* pBufferCreateInfo,
-
-
-
-
-
-19311 VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && pBuffer && pAllocation);
-
-19313 if(pBufferCreateInfo->size == 0)
-
-19315 return VK_ERROR_VALIDATION_FAILED_EXT;
-
-19317 if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY) != 0 &&
-19318 !allocator->m_UseKhrBufferDeviceAddress)
-
-19320 VMA_ASSERT(0 &&
"Creating a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is not valid if VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT was not used.");
-19321 return VK_ERROR_VALIDATION_FAILED_EXT;
-
+
+
+
+19301 VkDeviceSize allocationLocalOffset,
+
+
+
+19305 VMA_ASSERT(allocator && allocation && image);
+
+19307 VMA_DEBUG_LOG(
"vmaBindImageMemory2");
+
+19309 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19311 return allocator->BindImageMemory(allocation, allocationLocalOffset, image, pNext);
+
+
+
+
+19316 const VkBufferCreateInfo* pBufferCreateInfo,
+
+
+
+
+
+19322 VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && pBuffer && pAllocation);
-19324 VMA_DEBUG_LOG(
"vmaCreateBuffer");
-
-19326 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-19328 *pBuffer = VK_NULL_HANDLE;
-19329 *pAllocation = VK_NULL_HANDLE;
-
-
-19332 VkResult res = (*allocator->GetVulkanFunctions().vkCreateBuffer)(
-19333 allocator->m_hDevice,
-
-19335 allocator->GetAllocationCallbacks(),
-
-
-
-
-19340 VkMemoryRequirements vkMemReq = {};
-19341 bool requiresDedicatedAllocation =
false;
-19342 bool prefersDedicatedAllocation =
false;
-19343 allocator->GetBufferMemoryRequirements(*pBuffer, vkMemReq,
-19344 requiresDedicatedAllocation, prefersDedicatedAllocation);
-
-
-19347 res = allocator->AllocateMemory(
-
-19349 requiresDedicatedAllocation,
-19350 prefersDedicatedAllocation,
-
-19352 pBufferCreateInfo->usage,
-
-19354 *pAllocationCreateInfo,
-19355 VMA_SUBALLOCATION_TYPE_BUFFER,
-
-
-
-19359 #if VMA_RECORDING_ENABLED
-19360 if(allocator->GetRecorder() != VMA_NULL)
-
-19362 allocator->GetRecorder()->RecordCreateBuffer(
-19363 allocator->GetCurrentFrameIndex(),
-19364 *pBufferCreateInfo,
-19365 *pAllocationCreateInfo,
-
-
-
+19324 if(pBufferCreateInfo->size == 0)
+
+19326 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+19328 if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY) != 0 &&
+19329 !allocator->m_UseKhrBufferDeviceAddress)
+
+19331 VMA_ASSERT(0 &&
"Creating a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is not valid if VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT was not used.");
+19332 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+
+19335 VMA_DEBUG_LOG(
"vmaCreateBuffer");
+
+19337 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19339 *pBuffer = VK_NULL_HANDLE;
+19340 *pAllocation = VK_NULL_HANDLE;
+
+
+19343 VkResult res = (*allocator->GetVulkanFunctions().vkCreateBuffer)(
+19344 allocator->m_hDevice,
+
+19346 allocator->GetAllocationCallbacks(),
+
+
+
+
+19351 VkMemoryRequirements vkMemReq = {};
+19352 bool requiresDedicatedAllocation =
false;
+19353 bool prefersDedicatedAllocation =
false;
+19354 allocator->GetBufferMemoryRequirements(*pBuffer, vkMemReq,
+19355 requiresDedicatedAllocation, prefersDedicatedAllocation);
+
+
+19358 res = allocator->AllocateMemory(
+
+19360 requiresDedicatedAllocation,
+19361 prefersDedicatedAllocation,
+
+19363 pBufferCreateInfo->usage,
+
+19365 *pAllocationCreateInfo,
+19366 VMA_SUBALLOCATION_TYPE_BUFFER,
+
+
-
-
-
-
-
-19375 res = allocator->BindBufferMemory(*pAllocation, 0, *pBuffer, VMA_NULL);
-
-
-
-
-19380 #if VMA_STATS_STRING_ENABLED
-19381 (*pAllocation)->InitBufferImageUsage(pBufferCreateInfo->usage);
-
-19383 if(pAllocationInfo != VMA_NULL)
-
-19385 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
-
-
-
-
-19390 allocator->FreeMemory(
-
-
-19393 *pAllocation = VK_NULL_HANDLE;
-19394 (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
-19395 *pBuffer = VK_NULL_HANDLE;
-
-
-19398 (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
-19399 *pBuffer = VK_NULL_HANDLE;
-
-
-
-
-
-
-
-
-
-
-19410 VMA_ASSERT(allocator);
-
-19412 if(buffer == VK_NULL_HANDLE && allocation == VK_NULL_HANDLE)
-
-
-
-
-19417 VMA_DEBUG_LOG(
"vmaDestroyBuffer");
-
-19419 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-19421 #if VMA_RECORDING_ENABLED
-19422 if(allocator->GetRecorder() != VMA_NULL)
-
-19424 allocator->GetRecorder()->RecordDestroyBuffer(
-19425 allocator->GetCurrentFrameIndex(),
-
-
-
+19370 #if VMA_RECORDING_ENABLED
+19371 if(allocator->GetRecorder() != VMA_NULL)
+
+19373 allocator->GetRecorder()->RecordCreateBuffer(
+19374 allocator->GetCurrentFrameIndex(),
+19375 *pBufferCreateInfo,
+19376 *pAllocationCreateInfo,
+
+
+
+
+
+
+
+
+
+19386 res = allocator->BindBufferMemory(*pAllocation, 0, *pBuffer, VMA_NULL);
+
+
+
+
+19391 #if VMA_STATS_STRING_ENABLED
+19392 (*pAllocation)->InitBufferImageUsage(pBufferCreateInfo->usage);
+
+19394 if(pAllocationInfo != VMA_NULL)
+
+19396 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+
+
+
+
+19401 allocator->FreeMemory(
+
+
+19404 *pAllocation = VK_NULL_HANDLE;
+19405 (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
+19406 *pBuffer = VK_NULL_HANDLE;
+
+
+19409 (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
+19410 *pBuffer = VK_NULL_HANDLE;
+
+
+
+
+
+
+
+
+
+
+19421 VMA_ASSERT(allocator);
+
+19423 if(buffer == VK_NULL_HANDLE && allocation == VK_NULL_HANDLE)
+
+
+
+
+19428 VMA_DEBUG_LOG(
"vmaDestroyBuffer");
-19430 if(buffer != VK_NULL_HANDLE)
-
-19432 (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, buffer, allocator->GetAllocationCallbacks());
-
-
-19435 if(allocation != VK_NULL_HANDLE)
-
-19437 allocator->FreeMemory(
-
-
-
-
-
-
-
-19445 const VkImageCreateInfo* pImageCreateInfo,
-
-
-
-
-
-19451 VMA_ASSERT(allocator && pImageCreateInfo && pAllocationCreateInfo && pImage && pAllocation);
-
-19453 if(pImageCreateInfo->extent.width == 0 ||
-19454 pImageCreateInfo->extent.height == 0 ||
-19455 pImageCreateInfo->extent.depth == 0 ||
-19456 pImageCreateInfo->mipLevels == 0 ||
-19457 pImageCreateInfo->arrayLayers == 0)
-
-19459 return VK_ERROR_VALIDATION_FAILED_EXT;
-
-
-19462 VMA_DEBUG_LOG(
"vmaCreateImage");
+19430 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19432 #if VMA_RECORDING_ENABLED
+19433 if(allocator->GetRecorder() != VMA_NULL)
+
+19435 allocator->GetRecorder()->RecordDestroyBuffer(
+19436 allocator->GetCurrentFrameIndex(),
+
+
+
+
+19441 if(buffer != VK_NULL_HANDLE)
+
+19443 (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, buffer, allocator->GetAllocationCallbacks());
+
+
+19446 if(allocation != VK_NULL_HANDLE)
+
+19448 allocator->FreeMemory(
+
+
+
+
+
+
+
+19456 const VkImageCreateInfo* pImageCreateInfo,
+
+
+
+
+
+19462 VMA_ASSERT(allocator && pImageCreateInfo && pAllocationCreateInfo && pImage && pAllocation);
-19464 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-19466 *pImage = VK_NULL_HANDLE;
-19467 *pAllocation = VK_NULL_HANDLE;
-
-
-19470 VkResult res = (*allocator->GetVulkanFunctions().vkCreateImage)(
-19471 allocator->m_hDevice,
-
-19473 allocator->GetAllocationCallbacks(),
-
-
-
-19477 VmaSuballocationType suballocType = pImageCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL ?
-19478 VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL :
-19479 VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR;
-
-
-19482 VkMemoryRequirements vkMemReq = {};
-19483 bool requiresDedicatedAllocation =
false;
-19484 bool prefersDedicatedAllocation =
false;
-19485 allocator->GetImageMemoryRequirements(*pImage, vkMemReq,
-19486 requiresDedicatedAllocation, prefersDedicatedAllocation);
-
-19488 res = allocator->AllocateMemory(
-
-19490 requiresDedicatedAllocation,
-19491 prefersDedicatedAllocation,
-
-
-
-19495 *pAllocationCreateInfo,
-
-
-
-
-19500 #if VMA_RECORDING_ENABLED
-19501 if(allocator->GetRecorder() != VMA_NULL)
-
-19503 allocator->GetRecorder()->RecordCreateImage(
-19504 allocator->GetCurrentFrameIndex(),
-
-19506 *pAllocationCreateInfo,
-
-
-
+19464 if(pImageCreateInfo->extent.width == 0 ||
+19465 pImageCreateInfo->extent.height == 0 ||
+19466 pImageCreateInfo->extent.depth == 0 ||
+19467 pImageCreateInfo->mipLevels == 0 ||
+19468 pImageCreateInfo->arrayLayers == 0)
+
+19470 return VK_ERROR_VALIDATION_FAILED_EXT;
+
+
+19473 VMA_DEBUG_LOG(
"vmaCreateImage");
+
+19475 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19477 *pImage = VK_NULL_HANDLE;
+19478 *pAllocation = VK_NULL_HANDLE;
+
+
+19481 VkResult res = (*allocator->GetVulkanFunctions().vkCreateImage)(
+19482 allocator->m_hDevice,
+
+19484 allocator->GetAllocationCallbacks(),
+
+
+
+19488 VmaSuballocationType suballocType = pImageCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL ?
+19489 VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL :
+19490 VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR;
+
+
+19493 VkMemoryRequirements vkMemReq = {};
+19494 bool requiresDedicatedAllocation =
false;
+19495 bool prefersDedicatedAllocation =
false;
+19496 allocator->GetImageMemoryRequirements(*pImage, vkMemReq,
+19497 requiresDedicatedAllocation, prefersDedicatedAllocation);
+
+19499 res = allocator->AllocateMemory(
+
+19501 requiresDedicatedAllocation,
+19502 prefersDedicatedAllocation,
+
+
+
+19506 *pAllocationCreateInfo,
+
+
+
-
-
-
-
-
-19516 res = allocator->BindImageMemory(*pAllocation, 0, *pImage, VMA_NULL);
-
-
-
-
-19521 #if VMA_STATS_STRING_ENABLED
-19522 (*pAllocation)->InitBufferImageUsage(pImageCreateInfo->usage);
-
-19524 if(pAllocationInfo != VMA_NULL)
-
-19526 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
-
-
-
-
-19531 allocator->FreeMemory(
-
-
-19534 *pAllocation = VK_NULL_HANDLE;
-19535 (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
-19536 *pImage = VK_NULL_HANDLE;
-
-
-19539 (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
-19540 *pImage = VK_NULL_HANDLE;
-
-
-
-
-
-
-
-
-
-
-19551 VMA_ASSERT(allocator);
-
-19553 if(image == VK_NULL_HANDLE && allocation == VK_NULL_HANDLE)
-
-
-
-
-19558 VMA_DEBUG_LOG(
"vmaDestroyImage");
-
-19560 VMA_DEBUG_GLOBAL_MUTEX_LOCK
-
-19562 #if VMA_RECORDING_ENABLED
-19563 if(allocator->GetRecorder() != VMA_NULL)
-
-19565 allocator->GetRecorder()->RecordDestroyImage(
-19566 allocator->GetCurrentFrameIndex(),
-
-
-
+19511 #if VMA_RECORDING_ENABLED
+19512 if(allocator->GetRecorder() != VMA_NULL)
+
+19514 allocator->GetRecorder()->RecordCreateImage(
+19515 allocator->GetCurrentFrameIndex(),
+
+19517 *pAllocationCreateInfo,
+
+
+
+
+
+
+
+
+
+19527 res = allocator->BindImageMemory(*pAllocation, 0, *pImage, VMA_NULL);
+
+
+
+
+19532 #if VMA_STATS_STRING_ENABLED
+19533 (*pAllocation)->InitBufferImageUsage(pImageCreateInfo->usage);
+
+19535 if(pAllocationInfo != VMA_NULL)
+
+19537 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+
+
+
+
+19542 allocator->FreeMemory(
+
+
+19545 *pAllocation = VK_NULL_HANDLE;
+19546 (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
+19547 *pImage = VK_NULL_HANDLE;
+
+
+19550 (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
+19551 *pImage = VK_NULL_HANDLE;
+
+
+
+
+
+
+
+
+
+
+19562 VMA_ASSERT(allocator);
+
+19564 if(image == VK_NULL_HANDLE && allocation == VK_NULL_HANDLE)
+
+
+
+
+19569 VMA_DEBUG_LOG(
"vmaDestroyImage");
-19571 if(image != VK_NULL_HANDLE)
-
-19573 (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, image, allocator->GetAllocationCallbacks());
-
-19575 if(allocation != VK_NULL_HANDLE)
-
-19577 allocator->FreeMemory(
-
-
-
-
-
-
+19571 VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+19573 #if VMA_RECORDING_ENABLED
+19574 if(allocator->GetRecorder() != VMA_NULL)
+
+19576 allocator->GetRecorder()->RecordDestroyImage(
+19577 allocator->GetCurrentFrameIndex(),
+
+
+
+
+19582 if(image != VK_NULL_HANDLE)
+
+19584 (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, image, allocator->GetAllocationCallbacks());
+
+19586 if(allocation != VK_NULL_HANDLE)
+
+19588 allocator->FreeMemory(
+
+
+
+
+
+
Definition: vk_mem_alloc.h:2879
uint32_t memoryTypeBits
Bitmask containing one bit set for every memory type acceptable for this allocation.
Definition: vk_mem_alloc.h:2905
VmaPool pool
Pool that this allocation should be created in.
Definition: vk_mem_alloc.h:2911
@@ -16362,13 +16367,13 @@ $(function() {
VmaMemoryUsage usage
Intended usage of memory.
Definition: vk_mem_alloc.h:2887
VmaAllocationCreateFlags flags
Use VmaAllocationCreateFlagBits enum.
Definition: vk_mem_alloc.h:2881
Represents single memory allocation.
-Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3229
-VkDeviceSize offset
Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory,...
Definition: vk_mem_alloc.h:3253
-void * pMappedData
Pointer to the beginning of this allocation as mapped data.
Definition: vk_mem_alloc.h:3273
-uint32_t memoryType
Memory type index that this allocation was allocated from.
Definition: vk_mem_alloc.h:3234
-VkDeviceSize size
Size of this allocation, in bytes.
Definition: vk_mem_alloc.h:3264
-void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:3278
-VkDeviceMemory deviceMemory
Handle to Vulkan memory object.
Definition: vk_mem_alloc.h:3243
+Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
Definition: vk_mem_alloc.h:3236
+VkDeviceSize offset
Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory,...
Definition: vk_mem_alloc.h:3260
+void * pMappedData
Pointer to the beginning of this allocation as mapped data.
Definition: vk_mem_alloc.h:3280
+uint32_t memoryType
Memory type index that this allocation was allocated from.
Definition: vk_mem_alloc.h:3241
+VkDeviceSize size
Size of this allocation, in bytes.
Definition: vk_mem_alloc.h:3271
+void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition: vk_mem_alloc.h:3285
+VkDeviceMemory deviceMemory
Handle to Vulkan memory object.
Definition: vk_mem_alloc.h:3250
Description of a Allocator to be created.
Definition: vk_mem_alloc.h:2413
VkPhysicalDevice physicalDevice
Vulkan physical device.
Definition: vk_mem_alloc.h:2418
uint32_t frameInUseCount
Maximum number of additional frames that are in use at the same time as current frame.
Definition: vk_mem_alloc.h:2444
@@ -16393,33 +16398,33 @@ $(function() {
VkDeviceSize usage
Estimated current memory usage of the program, in bytes.
Definition: vk_mem_alloc.h:2641
VkDeviceSize budget
Estimated amount of memory available to the program, in bytes.
Definition: vk_mem_alloc.h:2652
Represents Opaque object that represents started defragmentation process.
-Parameters for defragmentation.
Definition: vk_mem_alloc.h:3628
-const VmaPool * pPools
Either null or pointer to array of pools to be defragmented.
Definition: vk_mem_alloc.h:3668
-uint32_t allocationCount
Number of allocations in pAllocations array.
Definition: vk_mem_alloc.h:3634
-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:3688
-VkDeviceSize maxGpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3683
-VmaDefragmentationFlags flags
Reserved for future use. Should be 0.
Definition: vk_mem_alloc.h:3631
-VkBool32 * pAllocationsChanged
Optional, output. Pointer to array that will be filled with information whether the allocation at cer...
Definition: vk_mem_alloc.h:3649
-uint32_t poolCount
Numer of pools in pPools array.
Definition: vk_mem_alloc.h:3652
-VkCommandBuffer commandBuffer
Optional. Command buffer where GPU copy commands will be posted.
Definition: vk_mem_alloc.h:3697
-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:3678
-const VmaAllocation * pAllocations
Pointer to array of allocations that can be defragmented.
Definition: vk_mem_alloc.h:3643
-VkDeviceSize maxCpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3673
-Deprecated. Optional configuration parameters to be passed to function vmaDefragment().
Definition: vk_mem_alloc.h:3719
-uint32_t maxAllocationsToMove
Maximum number of allocations that can be moved to different place.
Definition: vk_mem_alloc.h:3729
-VkDeviceSize maxBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places.
Definition: vk_mem_alloc.h:3724
-Parameters for incremental defragmentation steps.
Definition: vk_mem_alloc.h:3710
-uint32_t moveCount
Definition: vk_mem_alloc.h:3711
-VmaDefragmentationPassMoveInfo * pMoves
Definition: vk_mem_alloc.h:3712
-Definition: vk_mem_alloc.h:3700
-VkDeviceMemory memory
Definition: vk_mem_alloc.h:3702
-VkDeviceSize offset
Definition: vk_mem_alloc.h:3703
-VmaAllocation allocation
Definition: vk_mem_alloc.h:3701
-Statistics returned by function vmaDefragment().
Definition: vk_mem_alloc.h:3733
-uint32_t deviceMemoryBlocksFreed
Number of empty VkDeviceMemory objects that have been released to the system.
Definition: vk_mem_alloc.h:3741
-VkDeviceSize bytesMoved
Total number of bytes that have been copied while moving allocations to different places.
Definition: vk_mem_alloc.h:3735
-VkDeviceSize bytesFreed
Total number of bytes that have been released to the system by freeing empty VkDeviceMemory objects.
Definition: vk_mem_alloc.h:3737
-uint32_t allocationsMoved
Number of allocations that have been moved to different places.
Definition: vk_mem_alloc.h:3739
+Parameters for defragmentation.
Definition: vk_mem_alloc.h:3635
+const VmaPool * pPools
Either null or pointer to array of pools to be defragmented.
Definition: vk_mem_alloc.h:3675
+uint32_t allocationCount
Number of allocations in pAllocations array.
Definition: vk_mem_alloc.h:3641
+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:3695
+VkDeviceSize maxGpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3690
+VmaDefragmentationFlags flags
Reserved for future use. Should be 0.
Definition: vk_mem_alloc.h:3638
+VkBool32 * pAllocationsChanged
Optional, output. Pointer to array that will be filled with information whether the allocation at cer...
Definition: vk_mem_alloc.h:3656
+uint32_t poolCount
Numer of pools in pPools array.
Definition: vk_mem_alloc.h:3659
+VkCommandBuffer commandBuffer
Optional. Command buffer where GPU copy commands will be posted.
Definition: vk_mem_alloc.h:3704
+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:3685
+const VmaAllocation * pAllocations
Pointer to array of allocations that can be defragmented.
Definition: vk_mem_alloc.h:3650
+VkDeviceSize maxCpuBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places using ...
Definition: vk_mem_alloc.h:3680
+Deprecated. Optional configuration parameters to be passed to function vmaDefragment().
Definition: vk_mem_alloc.h:3726
+uint32_t maxAllocationsToMove
Maximum number of allocations that can be moved to different place.
Definition: vk_mem_alloc.h:3736
+VkDeviceSize maxBytesToMove
Maximum total numbers of bytes that can be copied while moving allocations to different places.
Definition: vk_mem_alloc.h:3731
+Parameters for incremental defragmentation steps.
Definition: vk_mem_alloc.h:3717
+uint32_t moveCount
Definition: vk_mem_alloc.h:3718
+VmaDefragmentationPassMoveInfo * pMoves
Definition: vk_mem_alloc.h:3719
+Definition: vk_mem_alloc.h:3707
+VkDeviceMemory memory
Definition: vk_mem_alloc.h:3709
+VkDeviceSize offset
Definition: vk_mem_alloc.h:3710
+VmaAllocation allocation
Definition: vk_mem_alloc.h:3708
+Statistics returned by function vmaDefragment().
Definition: vk_mem_alloc.h:3740
+uint32_t deviceMemoryBlocksFreed
Number of empty VkDeviceMemory objects that have been released to the system.
Definition: vk_mem_alloc.h:3748
+VkDeviceSize bytesMoved
Total number of bytes that have been copied while moving allocations to different places.
Definition: vk_mem_alloc.h:3742
+VkDeviceSize bytesFreed
Total number of bytes that have been released to the system by freeing empty VkDeviceMemory objects.
Definition: vk_mem_alloc.h:3744
+uint32_t allocationsMoved
Number of allocations that have been moved to different places.
Definition: vk_mem_alloc.h:3746
Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.
Definition: vk_mem_alloc.h:2222
void * pUserData
Optional, can be null.
Definition: vk_mem_alloc.h:2228
PFN_vmaAllocateDeviceMemoryFunction pfnAllocate
Optional, can be null.
Definition: vk_mem_alloc.h:2224
@@ -16431,15 +16436,16 @@ $(function() {
uint32_t frameInUseCount
Maximum number of additional frames that are in use at the same time as current frame.
Definition: vk_mem_alloc.h:3089
VkDeviceSize blockSize
Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes....
Definition: vk_mem_alloc.h:3062
size_t minBlockCount
Minimum number of blocks to be always allocated in this pool, even if they stay empty.
Definition: vk_mem_alloc.h:3067
+VkDeviceSize minAllocationAlignment
Additional minimum alignment to be used for all allocations created from this pool....
Definition: vk_mem_alloc.h:3102
size_t maxBlockCount
Maximum number of blocks that can be allocated in this pool. Optional.
Definition: vk_mem_alloc.h:3075
Represents custom memory pool.
-Describes parameter of existing VmaPool.
Definition: vk_mem_alloc.h:3100
-VkDeviceSize size
Total amount of VkDeviceMemory allocated from Vulkan for this pool, in bytes.
Definition: vk_mem_alloc.h:3103
-size_t blockCount
Number of VkDeviceMemory blocks allocated for this pool.
Definition: vk_mem_alloc.h:3122
-VkDeviceSize unusedRangeSizeMax
Size of the largest continuous free memory region available for new allocation.
Definition: vk_mem_alloc.h:3119
-size_t allocationCount
Number of VmaAllocation objects created from this pool that were not destroyed or lost.
Definition: vk_mem_alloc.h:3109
-VkDeviceSize unusedSize
Total number of bytes in the pool not used by any VmaAllocation.
Definition: vk_mem_alloc.h:3106
-size_t unusedRangeCount
Number of continuous memory ranges in the pool not used by any VmaAllocation.
Definition: vk_mem_alloc.h:3112
+Describes parameter of existing VmaPool.
Definition: vk_mem_alloc.h:3107
+VkDeviceSize size
Total amount of VkDeviceMemory allocated from Vulkan for this pool, in bytes.
Definition: vk_mem_alloc.h:3110
+size_t blockCount
Number of VkDeviceMemory blocks allocated for this pool.
Definition: vk_mem_alloc.h:3129
+VkDeviceSize unusedRangeSizeMax
Size of the largest continuous free memory region available for new allocation.
Definition: vk_mem_alloc.h:3126
+size_t allocationCount
Number of VmaAllocation objects created from this pool that were not destroyed or lost.
Definition: vk_mem_alloc.h:3116
+VkDeviceSize unusedSize
Total number of bytes in the pool not used by any VmaAllocation.
Definition: vk_mem_alloc.h:3113
+size_t unusedRangeCount
Number of continuous memory ranges in the pool not used by any VmaAllocation.
Definition: vk_mem_alloc.h:3119
Parameters for recording calls to VMA functions. To be used in VmaAllocatorCreateInfo::pRecordSetting...
Definition: vk_mem_alloc.h:2398
const char * pFilePath
Path to the file that should be written by the recording.
Definition: vk_mem_alloc.h:2408
VmaRecordFlags flags
Flags for recording. Use VmaRecordFlagBits enum.
Definition: vk_mem_alloc.h:2400
@@ -16517,9 +16523,9 @@ $(function() {
void vmaDestroyPool(VmaAllocator allocator, VmaPool pool)
Destroys VmaPool object and frees Vulkan device memory.
VkResult vmaCreatePool(VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
Allocates Vulkan device memory and creates VmaPool object.
void vmaFreeMemory(VmaAllocator allocator, const VmaAllocation allocation)
Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(),...
-VmaDefragmentationFlagBits
Flags to be used in vmaDefragmentationBegin(). None at the moment. Reserved for future use.
Definition: vk_mem_alloc.h:3618
-@ VMA_DEFRAGMENTATION_FLAG_INCREMENTAL
Definition: vk_mem_alloc.h:3619
-@ VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM
Definition: vk_mem_alloc.h:3620
+VmaDefragmentationFlagBits
Flags to be used in vmaDefragmentationBegin(). None at the moment. Reserved for future use.
Definition: vk_mem_alloc.h:3625
+@ VMA_DEFRAGMENTATION_FLAG_INCREMENTAL
Definition: vk_mem_alloc.h:3626
+@ VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM
Definition: vk_mem_alloc.h:3627
VkResult vmaBindBufferMemory(VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer)
Binds buffer to allocation.
struct VmaDefragmentationPassInfo VmaDefragmentationPassInfo
Parameters for incremental defragmentation steps.
void vmaMakePoolAllocationsLost(VmaAllocator allocator, VmaPool pool, size_t *pLostAllocationCount)
Marks all allocations in given pool as lost if they are not used in current frame or VmaPoolCreateInf...
@@ -16530,7 +16536,7 @@ $(function() {
void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
Returns current information about specified allocation and atomically marks it as used in current fra...
void vmaGetMemoryTypeProperties(VmaAllocator allocator, uint32_t memoryTypeIndex, VkMemoryPropertyFlags *pFlags)
Given Memory Type Index, returns Property Flags of this memory type.
VkResult vmaDefragmentationEnd(VmaAllocator allocator, VmaDefragmentationContext context)
Ends defragmentation process.
-VkFlags VmaDefragmentationFlags
Definition: vk_mem_alloc.h:3622
+VkFlags VmaDefragmentationFlags
Definition: vk_mem_alloc.h:3629
VkResult vmaBindBufferMemory2(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkBuffer buffer, const void *pNext)
Binds buffer to allocation with additional parameters.
VmaPoolCreateFlagBits
Flags to be passed as VmaPoolCreateInfo::flags.
Definition: vk_mem_alloc.h:2987
@ VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT
Enables alternative, linear allocation algorithm in this pool.
Definition: vk_mem_alloc.h:3022
diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h
index 852f86a..92e81e7 100644
--- a/include/vk_mem_alloc.h
+++ b/include/vk_mem_alloc.h
@@ -25,7 +25,7 @@
/** \mainpage Vulkan Memory Allocator
-Version 3.0.0-development (2021-02-16)
+Version 3.0.0-development (2021-06-18)
Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved. \n
License: MIT
@@ -3093,6 +3093,13 @@ typedef struct VmaPoolCreateInfo {
Otherwise, this variable is ignored.
*/
float priority;
+ /** \brief Additional minimum alignment to be used for all allocations created from this pool. Can be 0.
+
+ Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two.
+ It can be useful in cases where alignment returned by Vulkan by functions like `vkGetBufferMemoryRequirements` is not enough,
+ e.g. when doing interop with OpenGL.
+ */
+ VkDeviceSize minAllocationAlignment;
} VmaPoolCreateInfo;
/** \brief Describes parameter of existing #VmaPool.
@@ -7330,7 +7337,8 @@ public:
uint32_t frameInUseCount,
bool explicitBlockSize,
uint32_t algorithm,
- float priority);
+ float priority,
+ VkDeviceSize minAllocationAlignment);
~VmaBlockVector();
VkResult CreateMinBlocks();
@@ -7414,6 +7422,7 @@ private:
const bool m_ExplicitBlockSize;
const uint32_t m_Algorithm;
const float m_Priority;
+ const VkDeviceSize m_MinAllocationAlignment;
VMA_RW_MUTEX m_Mutex;
/* There can be at most one allocation that is completely empty (except when minBlockCount > 0) -
@@ -12875,8 +12884,9 @@ VmaPool_T::VmaPool_T(
(createInfo.flags & VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT) != 0 ? 1 : hAllocator->GetBufferImageGranularity(),
createInfo.frameInUseCount,
createInfo.blockSize != 0, // explicitBlockSize
- createInfo.flags & VMA_POOL_CREATE_ALGORITHM_MASK,
- createInfo.priority), // algorithm
+ createInfo.flags & VMA_POOL_CREATE_ALGORITHM_MASK, // algorithm
+ createInfo.priority,
+ VMA_MAX(hAllocator->GetMemoryTypeMinAlignment(createInfo.memoryTypeIndex), createInfo.minAllocationAlignment)),
m_Id(0),
m_Name(VMA_NULL)
{
@@ -12917,7 +12927,8 @@ VmaBlockVector::VmaBlockVector(
uint32_t frameInUseCount,
bool explicitBlockSize,
uint32_t algorithm,
- float priority) :
+ float priority,
+ VkDeviceSize minAllocationAlignment) :
m_hAllocator(hAllocator),
m_hParentPool(hParentPool),
m_MemoryTypeIndex(memoryTypeIndex),
@@ -12929,6 +12940,7 @@ VmaBlockVector::VmaBlockVector(
m_ExplicitBlockSize(explicitBlockSize),
m_Algorithm(algorithm),
m_Priority(priority),
+ m_MinAllocationAlignment(minAllocationAlignment),
m_HasEmptyBlock(false),
m_Blocks(VmaStlAllocator(hAllocator->GetAllocationCallbacks())),
m_NextBlockId(0)
@@ -13008,6 +13020,8 @@ VkResult VmaBlockVector::Allocate(
size_t allocIndex;
VkResult res = VK_SUCCESS;
+ alignment = VMA_MAX(alignment, m_MinAllocationAlignment);
+
if(IsCorruptionDetectionEnabled())
{
size = VmaAlignUp(size, sizeof(VMA_CORRUPTION_DETECTION_MAGIC_VALUE));
@@ -16135,7 +16149,8 @@ VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) :
pCreateInfo->frameInUseCount,
false, // explicitBlockSize
false, // linearAlgorithm
- 0.5f); // priority (0.5 is the default per Vulkan spec)
+ 0.5f, // priority (0.5 is the default per Vulkan spec)
+ GetMemoryTypeMinAlignment(memTypeIndex)); // minAllocationAlignment
// No need to call m_pBlockVectors[memTypeIndex][blockVectorTypeIndex]->CreateMinBlocks here,
// becase minBlockCount is 0.
}
@@ -16863,10 +16878,6 @@ VkResult VmaAllocator_T::AllocateMemory(
if(createInfo.pool != VK_NULL_HANDLE)
{
- const VkDeviceSize alignmentForPool = VMA_MAX(
- vkMemReq.alignment,
- GetMemoryTypeMinAlignment(createInfo.pool->m_BlockVector.GetMemoryTypeIndex()));
-
VmaAllocationCreateInfo createInfoForPool = createInfo;
// If memory type is not HOST_VISIBLE, disable MAPPED.
if((createInfoForPool.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0 &&
@@ -16878,7 +16889,7 @@ VkResult VmaAllocator_T::AllocateMemory(
return createInfo.pool->m_BlockVector.Allocate(
m_CurrentFrameIndex.load(),
vkMemReq.size,
- alignmentForPool,
+ vkMemReq.alignment,
createInfoForPool,
suballocType,
allocationCount,
@@ -16892,13 +16903,9 @@ VkResult VmaAllocator_T::AllocateMemory(
VkResult res = vmaFindMemoryTypeIndex(this, memoryTypeBits, &createInfo, &memTypeIndex);
if(res == VK_SUCCESS)
{
- VkDeviceSize alignmentForMemType = VMA_MAX(
- vkMemReq.alignment,
- GetMemoryTypeMinAlignment(memTypeIndex));
-
res = AllocateMemoryOfType(
vkMemReq.size,
- alignmentForMemType,
+ vkMemReq.alignment,
requiresDedicatedAllocation || prefersDedicatedAllocation,
dedicatedBuffer,
dedicatedBufferUsage,
@@ -16924,13 +16931,9 @@ VkResult VmaAllocator_T::AllocateMemory(
res = vmaFindMemoryTypeIndex(this, memoryTypeBits, &createInfo, &memTypeIndex);
if(res == VK_SUCCESS)
{
- alignmentForMemType = VMA_MAX(
- vkMemReq.alignment,
- GetMemoryTypeMinAlignment(memTypeIndex));
-
res = AllocateMemoryOfType(
vkMemReq.size,
- alignmentForMemType,
+ vkMemReq.alignment,
requiresDedicatedAllocation || prefersDedicatedAllocation,
dedicatedBuffer,
dedicatedBufferUsage,
@@ -17315,6 +17318,10 @@ VkResult VmaAllocator_T::CreatePool(const VmaPoolCreateInfo* pCreateInfo, VmaPoo
{
return VK_ERROR_FEATURE_NOT_PRESENT;
}
+ if(newCreateInfo.minAllocationAlignment > 0)
+ {
+ VMA_ASSERT(VmaIsPow2(newCreateInfo.minAllocationAlignment));
+ }
const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(newCreateInfo.memoryTypeIndex);
diff --git a/src/Tests.cpp b/src/Tests.cpp
index 7cccb4d..6a02548 100644
--- a/src/Tests.cpp
+++ b/src/Tests.cpp
@@ -2795,6 +2795,52 @@ static void TestPool_MinBlockCount()
vmaDestroyPool(g_hAllocator, pool);
}
+static void TestPool_MinAllocationAlignment()
+{
+ wprintf(L"Test Pool MinAllocationAlignment\n");
+ VkResult res;
+
+ static const VkDeviceSize ALLOC_SIZE = 32;
+ static const VkDeviceSize BLOCK_SIZE = 1024 * 1024;
+ static const VkDeviceSize MIN_ALLOCATION_ALIGNMENT = 64 * 1024;
+
+ VmaAllocationCreateInfo allocCreateInfo = {};
+ allocCreateInfo.usage = VMA_MEMORY_USAGE_CPU_COPY;
+
+ VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+ bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
+ bufCreateInfo.size = ALLOC_SIZE;
+
+ VmaPoolCreateInfo poolCreateInfo = {};
+ poolCreateInfo.blockSize = BLOCK_SIZE;
+ poolCreateInfo.minAllocationAlignment = MIN_ALLOCATION_ALIGNMENT;
+ res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &poolCreateInfo.memoryTypeIndex);
+ TEST(res == VK_SUCCESS);
+
+ VmaPool pool = VK_NULL_HANDLE;
+ res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool);
+ TEST(res == VK_SUCCESS && pool != VK_NULL_HANDLE);
+
+ static const uint32_t BUF_COUNT = 4;
+ allocCreateInfo = {};
+ allocCreateInfo.pool = pool;
+ std::vector allocs(BUF_COUNT);
+ for(uint32_t i = 0; i < BUF_COUNT; ++i)
+ {
+ VmaAllocationInfo allocInfo = {};
+ res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &allocs[i].m_Buffer, &allocs[i].m_Allocation, &allocInfo);
+ TEST(res == VK_SUCCESS && allocs[i].m_Buffer != VK_NULL_HANDLE && allocs[i].m_Allocation != VK_NULL_HANDLE);
+ TEST(allocInfo.offset % MIN_ALLOCATION_ALIGNMENT == 0);
+ }
+
+ // Cleanup.
+ for(size_t i = allocs.size(); i--; )
+ {
+ allocs[i].Destroy();
+ }
+ vmaDestroyPool(g_hAllocator, pool);
+}
+
void TestHeapSizeLimit()
{
const VkDeviceSize HEAP_SIZE_LIMIT = 100ull * 1024 * 1024; // 100 MB
@@ -6532,6 +6578,7 @@ void Test()
#else
TestPool_SameSize();
TestPool_MinBlockCount();
+ TestPool_MinAllocationAlignment();
TestHeapSizeLimit();
#endif
#if VMA_DEBUG_INITIALIZE_ALLOCATIONS