Fix in documentation chapter "Finding out if memory is mappable"

Fixes #143
diff --git a/docs/html/index.html b/docs/html/index.html
index b07b0c9..929bce2 100644
--- a/docs/html/index.html
+++ b/docs/html/index.html
@@ -65,7 +65,7 @@
 <div class="title">Vulkan Memory Allocator </div>  </div>
 </div><!--header-->
 <div class="contents">
-<div class="textblock"><p><b>Version 3.0.0-development</b> (2020-03-23)</p>
+<div class="textblock"><p><b>Version 3.0.0-development</b> (2020-06-24)</p>
 <p>Copyright (c) 2017-2020 Advanced Micro Devices, Inc. All rights reserved. <br  />
 License: MIT</p>
 <p>Documentation of all members: <a class="el" href="vk__mem__alloc_8h.html">vk_mem_alloc.h</a></p>
diff --git a/docs/html/memory_mapping.html b/docs/html/memory_mapping.html
index 03f92b2..d5bfa77 100644
--- a/docs/html/memory_mapping.html
+++ b/docs/html/memory_mapping.html
@@ -143,7 +143,7 @@
 <div class="line"> </div>
 <div class="line">VkMemoryPropertyFlags memFlags;</div>
 <div class="line"><a class="code" href="vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca">vmaGetMemoryTypeProperties</a>(allocator, allocInfo.<a class="code" href="struct_vma_allocation_info.html#a7f6b0aa58c135e488e6b40a388dad9d5">memoryType</a>, &amp;memFlags);</div>
-<div class="line"><span class="keywordflow">if</span>((memFlags &amp; VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)</div>
+<div class="line"><span class="keywordflow">if</span>((memFlags &amp; VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0)</div>
 <div class="line">{</div>
 <div class="line">    <span class="comment">// Allocation ended up in mappable memory. You can map it and access it directly.</span></div>
 <div class="line">    <span class="keywordtype">void</span>* mappedData;</div>
@@ -170,7 +170,7 @@
 <div class="line"><a class="code" href="struct_vma_allocation_info.html">VmaAllocationInfo</a> allocInfo;</div>
 <div class="line"><a class="code" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a>(allocator, &amp;bufCreateInfo, &amp;allocCreateInfo, &amp;buf, &amp;alloc, &amp;allocInfo);</div>
 <div class="line"> </div>
-<div class="line"><span class="keywordflow">if</span>(allocInfo.<a class="code" href="struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13">pUserData</a> != <span class="keyword">nullptr</span>)</div>
+<div class="line"><span class="keywordflow">if</span>(allocInfo.<a class="code" href="struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2">pMappedData</a> != <span class="keyword">nullptr</span>)</div>
 <div class="line">{</div>
 <div class="line">    <span class="comment">// Allocation ended up in mappable memory.</span></div>
 <div class="line">    <span class="comment">// It&#39;s persistently mapped. You can access it directly.</span></div>
@@ -192,7 +192,6 @@
 <div class="ttc" id="avk__mem__alloc_8h_html_ad5bd1243512d099706de88168992f069"><div class="ttname"><a href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069">vmaMapMemory</a></div><div class="ttdeci">VkResult vmaMapMemory(VmaAllocator allocator, VmaAllocation allocation, void **ppData)</div><div class="ttdoc">Maps memory represented by given allocation and returns pointer to it.</div></div>
 <div class="ttc" id="astruct_vma_allocation_info_html_a5eeffbe2d2f30f53370ff14aefbadbe2"><div class="ttname"><a href="struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2">VmaAllocationInfo::pMappedData</a></div><div class="ttdeci">void * pMappedData</div><div class="ttdoc">Pointer to the beginning of this allocation as mapped data.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:3112</div></div>
 <div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:2744</div></div>
-<div class="ttc" id="astruct_vma_allocation_info_html_adc507656149c04de7ed95d0042ba2a13"><div class="ttname"><a href="struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13">VmaAllocationInfo::pUserData</a></div><div class="ttdeci">void * pUserData</div><div class="ttdoc">Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:3117</div></div>
 <div class="ttc" id="avk__mem__alloc_8h_html_ac72ee55598617e8eecca384e746bab51"><div class="ttname"><a href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a></div><div class="ttdeci">VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)</div></div>
 <div class="ttc" id="astruct_vma_allocation_info_html_a7f6b0aa58c135e488e6b40a388dad9d5"><div class="ttname"><a href="struct_vma_allocation_info.html#a7f6b0aa58c135e488e6b40a388dad9d5">VmaAllocationInfo::memoryType</a></div><div class="ttdeci">uint32_t memoryType</div><div class="ttdoc">Memory type index that this allocation was allocated from.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:3078</div></div>
 <div class="ttc" id="avk__mem__alloc_8h_html_ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f"><div class="ttname"><a href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f">VMA_ALLOCATION_CREATE_MAPPED_BIT</a></div><div class="ttdeci">@ VMA_ALLOCATION_CREATE_MAPPED_BIT</div><div class="ttdoc">Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:2655</div></div>
diff --git a/docs/html/vk__mem__alloc_8h_source.html b/docs/html/vk__mem__alloc_8h_source.html
index 641ff65..7def349 100644
--- a/docs/html/vk__mem__alloc_8h_source.html
+++ b/docs/html/vk__mem__alloc_8h_source.html
@@ -923,7 +923,7 @@
 <div class="line"><a name="l03943"></a><span class="lineno"> 3943</span>&#160; </div>
 <div class="line"><a name="l03944"></a><span class="lineno"> 3944</span>&#160;<span class="preprocessor">#if defined(__ANDROID_API__) &amp;&amp; (__ANDROID_API__ &lt; 16)</span></div>
 <div class="line"><a name="l03945"></a><span class="lineno"> 3945</span>&#160;<span class="preprocessor">#include &lt;cstdlib&gt;</span></div>
-<div class="line"><a name="l03946"></a><span class="lineno"> 3946</span>&#160;<span class="keywordtype">void</span> *aligned_alloc(<span class="keywordtype">size_t</span> alignment, <span class="keywordtype">size_t</span> size)</div>
+<div class="line"><a name="l03946"></a><span class="lineno"> 3946</span>&#160;<span class="keywordtype">void</span> *vma_aligned_alloc(<span class="keywordtype">size_t</span> alignment, <span class="keywordtype">size_t</span> size)</div>
 <div class="line"><a name="l03947"></a><span class="lineno"> 3947</span>&#160;{</div>
 <div class="line"><a name="l03948"></a><span class="lineno"> 3948</span>&#160;    <span class="comment">// alignment must be &gt;= sizeof(void*)</span></div>
 <div class="line"><a name="l03949"></a><span class="lineno"> 3949</span>&#160;    <span class="keywordflow">if</span>(alignment &lt; <span class="keyword">sizeof</span>(<span class="keywordtype">void</span>*))</div>
@@ -935,5750 +935,5750 @@
 <div class="line"><a name="l03955"></a><span class="lineno"> 3955</span>&#160;}</div>
 <div class="line"><a name="l03956"></a><span class="lineno"> 3956</span>&#160;<span class="preprocessor">#elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__linux__) &amp;&amp; defined(__GLIBCXX__) &amp;&amp; !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC))</span></div>
 <div class="line"><a name="l03957"></a><span class="lineno"> 3957</span>&#160;<span class="preprocessor">#include &lt;cstdlib&gt;</span></div>
-<div class="line"><a name="l03958"></a><span class="lineno"> 3958</span>&#160;<span class="keywordtype">void</span> *aligned_alloc(<span class="keywordtype">size_t</span> alignment, <span class="keywordtype">size_t</span> size)</div>
-<div class="line"><a name="l03959"></a><span class="lineno"> 3959</span>&#160;{</div>
-<div class="line"><a name="l03960"></a><span class="lineno"> 3960</span>&#160;    <span class="comment">// alignment must be &gt;= sizeof(void*)</span></div>
-<div class="line"><a name="l03961"></a><span class="lineno"> 3961</span>&#160;    <span class="keywordflow">if</span>(alignment &lt; <span class="keyword">sizeof</span>(<span class="keywordtype">void</span>*))</div>
-<div class="line"><a name="l03962"></a><span class="lineno"> 3962</span>&#160;    {</div>
-<div class="line"><a name="l03963"></a><span class="lineno"> 3963</span>&#160;        alignment = <span class="keyword">sizeof</span>(<span class="keywordtype">void</span>*);</div>
-<div class="line"><a name="l03964"></a><span class="lineno"> 3964</span>&#160;    }</div>
-<div class="line"><a name="l03965"></a><span class="lineno"> 3965</span>&#160; </div>
-<div class="line"><a name="l03966"></a><span class="lineno"> 3966</span>&#160;    <span class="keywordtype">void</span> *pointer;</div>
-<div class="line"><a name="l03967"></a><span class="lineno"> 3967</span>&#160;    <span class="keywordflow">if</span>(posix_memalign(&amp;pointer, alignment, size) == 0)</div>
-<div class="line"><a name="l03968"></a><span class="lineno"> 3968</span>&#160;        <span class="keywordflow">return</span> pointer;</div>
-<div class="line"><a name="l03969"></a><span class="lineno"> 3969</span>&#160;    <span class="keywordflow">return</span> VMA_NULL;</div>
-<div class="line"><a name="l03970"></a><span class="lineno"> 3970</span>&#160;}</div>
-<div class="line"><a name="l03971"></a><span class="lineno"> 3971</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l03972"></a><span class="lineno"> 3972</span>&#160; </div>
-<div class="line"><a name="l03973"></a><span class="lineno"> 3973</span>&#160;<span class="comment">// If your compiler is not compatible with C++11 and definition of</span></div>
-<div class="line"><a name="l03974"></a><span class="lineno"> 3974</span>&#160;<span class="comment">// aligned_alloc() function is missing, uncommeting following line may help:</span></div>
-<div class="line"><a name="l03975"></a><span class="lineno"> 3975</span>&#160; </div>
-<div class="line"><a name="l03976"></a><span class="lineno"> 3976</span>&#160;<span class="comment">//#include &lt;malloc.h&gt;</span></div>
-<div class="line"><a name="l03977"></a><span class="lineno"> 3977</span>&#160; </div>
-<div class="line"><a name="l03978"></a><span class="lineno"> 3978</span>&#160;<span class="comment">// Normal assert to check for programmer&#39;s errors, especially in Debug configuration.</span></div>
-<div class="line"><a name="l03979"></a><span class="lineno"> 3979</span>&#160;<span class="preprocessor">#ifndef VMA_ASSERT</span></div>
-<div class="line"><a name="l03980"></a><span class="lineno"> 3980</span>&#160;<span class="preprocessor">   #ifdef NDEBUG</span></div>
-<div class="line"><a name="l03981"></a><span class="lineno"> 3981</span>&#160;<span class="preprocessor">       #define VMA_ASSERT(expr)</span></div>
-<div class="line"><a name="l03982"></a><span class="lineno"> 3982</span>&#160;<span class="preprocessor">   #else</span></div>
-<div class="line"><a name="l03983"></a><span class="lineno"> 3983</span>&#160;<span class="preprocessor">       #define VMA_ASSERT(expr)         assert(expr)</span></div>
-<div class="line"><a name="l03984"></a><span class="lineno"> 3984</span>&#160;<span class="preprocessor">   #endif</span></div>
-<div class="line"><a name="l03985"></a><span class="lineno"> 3985</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l03986"></a><span class="lineno"> 3986</span>&#160; </div>
-<div class="line"><a name="l03987"></a><span class="lineno"> 3987</span>&#160;<span class="comment">// Assert that will be called very often, like inside data structures e.g. operator[].</span></div>
-<div class="line"><a name="l03988"></a><span class="lineno"> 3988</span>&#160;<span class="comment">// Making it non-empty can make program slow.</span></div>
-<div class="line"><a name="l03989"></a><span class="lineno"> 3989</span>&#160;<span class="preprocessor">#ifndef VMA_HEAVY_ASSERT</span></div>
-<div class="line"><a name="l03990"></a><span class="lineno"> 3990</span>&#160;<span class="preprocessor">   #ifdef NDEBUG</span></div>
-<div class="line"><a name="l03991"></a><span class="lineno"> 3991</span>&#160;<span class="preprocessor">       #define VMA_HEAVY_ASSERT(expr)</span></div>
-<div class="line"><a name="l03992"></a><span class="lineno"> 3992</span>&#160;<span class="preprocessor">   #else</span></div>
-<div class="line"><a name="l03993"></a><span class="lineno"> 3993</span>&#160;<span class="preprocessor">       #define VMA_HEAVY_ASSERT(expr)   //VMA_ASSERT(expr)</span></div>
-<div class="line"><a name="l03994"></a><span class="lineno"> 3994</span>&#160;<span class="preprocessor">   #endif</span></div>
-<div class="line"><a name="l03995"></a><span class="lineno"> 3995</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l03996"></a><span class="lineno"> 3996</span>&#160; </div>
-<div class="line"><a name="l03997"></a><span class="lineno"> 3997</span>&#160;<span class="preprocessor">#ifndef VMA_ALIGN_OF</span></div>
-<div class="line"><a name="l03998"></a><span class="lineno"> 3998</span>&#160;<span class="preprocessor">   #define VMA_ALIGN_OF(type)       (__alignof(type))</span></div>
-<div class="line"><a name="l03999"></a><span class="lineno"> 3999</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04000"></a><span class="lineno"> 4000</span>&#160; </div>
-<div class="line"><a name="l04001"></a><span class="lineno"> 4001</span>&#160;<span class="preprocessor">#ifndef VMA_SYSTEM_ALIGNED_MALLOC</span></div>
-<div class="line"><a name="l04002"></a><span class="lineno"> 4002</span>&#160;<span class="preprocessor">   #if defined(_WIN32)</span></div>
-<div class="line"><a name="l04003"></a><span class="lineno"> 4003</span>&#160;<span class="preprocessor">       #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment)   (_aligned_malloc((size), (alignment)))</span></div>
-<div class="line"><a name="l04004"></a><span class="lineno"> 4004</span>&#160;<span class="preprocessor">   #else</span></div>
-<div class="line"><a name="l04005"></a><span class="lineno"> 4005</span>&#160;<span class="preprocessor">       #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment)   (aligned_alloc((alignment), (size) ))</span></div>
-<div class="line"><a name="l04006"></a><span class="lineno"> 4006</span>&#160;<span class="preprocessor">   #endif</span></div>
-<div class="line"><a name="l04007"></a><span class="lineno"> 4007</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04008"></a><span class="lineno"> 4008</span>&#160; </div>
-<div class="line"><a name="l04009"></a><span class="lineno"> 4009</span>&#160;<span class="preprocessor">#ifndef VMA_SYSTEM_FREE</span></div>
-<div class="line"><a name="l04010"></a><span class="lineno"> 4010</span>&#160;<span class="preprocessor">   #if defined(_WIN32)</span></div>
-<div class="line"><a name="l04011"></a><span class="lineno"> 4011</span>&#160;<span class="preprocessor">       #define VMA_SYSTEM_FREE(ptr)   _aligned_free(ptr)</span></div>
-<div class="line"><a name="l04012"></a><span class="lineno"> 4012</span>&#160;<span class="preprocessor">   #else</span></div>
-<div class="line"><a name="l04013"></a><span class="lineno"> 4013</span>&#160;<span class="preprocessor">       #define VMA_SYSTEM_FREE(ptr)   free(ptr)</span></div>
-<div class="line"><a name="l04014"></a><span class="lineno"> 4014</span>&#160;<span class="preprocessor">   #endif</span></div>
-<div class="line"><a name="l04015"></a><span class="lineno"> 4015</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04016"></a><span class="lineno"> 4016</span>&#160; </div>
-<div class="line"><a name="l04017"></a><span class="lineno"> 4017</span>&#160;<span class="preprocessor">#ifndef VMA_MIN</span></div>
-<div class="line"><a name="l04018"></a><span class="lineno"> 4018</span>&#160;<span class="preprocessor">   #define VMA_MIN(v1, v2)    (std::min((v1), (v2)))</span></div>
-<div class="line"><a name="l04019"></a><span class="lineno"> 4019</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04020"></a><span class="lineno"> 4020</span>&#160; </div>
-<div class="line"><a name="l04021"></a><span class="lineno"> 4021</span>&#160;<span class="preprocessor">#ifndef VMA_MAX</span></div>
-<div class="line"><a name="l04022"></a><span class="lineno"> 4022</span>&#160;<span class="preprocessor">   #define VMA_MAX(v1, v2)    (std::max((v1), (v2)))</span></div>
-<div class="line"><a name="l04023"></a><span class="lineno"> 4023</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04024"></a><span class="lineno"> 4024</span>&#160; </div>
-<div class="line"><a name="l04025"></a><span class="lineno"> 4025</span>&#160;<span class="preprocessor">#ifndef VMA_SWAP</span></div>
-<div class="line"><a name="l04026"></a><span class="lineno"> 4026</span>&#160;<span class="preprocessor">   #define VMA_SWAP(v1, v2)   std::swap((v1), (v2))</span></div>
-<div class="line"><a name="l04027"></a><span class="lineno"> 4027</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04028"></a><span class="lineno"> 4028</span>&#160; </div>
-<div class="line"><a name="l04029"></a><span class="lineno"> 4029</span>&#160;<span class="preprocessor">#ifndef VMA_SORT</span></div>
-<div class="line"><a name="l04030"></a><span class="lineno"> 4030</span>&#160;<span class="preprocessor">   #define VMA_SORT(beg, end, cmp)  std::sort(beg, end, cmp)</span></div>
-<div class="line"><a name="l04031"></a><span class="lineno"> 4031</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04032"></a><span class="lineno"> 4032</span>&#160; </div>
-<div class="line"><a name="l04033"></a><span class="lineno"> 4033</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_LOG</span></div>
-<div class="line"><a name="l04034"></a><span class="lineno"> 4034</span>&#160;<span class="preprocessor">   #define VMA_DEBUG_LOG(format, ...)</span></div>
-<div class="line"><a name="l04035"></a><span class="lineno"> 4035</span>&#160;   <span class="comment">/*</span></div>
-<div class="line"><a name="l04036"></a><span class="lineno"> 4036</span>&#160;<span class="comment">   #define VMA_DEBUG_LOG(format, ...) do { \</span></div>
-<div class="line"><a name="l04037"></a><span class="lineno"> 4037</span>&#160;<span class="comment">       printf(format, __VA_ARGS__); \</span></div>
-<div class="line"><a name="l04038"></a><span class="lineno"> 4038</span>&#160;<span class="comment">       printf(&quot;\n&quot;); \</span></div>
-<div class="line"><a name="l04039"></a><span class="lineno"> 4039</span>&#160;<span class="comment">   } while(false)</span></div>
-<div class="line"><a name="l04040"></a><span class="lineno"> 4040</span>&#160;<span class="comment">   */</span></div>
-<div class="line"><a name="l04041"></a><span class="lineno"> 4041</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04042"></a><span class="lineno"> 4042</span>&#160; </div>
-<div class="line"><a name="l04043"></a><span class="lineno"> 4043</span>&#160;<span class="comment">// Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString.</span></div>
-<div class="line"><a name="l04044"></a><span class="lineno"> 4044</span>&#160;<span class="preprocessor">#if VMA_STATS_STRING_ENABLED</span></div>
-<div class="line"><a name="l04045"></a><span class="lineno"> 4045</span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> VmaUint32ToStr(<span class="keywordtype">char</span>* outStr, <span class="keywordtype">size_t</span> strLen, uint32_t num)</div>
-<div class="line"><a name="l04046"></a><span class="lineno"> 4046</span>&#160;    {</div>
-<div class="line"><a name="l04047"></a><span class="lineno"> 4047</span>&#160;        snprintf(outStr, strLen, <span class="stringliteral">&quot;%u&quot;</span>, <span class="keyword">static_cast&lt;</span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span><span class="keyword">&gt;</span>(num));</div>
-<div class="line"><a name="l04048"></a><span class="lineno"> 4048</span>&#160;    }</div>
-<div class="line"><a name="l04049"></a><span class="lineno"> 4049</span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> VmaUint64ToStr(<span class="keywordtype">char</span>* outStr, <span class="keywordtype">size_t</span> strLen, uint64_t num)</div>
-<div class="line"><a name="l04050"></a><span class="lineno"> 4050</span>&#160;    {</div>
-<div class="line"><a name="l04051"></a><span class="lineno"> 4051</span>&#160;        snprintf(outStr, strLen, <span class="stringliteral">&quot;%llu&quot;</span>, <span class="keyword">static_cast&lt;</span><span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span><span class="keyword">&gt;</span>(num));</div>
-<div class="line"><a name="l04052"></a><span class="lineno"> 4052</span>&#160;    }</div>
-<div class="line"><a name="l04053"></a><span class="lineno"> 4053</span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> VmaPtrToStr(<span class="keywordtype">char</span>* outStr, <span class="keywordtype">size_t</span> strLen, <span class="keyword">const</span> <span class="keywordtype">void</span>* ptr)</div>
-<div class="line"><a name="l04054"></a><span class="lineno"> 4054</span>&#160;    {</div>
-<div class="line"><a name="l04055"></a><span class="lineno"> 4055</span>&#160;        snprintf(outStr, strLen, <span class="stringliteral">&quot;%p&quot;</span>, ptr);</div>
-<div class="line"><a name="l04056"></a><span class="lineno"> 4056</span>&#160;    }</div>
-<div class="line"><a name="l04057"></a><span class="lineno"> 4057</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04058"></a><span class="lineno"> 4058</span>&#160; </div>
-<div class="line"><a name="l04059"></a><span class="lineno"> 4059</span>&#160;<span class="preprocessor">#ifndef VMA_MUTEX</span></div>
-<div class="line"><a name="l04060"></a><span class="lineno"> 4060</span>&#160;    <span class="keyword">class </span>VmaMutex</div>
-<div class="line"><a name="l04061"></a><span class="lineno"> 4061</span>&#160;    {</div>
-<div class="line"><a name="l04062"></a><span class="lineno"> 4062</span>&#160;    <span class="keyword">public</span>:</div>
-<div class="line"><a name="l04063"></a><span class="lineno"> 4063</span>&#160;        <span class="keywordtype">void</span> Lock() { m_Mutex.lock(); }</div>
-<div class="line"><a name="l04064"></a><span class="lineno"> 4064</span>&#160;        <span class="keywordtype">void</span> Unlock() { m_Mutex.unlock(); }</div>
-<div class="line"><a name="l04065"></a><span class="lineno"> 4065</span>&#160;        <span class="keywordtype">bool</span> TryLock() { <span class="keywordflow">return</span> m_Mutex.try_lock(); }</div>
-<div class="line"><a name="l04066"></a><span class="lineno"> 4066</span>&#160;    <span class="keyword">private</span>:</div>
-<div class="line"><a name="l04067"></a><span class="lineno"> 4067</span>&#160;        std::mutex m_Mutex;</div>
-<div class="line"><a name="l04068"></a><span class="lineno"> 4068</span>&#160;    };</div>
-<div class="line"><a name="l04069"></a><span class="lineno"> 4069</span>&#160;<span class="preprocessor">    #define VMA_MUTEX VmaMutex</span></div>
-<div class="line"><a name="l04070"></a><span class="lineno"> 4070</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04071"></a><span class="lineno"> 4071</span>&#160; </div>
-<div class="line"><a name="l04072"></a><span class="lineno"> 4072</span>&#160;<span class="comment">// Read-write mutex, where &quot;read&quot; is shared access, &quot;write&quot; is exclusive access.</span></div>
-<div class="line"><a name="l04073"></a><span class="lineno"> 4073</span>&#160;<span class="preprocessor">#ifndef VMA_RW_MUTEX</span></div>
-<div class="line"><a name="l04074"></a><span class="lineno"> 4074</span>&#160;<span class="preprocessor">    #if VMA_USE_STL_SHARED_MUTEX</span></div>
-<div class="line"><a name="l04075"></a><span class="lineno"> 4075</span>&#160;        <span class="comment">// Use std::shared_mutex from C++17.</span></div>
-<div class="line"><a name="l04076"></a><span class="lineno"> 4076</span>&#160;<span class="preprocessor">        #include &lt;shared_mutex&gt;</span></div>
-<div class="line"><a name="l04077"></a><span class="lineno"> 4077</span>&#160;        <span class="keyword">class </span>VmaRWMutex</div>
-<div class="line"><a name="l04078"></a><span class="lineno"> 4078</span>&#160;        {</div>
-<div class="line"><a name="l04079"></a><span class="lineno"> 4079</span>&#160;        <span class="keyword">public</span>:</div>
-<div class="line"><a name="l04080"></a><span class="lineno"> 4080</span>&#160;            <span class="keywordtype">void</span> LockRead() { m_Mutex.lock_shared(); }</div>
-<div class="line"><a name="l04081"></a><span class="lineno"> 4081</span>&#160;            <span class="keywordtype">void</span> UnlockRead() { m_Mutex.unlock_shared(); }</div>
-<div class="line"><a name="l04082"></a><span class="lineno"> 4082</span>&#160;            <span class="keywordtype">bool</span> TryLockRead() { <span class="keywordflow">return</span> m_Mutex.try_lock_shared(); }</div>
-<div class="line"><a name="l04083"></a><span class="lineno"> 4083</span>&#160;            <span class="keywordtype">void</span> LockWrite() { m_Mutex.lock(); }</div>
-<div class="line"><a name="l04084"></a><span class="lineno"> 4084</span>&#160;            <span class="keywordtype">void</span> UnlockWrite() { m_Mutex.unlock(); }</div>
-<div class="line"><a name="l04085"></a><span class="lineno"> 4085</span>&#160;            <span class="keywordtype">bool</span> TryLockWrite() { <span class="keywordflow">return</span> m_Mutex.try_lock(); }</div>
-<div class="line"><a name="l04086"></a><span class="lineno"> 4086</span>&#160;        <span class="keyword">private</span>:</div>
-<div class="line"><a name="l04087"></a><span class="lineno"> 4087</span>&#160;            std::shared_mutex m_Mutex;</div>
-<div class="line"><a name="l04088"></a><span class="lineno"> 4088</span>&#160;        };</div>
-<div class="line"><a name="l04089"></a><span class="lineno"> 4089</span>&#160;<span class="preprocessor">        #define VMA_RW_MUTEX VmaRWMutex</span></div>
-<div class="line"><a name="l04090"></a><span class="lineno"> 4090</span>&#160;<span class="preprocessor">    #elif defined(_WIN32) &amp;&amp; defined(WINVER) &amp;&amp; WINVER &gt;= 0x0600</span></div>
-<div class="line"><a name="l04091"></a><span class="lineno"> 4091</span>&#160;        <span class="comment">// Use SRWLOCK from WinAPI.</span></div>
-<div class="line"><a name="l04092"></a><span class="lineno"> 4092</span>&#160;        <span class="comment">// Minimum supported client = Windows Vista, server = Windows Server 2008.</span></div>
-<div class="line"><a name="l04093"></a><span class="lineno"> 4093</span>&#160;        <span class="keyword">class </span>VmaRWMutex</div>
-<div class="line"><a name="l04094"></a><span class="lineno"> 4094</span>&#160;        {</div>
-<div class="line"><a name="l04095"></a><span class="lineno"> 4095</span>&#160;        <span class="keyword">public</span>:</div>
-<div class="line"><a name="l04096"></a><span class="lineno"> 4096</span>&#160;            VmaRWMutex() { InitializeSRWLock(&amp;m_Lock); }</div>
-<div class="line"><a name="l04097"></a><span class="lineno"> 4097</span>&#160;            <span class="keywordtype">void</span> LockRead() { AcquireSRWLockShared(&amp;m_Lock); }</div>
-<div class="line"><a name="l04098"></a><span class="lineno"> 4098</span>&#160;            <span class="keywordtype">void</span> UnlockRead() { ReleaseSRWLockShared(&amp;m_Lock); }</div>
-<div class="line"><a name="l04099"></a><span class="lineno"> 4099</span>&#160;            <span class="keywordtype">bool</span> TryLockRead() { <span class="keywordflow">return</span> TryAcquireSRWLockShared(&amp;m_Lock) != FALSE; }</div>
-<div class="line"><a name="l04100"></a><span class="lineno"> 4100</span>&#160;            <span class="keywordtype">void</span> LockWrite() { AcquireSRWLockExclusive(&amp;m_Lock); }</div>
-<div class="line"><a name="l04101"></a><span class="lineno"> 4101</span>&#160;            <span class="keywordtype">void</span> UnlockWrite() { ReleaseSRWLockExclusive(&amp;m_Lock); }</div>
-<div class="line"><a name="l04102"></a><span class="lineno"> 4102</span>&#160;            <span class="keywordtype">bool</span> TryLockWrite() { <span class="keywordflow">return</span> TryAcquireSRWLockExclusive(&amp;m_Lock) != FALSE; }</div>
-<div class="line"><a name="l04103"></a><span class="lineno"> 4103</span>&#160;        <span class="keyword">private</span>:</div>
-<div class="line"><a name="l04104"></a><span class="lineno"> 4104</span>&#160;            SRWLOCK m_Lock;</div>
-<div class="line"><a name="l04105"></a><span class="lineno"> 4105</span>&#160;        };</div>
-<div class="line"><a name="l04106"></a><span class="lineno"> 4106</span>&#160;<span class="preprocessor">        #define VMA_RW_MUTEX VmaRWMutex</span></div>
-<div class="line"><a name="l04107"></a><span class="lineno"> 4107</span>&#160;<span class="preprocessor">    #else</span></div>
-<div class="line"><a name="l04108"></a><span class="lineno"> 4108</span>&#160;        <span class="comment">// Less efficient fallback: Use normal mutex.</span></div>
-<div class="line"><a name="l04109"></a><span class="lineno"> 4109</span>&#160;        <span class="keyword">class </span>VmaRWMutex</div>
-<div class="line"><a name="l04110"></a><span class="lineno"> 4110</span>&#160;        {</div>
-<div class="line"><a name="l04111"></a><span class="lineno"> 4111</span>&#160;        <span class="keyword">public</span>:</div>
-<div class="line"><a name="l04112"></a><span class="lineno"> 4112</span>&#160;            <span class="keywordtype">void</span> LockRead() { m_Mutex.Lock(); }</div>
-<div class="line"><a name="l04113"></a><span class="lineno"> 4113</span>&#160;            <span class="keywordtype">void</span> UnlockRead() { m_Mutex.Unlock(); }</div>
-<div class="line"><a name="l04114"></a><span class="lineno"> 4114</span>&#160;            <span class="keywordtype">bool</span> TryLockRead() { <span class="keywordflow">return</span> m_Mutex.TryLock(); }</div>
-<div class="line"><a name="l04115"></a><span class="lineno"> 4115</span>&#160;            <span class="keywordtype">void</span> LockWrite() { m_Mutex.Lock(); }</div>
-<div class="line"><a name="l04116"></a><span class="lineno"> 4116</span>&#160;            <span class="keywordtype">void</span> UnlockWrite() { m_Mutex.Unlock(); }</div>
-<div class="line"><a name="l04117"></a><span class="lineno"> 4117</span>&#160;            <span class="keywordtype">bool</span> TryLockWrite() { <span class="keywordflow">return</span> m_Mutex.TryLock(); }</div>
-<div class="line"><a name="l04118"></a><span class="lineno"> 4118</span>&#160;        <span class="keyword">private</span>:</div>
-<div class="line"><a name="l04119"></a><span class="lineno"> 4119</span>&#160;            VMA_MUTEX m_Mutex;</div>
-<div class="line"><a name="l04120"></a><span class="lineno"> 4120</span>&#160;        };</div>
-<div class="line"><a name="l04121"></a><span class="lineno"> 4121</span>&#160;<span class="preprocessor">        #define VMA_RW_MUTEX VmaRWMutex</span></div>
-<div class="line"><a name="l04122"></a><span class="lineno"> 4122</span>&#160;<span class="preprocessor">    #endif // #if VMA_USE_STL_SHARED_MUTEX</span></div>
-<div class="line"><a name="l04123"></a><span class="lineno"> 4123</span>&#160;<span class="preprocessor">#endif // #ifndef VMA_RW_MUTEX</span></div>
-<div class="line"><a name="l04124"></a><span class="lineno"> 4124</span>&#160; </div>
-<div class="line"><a name="l04125"></a><span class="lineno"> 4125</span>&#160;<span class="comment">/*</span></div>
-<div class="line"><a name="l04126"></a><span class="lineno"> 4126</span>&#160;<span class="comment">If providing your own implementation, you need to implement a subset of std::atomic.</span></div>
-<div class="line"><a name="l04127"></a><span class="lineno"> 4127</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l04128"></a><span class="lineno"> 4128</span>&#160;<span class="preprocessor">#ifndef VMA_ATOMIC_UINT32</span></div>
-<div class="line"><a name="l04129"></a><span class="lineno"> 4129</span>&#160;<span class="preprocessor">    #include &lt;atomic&gt;</span></div>
-<div class="line"><a name="l04130"></a><span class="lineno"> 4130</span>&#160;<span class="preprocessor">    #define VMA_ATOMIC_UINT32 std::atomic&lt;uint32_t&gt;</span></div>
-<div class="line"><a name="l04131"></a><span class="lineno"> 4131</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04132"></a><span class="lineno"> 4132</span>&#160; </div>
-<div class="line"><a name="l04133"></a><span class="lineno"> 4133</span>&#160;<span class="preprocessor">#ifndef VMA_ATOMIC_UINT64</span></div>
-<div class="line"><a name="l04134"></a><span class="lineno"> 4134</span>&#160;<span class="preprocessor">    #include &lt;atomic&gt;</span></div>
-<div class="line"><a name="l04135"></a><span class="lineno"> 4135</span>&#160;<span class="preprocessor">    #define VMA_ATOMIC_UINT64 std::atomic&lt;uint64_t&gt;</span></div>
-<div class="line"><a name="l04136"></a><span class="lineno"> 4136</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04137"></a><span class="lineno"> 4137</span>&#160; </div>
-<div class="line"><a name="l04138"></a><span class="lineno"> 4138</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_ALWAYS_DEDICATED_MEMORY</span></div>
-<div class="line"><a name="l04139"></a><span class="lineno"> 4139</span>&#160; </div>
-<div class="line"><a name="l04143"></a><span class="lineno"> 4143</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_ALWAYS_DEDICATED_MEMORY (0)</span></div>
-<div class="line"><a name="l04144"></a><span class="lineno"> 4144</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04145"></a><span class="lineno"> 4145</span>&#160; </div>
-<div class="line"><a name="l04146"></a><span class="lineno"> 4146</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_ALIGNMENT</span></div>
+<div class="line"><a name="l03958"></a><span class="lineno"> 3958</span>&#160; </div>
+<div class="line"><a name="l03959"></a><span class="lineno"> 3959</span>&#160;<span class="preprocessor">#if defined(__APPLE__)</span></div>
+<div class="line"><a name="l03960"></a><span class="lineno"> 3960</span>&#160;<span class="preprocessor">#include &lt;AvailabilityMacros.h&gt;</span></div>
+<div class="line"><a name="l03961"></a><span class="lineno"> 3961</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l03962"></a><span class="lineno"> 3962</span>&#160; </div>
+<div class="line"><a name="l03963"></a><span class="lineno"> 3963</span>&#160;<span class="keywordtype">void</span> *vma_aligned_alloc(<span class="keywordtype">size_t</span> alignment, <span class="keywordtype">size_t</span> size)</div>
+<div class="line"><a name="l03964"></a><span class="lineno"> 3964</span>&#160;{</div>
+<div class="line"><a name="l03965"></a><span class="lineno"> 3965</span>&#160;<span class="preprocessor">#if defined(__APPLE__) &amp;&amp; (defined(MAC_OS_X_VERSION_10_16) || defined(__IPHONE_14_0))</span></div>
+<div class="line"><a name="l03966"></a><span class="lineno"> 3966</span>&#160;<span class="preprocessor">#if MAC_OS_X_VERSION_MAX_ALLOWED &gt;= MAC_OS_X_VERSION_10_16 || __IPHONE_OS_VERSION_MAX_ALLOWED &gt;= __IPHONE_14_0</span></div>
+<div class="line"><a name="l03967"></a><span class="lineno"> 3967</span>&#160;    <span class="comment">// For C++14, usr/include/malloc/_malloc.h declares aligned_alloc()) only</span></div>
+<div class="line"><a name="l03968"></a><span class="lineno"> 3968</span>&#160;    <span class="comment">// with the MacOSX11.0 SDK in Xcode 12 (which is what adds </span></div>
+<div class="line"><a name="l03969"></a><span class="lineno"> 3969</span>&#160;    <span class="comment">// MAC_OS_X_VERSION_10_16), even though the function is marked</span></div>
+<div class="line"><a name="l03970"></a><span class="lineno"> 3970</span>&#160;    <span class="comment">// availabe for 10.15. That&#39;s why the preprocessor checks for 10.16 but</span></div>
+<div class="line"><a name="l03971"></a><span class="lineno"> 3971</span>&#160;    <span class="comment">// the __builtin_available checks for 10.15.</span></div>
+<div class="line"><a name="l03972"></a><span class="lineno"> 3972</span>&#160;    <span class="comment">// People who use C++17 could call aligned_alloc with the 10.15 SDK already.</span></div>
+<div class="line"><a name="l03973"></a><span class="lineno"> 3973</span>&#160;    <span class="keywordflow">if</span> (__builtin_available(macOS 10.15, iOS 13, *))</div>
+<div class="line"><a name="l03974"></a><span class="lineno"> 3974</span>&#160;        <span class="keywordflow">return</span> aligned_alloc(alignment, size);</div>
+<div class="line"><a name="l03975"></a><span class="lineno"> 3975</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l03976"></a><span class="lineno"> 3976</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l03977"></a><span class="lineno"> 3977</span>&#160;    <span class="comment">// alignment must be &gt;= sizeof(void*)</span></div>
+<div class="line"><a name="l03978"></a><span class="lineno"> 3978</span>&#160;    <span class="keywordflow">if</span>(alignment &lt; <span class="keyword">sizeof</span>(<span class="keywordtype">void</span>*))</div>
+<div class="line"><a name="l03979"></a><span class="lineno"> 3979</span>&#160;    {</div>
+<div class="line"><a name="l03980"></a><span class="lineno"> 3980</span>&#160;        alignment = <span class="keyword">sizeof</span>(<span class="keywordtype">void</span>*);</div>
+<div class="line"><a name="l03981"></a><span class="lineno"> 3981</span>&#160;    }</div>
+<div class="line"><a name="l03982"></a><span class="lineno"> 3982</span>&#160; </div>
+<div class="line"><a name="l03983"></a><span class="lineno"> 3983</span>&#160;    <span class="keywordtype">void</span> *pointer;</div>
+<div class="line"><a name="l03984"></a><span class="lineno"> 3984</span>&#160;    <span class="keywordflow">if</span>(posix_memalign(&amp;pointer, alignment, size) == 0)</div>
+<div class="line"><a name="l03985"></a><span class="lineno"> 3985</span>&#160;        <span class="keywordflow">return</span> pointer;</div>
+<div class="line"><a name="l03986"></a><span class="lineno"> 3986</span>&#160;    <span class="keywordflow">return</span> VMA_NULL;</div>
+<div class="line"><a name="l03987"></a><span class="lineno"> 3987</span>&#160;}</div>
+<div class="line"><a name="l03988"></a><span class="lineno"> 3988</span>&#160;<span class="preprocessor">#elif defined(_WIN32)</span></div>
+<div class="line"><a name="l03989"></a><span class="lineno"> 3989</span>&#160;<span class="keywordtype">void</span> *vma_aligned_alloc(<span class="keywordtype">size_t</span> alignment, <span class="keywordtype">size_t</span> size)</div>
+<div class="line"><a name="l03990"></a><span class="lineno"> 3990</span>&#160;{</div>
+<div class="line"><a name="l03991"></a><span class="lineno"> 3991</span>&#160;    <span class="keywordflow">return</span> _aligned_malloc(size, alignment);</div>
+<div class="line"><a name="l03992"></a><span class="lineno"> 3992</span>&#160;}</div>
+<div class="line"><a name="l03993"></a><span class="lineno"> 3993</span>&#160;<span class="preprocessor">#else</span></div>
+<div class="line"><a name="l03994"></a><span class="lineno"> 3994</span>&#160;<span class="keywordtype">void</span> *vma_aligned_alloc(<span class="keywordtype">size_t</span> alignment, <span class="keywordtype">size_t</span> size)</div>
+<div class="line"><a name="l03995"></a><span class="lineno"> 3995</span>&#160;{</div>
+<div class="line"><a name="l03996"></a><span class="lineno"> 3996</span>&#160;    <span class="keywordflow">return</span> aligned_alloc(alignment, size);</div>
+<div class="line"><a name="l03997"></a><span class="lineno"> 3997</span>&#160;}</div>
+<div class="line"><a name="l03998"></a><span class="lineno"> 3998</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l03999"></a><span class="lineno"> 3999</span>&#160; </div>
+<div class="line"><a name="l04000"></a><span class="lineno"> 4000</span>&#160;<span class="comment">// If your compiler is not compatible with C++11 and definition of</span></div>
+<div class="line"><a name="l04001"></a><span class="lineno"> 4001</span>&#160;<span class="comment">// aligned_alloc() function is missing, uncommeting following line may help:</span></div>
+<div class="line"><a name="l04002"></a><span class="lineno"> 4002</span>&#160; </div>
+<div class="line"><a name="l04003"></a><span class="lineno"> 4003</span>&#160;<span class="comment">//#include &lt;malloc.h&gt;</span></div>
+<div class="line"><a name="l04004"></a><span class="lineno"> 4004</span>&#160; </div>
+<div class="line"><a name="l04005"></a><span class="lineno"> 4005</span>&#160;<span class="comment">// Normal assert to check for programmer&#39;s errors, especially in Debug configuration.</span></div>
+<div class="line"><a name="l04006"></a><span class="lineno"> 4006</span>&#160;<span class="preprocessor">#ifndef VMA_ASSERT</span></div>
+<div class="line"><a name="l04007"></a><span class="lineno"> 4007</span>&#160;<span class="preprocessor">   #ifdef NDEBUG</span></div>
+<div class="line"><a name="l04008"></a><span class="lineno"> 4008</span>&#160;<span class="preprocessor">       #define VMA_ASSERT(expr)</span></div>
+<div class="line"><a name="l04009"></a><span class="lineno"> 4009</span>&#160;<span class="preprocessor">   #else</span></div>
+<div class="line"><a name="l04010"></a><span class="lineno"> 4010</span>&#160;<span class="preprocessor">       #define VMA_ASSERT(expr)         assert(expr)</span></div>
+<div class="line"><a name="l04011"></a><span class="lineno"> 4011</span>&#160;<span class="preprocessor">   #endif</span></div>
+<div class="line"><a name="l04012"></a><span class="lineno"> 4012</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04013"></a><span class="lineno"> 4013</span>&#160; </div>
+<div class="line"><a name="l04014"></a><span class="lineno"> 4014</span>&#160;<span class="comment">// Assert that will be called very often, like inside data structures e.g. operator[].</span></div>
+<div class="line"><a name="l04015"></a><span class="lineno"> 4015</span>&#160;<span class="comment">// Making it non-empty can make program slow.</span></div>
+<div class="line"><a name="l04016"></a><span class="lineno"> 4016</span>&#160;<span class="preprocessor">#ifndef VMA_HEAVY_ASSERT</span></div>
+<div class="line"><a name="l04017"></a><span class="lineno"> 4017</span>&#160;<span class="preprocessor">   #ifdef NDEBUG</span></div>
+<div class="line"><a name="l04018"></a><span class="lineno"> 4018</span>&#160;<span class="preprocessor">       #define VMA_HEAVY_ASSERT(expr)</span></div>
+<div class="line"><a name="l04019"></a><span class="lineno"> 4019</span>&#160;<span class="preprocessor">   #else</span></div>
+<div class="line"><a name="l04020"></a><span class="lineno"> 4020</span>&#160;<span class="preprocessor">       #define VMA_HEAVY_ASSERT(expr)   //VMA_ASSERT(expr)</span></div>
+<div class="line"><a name="l04021"></a><span class="lineno"> 4021</span>&#160;<span class="preprocessor">   #endif</span></div>
+<div class="line"><a name="l04022"></a><span class="lineno"> 4022</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04023"></a><span class="lineno"> 4023</span>&#160; </div>
+<div class="line"><a name="l04024"></a><span class="lineno"> 4024</span>&#160;<span class="preprocessor">#ifndef VMA_ALIGN_OF</span></div>
+<div class="line"><a name="l04025"></a><span class="lineno"> 4025</span>&#160;<span class="preprocessor">   #define VMA_ALIGN_OF(type)       (__alignof(type))</span></div>
+<div class="line"><a name="l04026"></a><span class="lineno"> 4026</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04027"></a><span class="lineno"> 4027</span>&#160; </div>
+<div class="line"><a name="l04028"></a><span class="lineno"> 4028</span>&#160;<span class="preprocessor">#ifndef VMA_SYSTEM_ALIGNED_MALLOC</span></div>
+<div class="line"><a name="l04029"></a><span class="lineno"> 4029</span>&#160;<span class="preprocessor">   #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) vma_aligned_alloc((alignment), (size))</span></div>
+<div class="line"><a name="l04030"></a><span class="lineno"> 4030</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04031"></a><span class="lineno"> 4031</span>&#160; </div>
+<div class="line"><a name="l04032"></a><span class="lineno"> 4032</span>&#160;<span class="preprocessor">#ifndef VMA_SYSTEM_FREE</span></div>
+<div class="line"><a name="l04033"></a><span class="lineno"> 4033</span>&#160;<span class="preprocessor">   #if defined(_WIN32)</span></div>
+<div class="line"><a name="l04034"></a><span class="lineno"> 4034</span>&#160;<span class="preprocessor">       #define VMA_SYSTEM_FREE(ptr)   _aligned_free(ptr)</span></div>
+<div class="line"><a name="l04035"></a><span class="lineno"> 4035</span>&#160;<span class="preprocessor">   #else</span></div>
+<div class="line"><a name="l04036"></a><span class="lineno"> 4036</span>&#160;<span class="preprocessor">       #define VMA_SYSTEM_FREE(ptr)   free(ptr)</span></div>
+<div class="line"><a name="l04037"></a><span class="lineno"> 4037</span>&#160;<span class="preprocessor">   #endif</span></div>
+<div class="line"><a name="l04038"></a><span class="lineno"> 4038</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04039"></a><span class="lineno"> 4039</span>&#160; </div>
+<div class="line"><a name="l04040"></a><span class="lineno"> 4040</span>&#160;<span class="preprocessor">#ifndef VMA_MIN</span></div>
+<div class="line"><a name="l04041"></a><span class="lineno"> 4041</span>&#160;<span class="preprocessor">   #define VMA_MIN(v1, v2)    (std::min((v1), (v2)))</span></div>
+<div class="line"><a name="l04042"></a><span class="lineno"> 4042</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04043"></a><span class="lineno"> 4043</span>&#160; </div>
+<div class="line"><a name="l04044"></a><span class="lineno"> 4044</span>&#160;<span class="preprocessor">#ifndef VMA_MAX</span></div>
+<div class="line"><a name="l04045"></a><span class="lineno"> 4045</span>&#160;<span class="preprocessor">   #define VMA_MAX(v1, v2)    (std::max((v1), (v2)))</span></div>
+<div class="line"><a name="l04046"></a><span class="lineno"> 4046</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04047"></a><span class="lineno"> 4047</span>&#160; </div>
+<div class="line"><a name="l04048"></a><span class="lineno"> 4048</span>&#160;<span class="preprocessor">#ifndef VMA_SWAP</span></div>
+<div class="line"><a name="l04049"></a><span class="lineno"> 4049</span>&#160;<span class="preprocessor">   #define VMA_SWAP(v1, v2)   std::swap((v1), (v2))</span></div>
+<div class="line"><a name="l04050"></a><span class="lineno"> 4050</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04051"></a><span class="lineno"> 4051</span>&#160; </div>
+<div class="line"><a name="l04052"></a><span class="lineno"> 4052</span>&#160;<span class="preprocessor">#ifndef VMA_SORT</span></div>
+<div class="line"><a name="l04053"></a><span class="lineno"> 4053</span>&#160;<span class="preprocessor">   #define VMA_SORT(beg, end, cmp)  std::sort(beg, end, cmp)</span></div>
+<div class="line"><a name="l04054"></a><span class="lineno"> 4054</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04055"></a><span class="lineno"> 4055</span>&#160; </div>
+<div class="line"><a name="l04056"></a><span class="lineno"> 4056</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_LOG</span></div>
+<div class="line"><a name="l04057"></a><span class="lineno"> 4057</span>&#160;<span class="preprocessor">   #define VMA_DEBUG_LOG(format, ...)</span></div>
+<div class="line"><a name="l04058"></a><span class="lineno"> 4058</span>&#160;   <span class="comment">/*</span></div>
+<div class="line"><a name="l04059"></a><span class="lineno"> 4059</span>&#160;<span class="comment">   #define VMA_DEBUG_LOG(format, ...) do { \</span></div>
+<div class="line"><a name="l04060"></a><span class="lineno"> 4060</span>&#160;<span class="comment">       printf(format, __VA_ARGS__); \</span></div>
+<div class="line"><a name="l04061"></a><span class="lineno"> 4061</span>&#160;<span class="comment">       printf(&quot;\n&quot;); \</span></div>
+<div class="line"><a name="l04062"></a><span class="lineno"> 4062</span>&#160;<span class="comment">   } while(false)</span></div>
+<div class="line"><a name="l04063"></a><span class="lineno"> 4063</span>&#160;<span class="comment">   */</span></div>
+<div class="line"><a name="l04064"></a><span class="lineno"> 4064</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04065"></a><span class="lineno"> 4065</span>&#160; </div>
+<div class="line"><a name="l04066"></a><span class="lineno"> 4066</span>&#160;<span class="comment">// Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString.</span></div>
+<div class="line"><a name="l04067"></a><span class="lineno"> 4067</span>&#160;<span class="preprocessor">#if VMA_STATS_STRING_ENABLED</span></div>
+<div class="line"><a name="l04068"></a><span class="lineno"> 4068</span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> VmaUint32ToStr(<span class="keywordtype">char</span>* outStr, <span class="keywordtype">size_t</span> strLen, uint32_t num)</div>
+<div class="line"><a name="l04069"></a><span class="lineno"> 4069</span>&#160;    {</div>
+<div class="line"><a name="l04070"></a><span class="lineno"> 4070</span>&#160;        snprintf(outStr, strLen, <span class="stringliteral">&quot;%u&quot;</span>, <span class="keyword">static_cast&lt;</span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span><span class="keyword">&gt;</span>(num));</div>
+<div class="line"><a name="l04071"></a><span class="lineno"> 4071</span>&#160;    }</div>
+<div class="line"><a name="l04072"></a><span class="lineno"> 4072</span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> VmaUint64ToStr(<span class="keywordtype">char</span>* outStr, <span class="keywordtype">size_t</span> strLen, uint64_t num)</div>
+<div class="line"><a name="l04073"></a><span class="lineno"> 4073</span>&#160;    {</div>
+<div class="line"><a name="l04074"></a><span class="lineno"> 4074</span>&#160;        snprintf(outStr, strLen, <span class="stringliteral">&quot;%llu&quot;</span>, <span class="keyword">static_cast&lt;</span><span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span><span class="keyword">&gt;</span>(num));</div>
+<div class="line"><a name="l04075"></a><span class="lineno"> 4075</span>&#160;    }</div>
+<div class="line"><a name="l04076"></a><span class="lineno"> 4076</span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> VmaPtrToStr(<span class="keywordtype">char</span>* outStr, <span class="keywordtype">size_t</span> strLen, <span class="keyword">const</span> <span class="keywordtype">void</span>* ptr)</div>
+<div class="line"><a name="l04077"></a><span class="lineno"> 4077</span>&#160;    {</div>
+<div class="line"><a name="l04078"></a><span class="lineno"> 4078</span>&#160;        snprintf(outStr, strLen, <span class="stringliteral">&quot;%p&quot;</span>, ptr);</div>
+<div class="line"><a name="l04079"></a><span class="lineno"> 4079</span>&#160;    }</div>
+<div class="line"><a name="l04080"></a><span class="lineno"> 4080</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04081"></a><span class="lineno"> 4081</span>&#160; </div>
+<div class="line"><a name="l04082"></a><span class="lineno"> 4082</span>&#160;<span class="preprocessor">#ifndef VMA_MUTEX</span></div>
+<div class="line"><a name="l04083"></a><span class="lineno"> 4083</span>&#160;    <span class="keyword">class </span>VmaMutex</div>
+<div class="line"><a name="l04084"></a><span class="lineno"> 4084</span>&#160;    {</div>
+<div class="line"><a name="l04085"></a><span class="lineno"> 4085</span>&#160;    <span class="keyword">public</span>:</div>
+<div class="line"><a name="l04086"></a><span class="lineno"> 4086</span>&#160;        <span class="keywordtype">void</span> Lock() { m_Mutex.lock(); }</div>
+<div class="line"><a name="l04087"></a><span class="lineno"> 4087</span>&#160;        <span class="keywordtype">void</span> Unlock() { m_Mutex.unlock(); }</div>
+<div class="line"><a name="l04088"></a><span class="lineno"> 4088</span>&#160;        <span class="keywordtype">bool</span> TryLock() { <span class="keywordflow">return</span> m_Mutex.try_lock(); }</div>
+<div class="line"><a name="l04089"></a><span class="lineno"> 4089</span>&#160;    <span class="keyword">private</span>:</div>
+<div class="line"><a name="l04090"></a><span class="lineno"> 4090</span>&#160;        std::mutex m_Mutex;</div>
+<div class="line"><a name="l04091"></a><span class="lineno"> 4091</span>&#160;    };</div>
+<div class="line"><a name="l04092"></a><span class="lineno"> 4092</span>&#160;<span class="preprocessor">    #define VMA_MUTEX VmaMutex</span></div>
+<div class="line"><a name="l04093"></a><span class="lineno"> 4093</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04094"></a><span class="lineno"> 4094</span>&#160; </div>
+<div class="line"><a name="l04095"></a><span class="lineno"> 4095</span>&#160;<span class="comment">// Read-write mutex, where &quot;read&quot; is shared access, &quot;write&quot; is exclusive access.</span></div>
+<div class="line"><a name="l04096"></a><span class="lineno"> 4096</span>&#160;<span class="preprocessor">#ifndef VMA_RW_MUTEX</span></div>
+<div class="line"><a name="l04097"></a><span class="lineno"> 4097</span>&#160;<span class="preprocessor">    #if VMA_USE_STL_SHARED_MUTEX</span></div>
+<div class="line"><a name="l04098"></a><span class="lineno"> 4098</span>&#160;        <span class="comment">// Use std::shared_mutex from C++17.</span></div>
+<div class="line"><a name="l04099"></a><span class="lineno"> 4099</span>&#160;<span class="preprocessor">        #include &lt;shared_mutex&gt;</span></div>
+<div class="line"><a name="l04100"></a><span class="lineno"> 4100</span>&#160;        <span class="keyword">class </span>VmaRWMutex</div>
+<div class="line"><a name="l04101"></a><span class="lineno"> 4101</span>&#160;        {</div>
+<div class="line"><a name="l04102"></a><span class="lineno"> 4102</span>&#160;        <span class="keyword">public</span>:</div>
+<div class="line"><a name="l04103"></a><span class="lineno"> 4103</span>&#160;            <span class="keywordtype">void</span> LockRead() { m_Mutex.lock_shared(); }</div>
+<div class="line"><a name="l04104"></a><span class="lineno"> 4104</span>&#160;            <span class="keywordtype">void</span> UnlockRead() { m_Mutex.unlock_shared(); }</div>
+<div class="line"><a name="l04105"></a><span class="lineno"> 4105</span>&#160;            <span class="keywordtype">bool</span> TryLockRead() { <span class="keywordflow">return</span> m_Mutex.try_lock_shared(); }</div>
+<div class="line"><a name="l04106"></a><span class="lineno"> 4106</span>&#160;            <span class="keywordtype">void</span> LockWrite() { m_Mutex.lock(); }</div>
+<div class="line"><a name="l04107"></a><span class="lineno"> 4107</span>&#160;            <span class="keywordtype">void</span> UnlockWrite() { m_Mutex.unlock(); }</div>
+<div class="line"><a name="l04108"></a><span class="lineno"> 4108</span>&#160;            <span class="keywordtype">bool</span> TryLockWrite() { <span class="keywordflow">return</span> m_Mutex.try_lock(); }</div>
+<div class="line"><a name="l04109"></a><span class="lineno"> 4109</span>&#160;        <span class="keyword">private</span>:</div>
+<div class="line"><a name="l04110"></a><span class="lineno"> 4110</span>&#160;            std::shared_mutex m_Mutex;</div>
+<div class="line"><a name="l04111"></a><span class="lineno"> 4111</span>&#160;        };</div>
+<div class="line"><a name="l04112"></a><span class="lineno"> 4112</span>&#160;<span class="preprocessor">        #define VMA_RW_MUTEX VmaRWMutex</span></div>
+<div class="line"><a name="l04113"></a><span class="lineno"> 4113</span>&#160;<span class="preprocessor">    #elif defined(_WIN32) &amp;&amp; defined(WINVER) &amp;&amp; WINVER &gt;= 0x0600</span></div>
+<div class="line"><a name="l04114"></a><span class="lineno"> 4114</span>&#160;        <span class="comment">// Use SRWLOCK from WinAPI.</span></div>
+<div class="line"><a name="l04115"></a><span class="lineno"> 4115</span>&#160;        <span class="comment">// Minimum supported client = Windows Vista, server = Windows Server 2008.</span></div>
+<div class="line"><a name="l04116"></a><span class="lineno"> 4116</span>&#160;        <span class="keyword">class </span>VmaRWMutex</div>
+<div class="line"><a name="l04117"></a><span class="lineno"> 4117</span>&#160;        {</div>
+<div class="line"><a name="l04118"></a><span class="lineno"> 4118</span>&#160;        <span class="keyword">public</span>:</div>
+<div class="line"><a name="l04119"></a><span class="lineno"> 4119</span>&#160;            VmaRWMutex() { InitializeSRWLock(&amp;m_Lock); }</div>
+<div class="line"><a name="l04120"></a><span class="lineno"> 4120</span>&#160;            <span class="keywordtype">void</span> LockRead() { AcquireSRWLockShared(&amp;m_Lock); }</div>
+<div class="line"><a name="l04121"></a><span class="lineno"> 4121</span>&#160;            <span class="keywordtype">void</span> UnlockRead() { ReleaseSRWLockShared(&amp;m_Lock); }</div>
+<div class="line"><a name="l04122"></a><span class="lineno"> 4122</span>&#160;            <span class="keywordtype">bool</span> TryLockRead() { <span class="keywordflow">return</span> TryAcquireSRWLockShared(&amp;m_Lock) != FALSE; }</div>
+<div class="line"><a name="l04123"></a><span class="lineno"> 4123</span>&#160;            <span class="keywordtype">void</span> LockWrite() { AcquireSRWLockExclusive(&amp;m_Lock); }</div>
+<div class="line"><a name="l04124"></a><span class="lineno"> 4124</span>&#160;            <span class="keywordtype">void</span> UnlockWrite() { ReleaseSRWLockExclusive(&amp;m_Lock); }</div>
+<div class="line"><a name="l04125"></a><span class="lineno"> 4125</span>&#160;            <span class="keywordtype">bool</span> TryLockWrite() { <span class="keywordflow">return</span> TryAcquireSRWLockExclusive(&amp;m_Lock) != FALSE; }</div>
+<div class="line"><a name="l04126"></a><span class="lineno"> 4126</span>&#160;        <span class="keyword">private</span>:</div>
+<div class="line"><a name="l04127"></a><span class="lineno"> 4127</span>&#160;            SRWLOCK m_Lock;</div>
+<div class="line"><a name="l04128"></a><span class="lineno"> 4128</span>&#160;        };</div>
+<div class="line"><a name="l04129"></a><span class="lineno"> 4129</span>&#160;<span class="preprocessor">        #define VMA_RW_MUTEX VmaRWMutex</span></div>
+<div class="line"><a name="l04130"></a><span class="lineno"> 4130</span>&#160;<span class="preprocessor">    #else</span></div>
+<div class="line"><a name="l04131"></a><span class="lineno"> 4131</span>&#160;        <span class="comment">// Less efficient fallback: Use normal mutex.</span></div>
+<div class="line"><a name="l04132"></a><span class="lineno"> 4132</span>&#160;        <span class="keyword">class </span>VmaRWMutex</div>
+<div class="line"><a name="l04133"></a><span class="lineno"> 4133</span>&#160;        {</div>
+<div class="line"><a name="l04134"></a><span class="lineno"> 4134</span>&#160;        <span class="keyword">public</span>:</div>
+<div class="line"><a name="l04135"></a><span class="lineno"> 4135</span>&#160;            <span class="keywordtype">void</span> LockRead() { m_Mutex.Lock(); }</div>
+<div class="line"><a name="l04136"></a><span class="lineno"> 4136</span>&#160;            <span class="keywordtype">void</span> UnlockRead() { m_Mutex.Unlock(); }</div>
+<div class="line"><a name="l04137"></a><span class="lineno"> 4137</span>&#160;            <span class="keywordtype">bool</span> TryLockRead() { <span class="keywordflow">return</span> m_Mutex.TryLock(); }</div>
+<div class="line"><a name="l04138"></a><span class="lineno"> 4138</span>&#160;            <span class="keywordtype">void</span> LockWrite() { m_Mutex.Lock(); }</div>
+<div class="line"><a name="l04139"></a><span class="lineno"> 4139</span>&#160;            <span class="keywordtype">void</span> UnlockWrite() { m_Mutex.Unlock(); }</div>
+<div class="line"><a name="l04140"></a><span class="lineno"> 4140</span>&#160;            <span class="keywordtype">bool</span> TryLockWrite() { <span class="keywordflow">return</span> m_Mutex.TryLock(); }</div>
+<div class="line"><a name="l04141"></a><span class="lineno"> 4141</span>&#160;        <span class="keyword">private</span>:</div>
+<div class="line"><a name="l04142"></a><span class="lineno"> 4142</span>&#160;            VMA_MUTEX m_Mutex;</div>
+<div class="line"><a name="l04143"></a><span class="lineno"> 4143</span>&#160;        };</div>
+<div class="line"><a name="l04144"></a><span class="lineno"> 4144</span>&#160;<span class="preprocessor">        #define VMA_RW_MUTEX VmaRWMutex</span></div>
+<div class="line"><a name="l04145"></a><span class="lineno"> 4145</span>&#160;<span class="preprocessor">    #endif // #if VMA_USE_STL_SHARED_MUTEX</span></div>
+<div class="line"><a name="l04146"></a><span class="lineno"> 4146</span>&#160;<span class="preprocessor">#endif // #ifndef VMA_RW_MUTEX</span></div>
 <div class="line"><a name="l04147"></a><span class="lineno"> 4147</span>&#160; </div>
-<div class="line"><a name="l04151"></a><span class="lineno"> 4151</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_ALIGNMENT (1)</span></div>
-<div class="line"><a name="l04152"></a><span class="lineno"> 4152</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04153"></a><span class="lineno"> 4153</span>&#160; </div>
-<div class="line"><a name="l04154"></a><span class="lineno"> 4154</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_MARGIN</span></div>
+<div class="line"><a name="l04148"></a><span class="lineno"> 4148</span>&#160;<span class="comment">/*</span></div>
+<div class="line"><a name="l04149"></a><span class="lineno"> 4149</span>&#160;<span class="comment">If providing your own implementation, you need to implement a subset of std::atomic.</span></div>
+<div class="line"><a name="l04150"></a><span class="lineno"> 4150</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l04151"></a><span class="lineno"> 4151</span>&#160;<span class="preprocessor">#ifndef VMA_ATOMIC_UINT32</span></div>
+<div class="line"><a name="l04152"></a><span class="lineno"> 4152</span>&#160;<span class="preprocessor">    #include &lt;atomic&gt;</span></div>
+<div class="line"><a name="l04153"></a><span class="lineno"> 4153</span>&#160;<span class="preprocessor">    #define VMA_ATOMIC_UINT32 std::atomic&lt;uint32_t&gt;</span></div>
+<div class="line"><a name="l04154"></a><span class="lineno"> 4154</span>&#160;<span class="preprocessor">#endif</span></div>
 <div class="line"><a name="l04155"></a><span class="lineno"> 4155</span>&#160; </div>
-<div class="line"><a name="l04159"></a><span class="lineno"> 4159</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_MARGIN (0)</span></div>
-<div class="line"><a name="l04160"></a><span class="lineno"> 4160</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04161"></a><span class="lineno"> 4161</span>&#160; </div>
-<div class="line"><a name="l04162"></a><span class="lineno"> 4162</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_INITIALIZE_ALLOCATIONS</span></div>
-<div class="line"><a name="l04163"></a><span class="lineno"> 4163</span>&#160; </div>
-<div class="line"><a name="l04167"></a><span class="lineno"> 4167</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_INITIALIZE_ALLOCATIONS (0)</span></div>
-<div class="line"><a name="l04168"></a><span class="lineno"> 4168</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04169"></a><span class="lineno"> 4169</span>&#160; </div>
-<div class="line"><a name="l04170"></a><span class="lineno"> 4170</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_DETECT_CORRUPTION</span></div>
-<div class="line"><a name="l04171"></a><span class="lineno"> 4171</span>&#160; </div>
-<div class="line"><a name="l04176"></a><span class="lineno"> 4176</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_DETECT_CORRUPTION (0)</span></div>
-<div class="line"><a name="l04177"></a><span class="lineno"> 4177</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04156"></a><span class="lineno"> 4156</span>&#160;<span class="preprocessor">#ifndef VMA_ATOMIC_UINT64</span></div>
+<div class="line"><a name="l04157"></a><span class="lineno"> 4157</span>&#160;<span class="preprocessor">    #include &lt;atomic&gt;</span></div>
+<div class="line"><a name="l04158"></a><span class="lineno"> 4158</span>&#160;<span class="preprocessor">    #define VMA_ATOMIC_UINT64 std::atomic&lt;uint64_t&gt;</span></div>
+<div class="line"><a name="l04159"></a><span class="lineno"> 4159</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04160"></a><span class="lineno"> 4160</span>&#160; </div>
+<div class="line"><a name="l04161"></a><span class="lineno"> 4161</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_ALWAYS_DEDICATED_MEMORY</span></div>
+<div class="line"><a name="l04162"></a><span class="lineno"> 4162</span>&#160; </div>
+<div class="line"><a name="l04166"></a><span class="lineno"> 4166</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_ALWAYS_DEDICATED_MEMORY (0)</span></div>
+<div class="line"><a name="l04167"></a><span class="lineno"> 4167</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04168"></a><span class="lineno"> 4168</span>&#160; </div>
+<div class="line"><a name="l04169"></a><span class="lineno"> 4169</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_ALIGNMENT</span></div>
+<div class="line"><a name="l04170"></a><span class="lineno"> 4170</span>&#160; </div>
+<div class="line"><a name="l04174"></a><span class="lineno"> 4174</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_ALIGNMENT (1)</span></div>
+<div class="line"><a name="l04175"></a><span class="lineno"> 4175</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04176"></a><span class="lineno"> 4176</span>&#160; </div>
+<div class="line"><a name="l04177"></a><span class="lineno"> 4177</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_MARGIN</span></div>
 <div class="line"><a name="l04178"></a><span class="lineno"> 4178</span>&#160; </div>
-<div class="line"><a name="l04179"></a><span class="lineno"> 4179</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_GLOBAL_MUTEX</span></div>
-<div class="line"><a name="l04180"></a><span class="lineno"> 4180</span>&#160; </div>
-<div class="line"><a name="l04184"></a><span class="lineno"> 4184</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_GLOBAL_MUTEX (0)</span></div>
-<div class="line"><a name="l04185"></a><span class="lineno"> 4185</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04182"></a><span class="lineno"> 4182</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_MARGIN (0)</span></div>
+<div class="line"><a name="l04183"></a><span class="lineno"> 4183</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04184"></a><span class="lineno"> 4184</span>&#160; </div>
+<div class="line"><a name="l04185"></a><span class="lineno"> 4185</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_INITIALIZE_ALLOCATIONS</span></div>
 <div class="line"><a name="l04186"></a><span class="lineno"> 4186</span>&#160; </div>
-<div class="line"><a name="l04187"></a><span class="lineno"> 4187</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY</span></div>
-<div class="line"><a name="l04188"></a><span class="lineno"> 4188</span>&#160; </div>
-<div class="line"><a name="l04192"></a><span class="lineno"> 4192</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY (1)</span></div>
-<div class="line"><a name="l04193"></a><span class="lineno"> 4193</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04190"></a><span class="lineno"> 4190</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_INITIALIZE_ALLOCATIONS (0)</span></div>
+<div class="line"><a name="l04191"></a><span class="lineno"> 4191</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04192"></a><span class="lineno"> 4192</span>&#160; </div>
+<div class="line"><a name="l04193"></a><span class="lineno"> 4193</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_DETECT_CORRUPTION</span></div>
 <div class="line"><a name="l04194"></a><span class="lineno"> 4194</span>&#160; </div>
-<div class="line"><a name="l04195"></a><span class="lineno"> 4195</span>&#160;<span class="preprocessor">#ifndef VMA_SMALL_HEAP_MAX_SIZE</span></div>
-<div class="line"><a name="l04196"></a><span class="lineno"> 4196</span>&#160;<span class="preprocessor">   #define VMA_SMALL_HEAP_MAX_SIZE (1024ull * 1024 * 1024)</span></div>
-<div class="line"><a name="l04198"></a><span class="lineno"> 4198</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04199"></a><span class="lineno"> 4199</span>&#160; </div>
-<div class="line"><a name="l04200"></a><span class="lineno"> 4200</span>&#160;<span class="preprocessor">#ifndef VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE</span></div>
-<div class="line"><a name="l04201"></a><span class="lineno"> 4201</span>&#160;<span class="preprocessor">   #define VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE (256ull * 1024 * 1024)</span></div>
-<div class="line"><a name="l04203"></a><span class="lineno"> 4203</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04204"></a><span class="lineno"> 4204</span>&#160; </div>
-<div class="line"><a name="l04205"></a><span class="lineno"> 4205</span>&#160;<span class="preprocessor">#ifndef VMA_CLASS_NO_COPY</span></div>
-<div class="line"><a name="l04206"></a><span class="lineno"> 4206</span>&#160;<span class="preprocessor">    #define VMA_CLASS_NO_COPY(className) \</span></div>
-<div class="line"><a name="l04207"></a><span class="lineno"> 4207</span>&#160;<span class="preprocessor">        private: \</span></div>
-<div class="line"><a name="l04208"></a><span class="lineno"> 4208</span>&#160;<span class="preprocessor">            className(const className&amp;) = delete; \</span></div>
-<div class="line"><a name="l04209"></a><span class="lineno"> 4209</span>&#160;<span class="preprocessor">            className&amp; operator=(const className&amp;) = delete;</span></div>
-<div class="line"><a name="l04210"></a><span class="lineno"> 4210</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04199"></a><span class="lineno"> 4199</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_DETECT_CORRUPTION (0)</span></div>
+<div class="line"><a name="l04200"></a><span class="lineno"> 4200</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04201"></a><span class="lineno"> 4201</span>&#160; </div>
+<div class="line"><a name="l04202"></a><span class="lineno"> 4202</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_GLOBAL_MUTEX</span></div>
+<div class="line"><a name="l04203"></a><span class="lineno"> 4203</span>&#160; </div>
+<div class="line"><a name="l04207"></a><span class="lineno"> 4207</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_GLOBAL_MUTEX (0)</span></div>
+<div class="line"><a name="l04208"></a><span class="lineno"> 4208</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04209"></a><span class="lineno"> 4209</span>&#160; </div>
+<div class="line"><a name="l04210"></a><span class="lineno"> 4210</span>&#160;<span class="preprocessor">#ifndef VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY</span></div>
 <div class="line"><a name="l04211"></a><span class="lineno"> 4211</span>&#160; </div>
-<div class="line"><a name="l04212"></a><span class="lineno"> 4212</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VMA_FRAME_INDEX_LOST = UINT32_MAX;</div>
-<div class="line"><a name="l04213"></a><span class="lineno"> 4213</span>&#160; </div>
-<div class="line"><a name="l04214"></a><span class="lineno"> 4214</span>&#160;<span class="comment">// Decimal 2139416166, float NaN, little-endian binary 66 E6 84 7F.</span></div>
-<div class="line"><a name="l04215"></a><span class="lineno"> 4215</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VMA_CORRUPTION_DETECTION_MAGIC_VALUE = 0x7F84E666;</div>
-<div class="line"><a name="l04216"></a><span class="lineno"> 4216</span>&#160; </div>
-<div class="line"><a name="l04217"></a><span class="lineno"> 4217</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint8_t VMA_ALLOCATION_FILL_PATTERN_CREATED   = 0xDC;</div>
-<div class="line"><a name="l04218"></a><span class="lineno"> 4218</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint8_t VMA_ALLOCATION_FILL_PATTERN_DESTROYED = 0xEF;</div>
-<div class="line"><a name="l04219"></a><span class="lineno"> 4219</span>&#160; </div>
-<div class="line"><a name="l04220"></a><span class="lineno"> 4220</span>&#160;<span class="comment">/*******************************************************************************</span></div>
-<div class="line"><a name="l04221"></a><span class="lineno"> 4221</span>&#160;<span class="comment">END OF CONFIGURATION</span></div>
-<div class="line"><a name="l04222"></a><span class="lineno"> 4222</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l04223"></a><span class="lineno"> 4223</span>&#160; </div>
-<div class="line"><a name="l04224"></a><span class="lineno"> 4224</span>&#160;<span class="comment">// # Copy of some Vulkan definitions so we don&#39;t need to check their existence just to handle few constants.</span></div>
-<div class="line"><a name="l04225"></a><span class="lineno"> 4225</span>&#160; </div>
-<div class="line"><a name="l04226"></a><span class="lineno"> 4226</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY = 0x00000040;</div>
-<div class="line"><a name="l04227"></a><span class="lineno"> 4227</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY = 0x00000080;</div>
-<div class="line"><a name="l04228"></a><span class="lineno"> 4228</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY = 0x00020000;</div>
-<div class="line"><a name="l04229"></a><span class="lineno"> 4229</span>&#160; </div>
-<div class="line"><a name="l04230"></a><span class="lineno"> 4230</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET = 0x10000000u;</div>
-<div class="line"><a name="l04231"></a><span class="lineno"> 4231</span>&#160; </div>
-<div class="line"><a name="l04232"></a><span class="lineno"> 4232</span>&#160;<span class="keyword">static</span> VkAllocationCallbacks VmaEmptyAllocationCallbacks = {</div>
-<div class="line"><a name="l04233"></a><span class="lineno"> 4233</span>&#160;    VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL };</div>
+<div class="line"><a name="l04215"></a><span class="lineno"> 4215</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY (1)</span></div>
+<div class="line"><a name="l04216"></a><span class="lineno"> 4216</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04217"></a><span class="lineno"> 4217</span>&#160; </div>
+<div class="line"><a name="l04218"></a><span class="lineno"> 4218</span>&#160;<span class="preprocessor">#ifndef VMA_SMALL_HEAP_MAX_SIZE</span></div>
+<div class="line"><a name="l04219"></a><span class="lineno"> 4219</span>&#160;<span class="preprocessor">   #define VMA_SMALL_HEAP_MAX_SIZE (1024ull * 1024 * 1024)</span></div>
+<div class="line"><a name="l04221"></a><span class="lineno"> 4221</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04222"></a><span class="lineno"> 4222</span>&#160; </div>
+<div class="line"><a name="l04223"></a><span class="lineno"> 4223</span>&#160;<span class="preprocessor">#ifndef VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE</span></div>
+<div class="line"><a name="l04224"></a><span class="lineno"> 4224</span>&#160;<span class="preprocessor">   #define VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE (256ull * 1024 * 1024)</span></div>
+<div class="line"><a name="l04226"></a><span class="lineno"> 4226</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04227"></a><span class="lineno"> 4227</span>&#160; </div>
+<div class="line"><a name="l04228"></a><span class="lineno"> 4228</span>&#160;<span class="preprocessor">#ifndef VMA_CLASS_NO_COPY</span></div>
+<div class="line"><a name="l04229"></a><span class="lineno"> 4229</span>&#160;<span class="preprocessor">    #define VMA_CLASS_NO_COPY(className) \</span></div>
+<div class="line"><a name="l04230"></a><span class="lineno"> 4230</span>&#160;<span class="preprocessor">        private: \</span></div>
+<div class="line"><a name="l04231"></a><span class="lineno"> 4231</span>&#160;<span class="preprocessor">            className(const className&amp;) = delete; \</span></div>
+<div class="line"><a name="l04232"></a><span class="lineno"> 4232</span>&#160;<span class="preprocessor">            className&amp; operator=(const className&amp;) = delete;</span></div>
+<div class="line"><a name="l04233"></a><span class="lineno"> 4233</span>&#160;<span class="preprocessor">#endif</span></div>
 <div class="line"><a name="l04234"></a><span class="lineno"> 4234</span>&#160; </div>
-<div class="line"><a name="l04235"></a><span class="lineno"> 4235</span>&#160;<span class="comment">// Returns number of bits set to 1 in (v).</span></div>
-<div class="line"><a name="l04236"></a><span class="lineno"> 4236</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint32_t VmaCountBitsSet(uint32_t v)</div>
-<div class="line"><a name="l04237"></a><span class="lineno"> 4237</span>&#160;{</div>
-<div class="line"><a name="l04238"></a><span class="lineno"> 4238</span>&#160;    uint32_t c = v - ((v &gt;&gt; 1) &amp; 0x55555555);</div>
-<div class="line"><a name="l04239"></a><span class="lineno"> 4239</span>&#160;    c = ((c &gt;&gt;  2) &amp; 0x33333333) + (c &amp; 0x33333333);</div>
-<div class="line"><a name="l04240"></a><span class="lineno"> 4240</span>&#160;    c = ((c &gt;&gt;  4) + c) &amp; 0x0F0F0F0F;</div>
-<div class="line"><a name="l04241"></a><span class="lineno"> 4241</span>&#160;    c = ((c &gt;&gt;  8) + c) &amp; 0x00FF00FF;</div>
-<div class="line"><a name="l04242"></a><span class="lineno"> 4242</span>&#160;    c = ((c &gt;&gt; 16) + c) &amp; 0x0000FFFF;</div>
-<div class="line"><a name="l04243"></a><span class="lineno"> 4243</span>&#160;    <span class="keywordflow">return</span> c;</div>
-<div class="line"><a name="l04244"></a><span class="lineno"> 4244</span>&#160;}</div>
-<div class="line"><a name="l04245"></a><span class="lineno"> 4245</span>&#160; </div>
-<div class="line"><a name="l04246"></a><span class="lineno"> 4246</span>&#160;<span class="comment">// Aligns given value up to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 16.</span></div>
-<div class="line"><a name="l04247"></a><span class="lineno"> 4247</span>&#160;<span class="comment">// Use types like uint32_t, uint64_t as T.</span></div>
-<div class="line"><a name="l04248"></a><span class="lineno"> 4248</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04249"></a><span class="lineno"> 4249</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> T VmaAlignUp(T val, T align)</div>
-<div class="line"><a name="l04250"></a><span class="lineno"> 4250</span>&#160;{</div>
-<div class="line"><a name="l04251"></a><span class="lineno"> 4251</span>&#160;    <span class="keywordflow">return</span> (val + align - 1) / align * align;</div>
-<div class="line"><a name="l04252"></a><span class="lineno"> 4252</span>&#160;}</div>
-<div class="line"><a name="l04253"></a><span class="lineno"> 4253</span>&#160;<span class="comment">// Aligns given value down to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 8.</span></div>
-<div class="line"><a name="l04254"></a><span class="lineno"> 4254</span>&#160;<span class="comment">// Use types like uint32_t, uint64_t as T.</span></div>
-<div class="line"><a name="l04255"></a><span class="lineno"> 4255</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04256"></a><span class="lineno"> 4256</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> T VmaAlignDown(T val, T align)</div>
-<div class="line"><a name="l04257"></a><span class="lineno"> 4257</span>&#160;{</div>
-<div class="line"><a name="l04258"></a><span class="lineno"> 4258</span>&#160;    <span class="keywordflow">return</span> val / align * align;</div>
-<div class="line"><a name="l04259"></a><span class="lineno"> 4259</span>&#160;}</div>
-<div class="line"><a name="l04260"></a><span class="lineno"> 4260</span>&#160; </div>
-<div class="line"><a name="l04261"></a><span class="lineno"> 4261</span>&#160;<span class="comment">// Division with mathematical rounding to nearest number.</span></div>
-<div class="line"><a name="l04262"></a><span class="lineno"> 4262</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04263"></a><span class="lineno"> 4263</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> T VmaRoundDiv(T x, T y)</div>
-<div class="line"><a name="l04264"></a><span class="lineno"> 4264</span>&#160;{</div>
-<div class="line"><a name="l04265"></a><span class="lineno"> 4265</span>&#160;    <span class="keywordflow">return</span> (x + (y / (T)2)) / y;</div>
-<div class="line"><a name="l04266"></a><span class="lineno"> 4266</span>&#160;}</div>
-<div class="line"><a name="l04267"></a><span class="lineno"> 4267</span>&#160; </div>
-<div class="line"><a name="l04268"></a><span class="lineno"> 4268</span>&#160;<span class="comment">/*</span></div>
-<div class="line"><a name="l04269"></a><span class="lineno"> 4269</span>&#160;<span class="comment">Returns true if given number is a power of two.</span></div>
-<div class="line"><a name="l04270"></a><span class="lineno"> 4270</span>&#160;<span class="comment">T must be unsigned integer number or signed integer but always nonnegative.</span></div>
-<div class="line"><a name="l04271"></a><span class="lineno"> 4271</span>&#160;<span class="comment">For 0 returns true.</span></div>
-<div class="line"><a name="l04272"></a><span class="lineno"> 4272</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l04273"></a><span class="lineno"> 4273</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04274"></a><span class="lineno"> 4274</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> VmaIsPow2(T x)</div>
-<div class="line"><a name="l04275"></a><span class="lineno"> 4275</span>&#160;{</div>
-<div class="line"><a name="l04276"></a><span class="lineno"> 4276</span>&#160;    <span class="keywordflow">return</span> (x &amp; (x-1)) == 0;</div>
-<div class="line"><a name="l04277"></a><span class="lineno"> 4277</span>&#160;}</div>
-<div class="line"><a name="l04278"></a><span class="lineno"> 4278</span>&#160; </div>
-<div class="line"><a name="l04279"></a><span class="lineno"> 4279</span>&#160;<span class="comment">// Returns smallest power of 2 greater or equal to v.</span></div>
-<div class="line"><a name="l04280"></a><span class="lineno"> 4280</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint32_t VmaNextPow2(uint32_t v)</div>
-<div class="line"><a name="l04281"></a><span class="lineno"> 4281</span>&#160;{</div>
-<div class="line"><a name="l04282"></a><span class="lineno"> 4282</span>&#160;    v--;</div>
-<div class="line"><a name="l04283"></a><span class="lineno"> 4283</span>&#160;    v |= v &gt;&gt; 1;</div>
-<div class="line"><a name="l04284"></a><span class="lineno"> 4284</span>&#160;    v |= v &gt;&gt; 2;</div>
-<div class="line"><a name="l04285"></a><span class="lineno"> 4285</span>&#160;    v |= v &gt;&gt; 4;</div>
-<div class="line"><a name="l04286"></a><span class="lineno"> 4286</span>&#160;    v |= v &gt;&gt; 8;</div>
-<div class="line"><a name="l04287"></a><span class="lineno"> 4287</span>&#160;    v |= v &gt;&gt; 16;</div>
-<div class="line"><a name="l04288"></a><span class="lineno"> 4288</span>&#160;    v++;</div>
-<div class="line"><a name="l04289"></a><span class="lineno"> 4289</span>&#160;    <span class="keywordflow">return</span> v;</div>
-<div class="line"><a name="l04290"></a><span class="lineno"> 4290</span>&#160;}</div>
-<div class="line"><a name="l04291"></a><span class="lineno"> 4291</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint64_t VmaNextPow2(uint64_t v)</div>
+<div class="line"><a name="l04235"></a><span class="lineno"> 4235</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VMA_FRAME_INDEX_LOST = UINT32_MAX;</div>
+<div class="line"><a name="l04236"></a><span class="lineno"> 4236</span>&#160; </div>
+<div class="line"><a name="l04237"></a><span class="lineno"> 4237</span>&#160;<span class="comment">// Decimal 2139416166, float NaN, little-endian binary 66 E6 84 7F.</span></div>
+<div class="line"><a name="l04238"></a><span class="lineno"> 4238</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VMA_CORRUPTION_DETECTION_MAGIC_VALUE = 0x7F84E666;</div>
+<div class="line"><a name="l04239"></a><span class="lineno"> 4239</span>&#160; </div>
+<div class="line"><a name="l04240"></a><span class="lineno"> 4240</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint8_t VMA_ALLOCATION_FILL_PATTERN_CREATED   = 0xDC;</div>
+<div class="line"><a name="l04241"></a><span class="lineno"> 4241</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint8_t VMA_ALLOCATION_FILL_PATTERN_DESTROYED = 0xEF;</div>
+<div class="line"><a name="l04242"></a><span class="lineno"> 4242</span>&#160; </div>
+<div class="line"><a name="l04243"></a><span class="lineno"> 4243</span>&#160;<span class="comment">/*******************************************************************************</span></div>
+<div class="line"><a name="l04244"></a><span class="lineno"> 4244</span>&#160;<span class="comment">END OF CONFIGURATION</span></div>
+<div class="line"><a name="l04245"></a><span class="lineno"> 4245</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l04246"></a><span class="lineno"> 4246</span>&#160; </div>
+<div class="line"><a name="l04247"></a><span class="lineno"> 4247</span>&#160;<span class="comment">// # Copy of some Vulkan definitions so we don&#39;t need to check their existence just to handle few constants.</span></div>
+<div class="line"><a name="l04248"></a><span class="lineno"> 4248</span>&#160; </div>
+<div class="line"><a name="l04249"></a><span class="lineno"> 4249</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD_COPY = 0x00000040;</div>
+<div class="line"><a name="l04250"></a><span class="lineno"> 4250</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD_COPY = 0x00000080;</div>
+<div class="line"><a name="l04251"></a><span class="lineno"> 4251</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY = 0x00020000;</div>
+<div class="line"><a name="l04252"></a><span class="lineno"> 4252</span>&#160; </div>
+<div class="line"><a name="l04253"></a><span class="lineno"> 4253</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint32_t VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET = 0x10000000u;</div>
+<div class="line"><a name="l04254"></a><span class="lineno"> 4254</span>&#160; </div>
+<div class="line"><a name="l04255"></a><span class="lineno"> 4255</span>&#160;<span class="keyword">static</span> VkAllocationCallbacks VmaEmptyAllocationCallbacks = {</div>
+<div class="line"><a name="l04256"></a><span class="lineno"> 4256</span>&#160;    VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL };</div>
+<div class="line"><a name="l04257"></a><span class="lineno"> 4257</span>&#160; </div>
+<div class="line"><a name="l04258"></a><span class="lineno"> 4258</span>&#160;<span class="comment">// Returns number of bits set to 1 in (v).</span></div>
+<div class="line"><a name="l04259"></a><span class="lineno"> 4259</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint32_t VmaCountBitsSet(uint32_t v)</div>
+<div class="line"><a name="l04260"></a><span class="lineno"> 4260</span>&#160;{</div>
+<div class="line"><a name="l04261"></a><span class="lineno"> 4261</span>&#160;    uint32_t c = v - ((v &gt;&gt; 1) &amp; 0x55555555);</div>
+<div class="line"><a name="l04262"></a><span class="lineno"> 4262</span>&#160;    c = ((c &gt;&gt;  2) &amp; 0x33333333) + (c &amp; 0x33333333);</div>
+<div class="line"><a name="l04263"></a><span class="lineno"> 4263</span>&#160;    c = ((c &gt;&gt;  4) + c) &amp; 0x0F0F0F0F;</div>
+<div class="line"><a name="l04264"></a><span class="lineno"> 4264</span>&#160;    c = ((c &gt;&gt;  8) + c) &amp; 0x00FF00FF;</div>
+<div class="line"><a name="l04265"></a><span class="lineno"> 4265</span>&#160;    c = ((c &gt;&gt; 16) + c) &amp; 0x0000FFFF;</div>
+<div class="line"><a name="l04266"></a><span class="lineno"> 4266</span>&#160;    <span class="keywordflow">return</span> c;</div>
+<div class="line"><a name="l04267"></a><span class="lineno"> 4267</span>&#160;}</div>
+<div class="line"><a name="l04268"></a><span class="lineno"> 4268</span>&#160; </div>
+<div class="line"><a name="l04269"></a><span class="lineno"> 4269</span>&#160;<span class="comment">/*</span></div>
+<div class="line"><a name="l04270"></a><span class="lineno"> 4270</span>&#160;<span class="comment">Returns true if given number is a power of two.</span></div>
+<div class="line"><a name="l04271"></a><span class="lineno"> 4271</span>&#160;<span class="comment">T must be unsigned integer number or signed integer but always nonnegative.</span></div>
+<div class="line"><a name="l04272"></a><span class="lineno"> 4272</span>&#160;<span class="comment">For 0 returns true.</span></div>
+<div class="line"><a name="l04273"></a><span class="lineno"> 4273</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l04274"></a><span class="lineno"> 4274</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04275"></a><span class="lineno"> 4275</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> VmaIsPow2(T x)</div>
+<div class="line"><a name="l04276"></a><span class="lineno"> 4276</span>&#160;{</div>
+<div class="line"><a name="l04277"></a><span class="lineno"> 4277</span>&#160;    <span class="keywordflow">return</span> (x &amp; (x-1)) == 0;</div>
+<div class="line"><a name="l04278"></a><span class="lineno"> 4278</span>&#160;}</div>
+<div class="line"><a name="l04279"></a><span class="lineno"> 4279</span>&#160; </div>
+<div class="line"><a name="l04280"></a><span class="lineno"> 4280</span>&#160;<span class="comment">// Aligns given value up to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 16.</span></div>
+<div class="line"><a name="l04281"></a><span class="lineno"> 4281</span>&#160;<span class="comment">// Use types like uint32_t, uint64_t as T.</span></div>
+<div class="line"><a name="l04282"></a><span class="lineno"> 4282</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04283"></a><span class="lineno"> 4283</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> T VmaAlignUp(T val, T alignment)</div>
+<div class="line"><a name="l04284"></a><span class="lineno"> 4284</span>&#160;{</div>
+<div class="line"><a name="l04285"></a><span class="lineno"> 4285</span>&#160;    VMA_HEAVY_ASSERT(VmaIsPow2(alignment));</div>
+<div class="line"><a name="l04286"></a><span class="lineno"> 4286</span>&#160;    <span class="keywordflow">return</span> (val + alignment - 1) &amp; ~(alignment - 1);</div>
+<div class="line"><a name="l04287"></a><span class="lineno"> 4287</span>&#160;}</div>
+<div class="line"><a name="l04288"></a><span class="lineno"> 4288</span>&#160;<span class="comment">// Aligns given value down to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 8.</span></div>
+<div class="line"><a name="l04289"></a><span class="lineno"> 4289</span>&#160;<span class="comment">// Use types like uint32_t, uint64_t as T.</span></div>
+<div class="line"><a name="l04290"></a><span class="lineno"> 4290</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04291"></a><span class="lineno"> 4291</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> T VmaAlignDown(T val, T alignment)</div>
 <div class="line"><a name="l04292"></a><span class="lineno"> 4292</span>&#160;{</div>
-<div class="line"><a name="l04293"></a><span class="lineno"> 4293</span>&#160;    v--;</div>
-<div class="line"><a name="l04294"></a><span class="lineno"> 4294</span>&#160;    v |= v &gt;&gt; 1;</div>
-<div class="line"><a name="l04295"></a><span class="lineno"> 4295</span>&#160;    v |= v &gt;&gt; 2;</div>
-<div class="line"><a name="l04296"></a><span class="lineno"> 4296</span>&#160;    v |= v &gt;&gt; 4;</div>
-<div class="line"><a name="l04297"></a><span class="lineno"> 4297</span>&#160;    v |= v &gt;&gt; 8;</div>
-<div class="line"><a name="l04298"></a><span class="lineno"> 4298</span>&#160;    v |= v &gt;&gt; 16;</div>
-<div class="line"><a name="l04299"></a><span class="lineno"> 4299</span>&#160;    v |= v &gt;&gt; 32;</div>
-<div class="line"><a name="l04300"></a><span class="lineno"> 4300</span>&#160;    v++;</div>
-<div class="line"><a name="l04301"></a><span class="lineno"> 4301</span>&#160;    <span class="keywordflow">return</span> v;</div>
+<div class="line"><a name="l04293"></a><span class="lineno"> 4293</span>&#160;    VMA_HEAVY_ASSERT(VmaIsPow2(alignment));</div>
+<div class="line"><a name="l04294"></a><span class="lineno"> 4294</span>&#160;    <span class="keywordflow">return</span> val &amp; ~(alignment - 1);</div>
+<div class="line"><a name="l04295"></a><span class="lineno"> 4295</span>&#160;}</div>
+<div class="line"><a name="l04296"></a><span class="lineno"> 4296</span>&#160; </div>
+<div class="line"><a name="l04297"></a><span class="lineno"> 4297</span>&#160;<span class="comment">// Division with mathematical rounding to nearest number.</span></div>
+<div class="line"><a name="l04298"></a><span class="lineno"> 4298</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04299"></a><span class="lineno"> 4299</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> T VmaRoundDiv(T x, T y)</div>
+<div class="line"><a name="l04300"></a><span class="lineno"> 4300</span>&#160;{</div>
+<div class="line"><a name="l04301"></a><span class="lineno"> 4301</span>&#160;    <span class="keywordflow">return</span> (x + (y / (T)2)) / y;</div>
 <div class="line"><a name="l04302"></a><span class="lineno"> 4302</span>&#160;}</div>
 <div class="line"><a name="l04303"></a><span class="lineno"> 4303</span>&#160; </div>
-<div class="line"><a name="l04304"></a><span class="lineno"> 4304</span>&#160;<span class="comment">// Returns largest power of 2 less or equal to v.</span></div>
-<div class="line"><a name="l04305"></a><span class="lineno"> 4305</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint32_t VmaPrevPow2(uint32_t v)</div>
+<div class="line"><a name="l04304"></a><span class="lineno"> 4304</span>&#160;<span class="comment">// Returns smallest power of 2 greater or equal to v.</span></div>
+<div class="line"><a name="l04305"></a><span class="lineno"> 4305</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint32_t VmaNextPow2(uint32_t v)</div>
 <div class="line"><a name="l04306"></a><span class="lineno"> 4306</span>&#160;{</div>
-<div class="line"><a name="l04307"></a><span class="lineno"> 4307</span>&#160;    v |= v &gt;&gt; 1;</div>
-<div class="line"><a name="l04308"></a><span class="lineno"> 4308</span>&#160;    v |= v &gt;&gt; 2;</div>
-<div class="line"><a name="l04309"></a><span class="lineno"> 4309</span>&#160;    v |= v &gt;&gt; 4;</div>
-<div class="line"><a name="l04310"></a><span class="lineno"> 4310</span>&#160;    v |= v &gt;&gt; 8;</div>
-<div class="line"><a name="l04311"></a><span class="lineno"> 4311</span>&#160;    v |= v &gt;&gt; 16;</div>
-<div class="line"><a name="l04312"></a><span class="lineno"> 4312</span>&#160;    v = v ^ (v &gt;&gt; 1);</div>
-<div class="line"><a name="l04313"></a><span class="lineno"> 4313</span>&#160;    <span class="keywordflow">return</span> v;</div>
-<div class="line"><a name="l04314"></a><span class="lineno"> 4314</span>&#160;}</div>
-<div class="line"><a name="l04315"></a><span class="lineno"> 4315</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint64_t VmaPrevPow2(uint64_t v)</div>
-<div class="line"><a name="l04316"></a><span class="lineno"> 4316</span>&#160;{</div>
-<div class="line"><a name="l04317"></a><span class="lineno"> 4317</span>&#160;    v |= v &gt;&gt; 1;</div>
-<div class="line"><a name="l04318"></a><span class="lineno"> 4318</span>&#160;    v |= v &gt;&gt; 2;</div>
-<div class="line"><a name="l04319"></a><span class="lineno"> 4319</span>&#160;    v |= v &gt;&gt; 4;</div>
-<div class="line"><a name="l04320"></a><span class="lineno"> 4320</span>&#160;    v |= v &gt;&gt; 8;</div>
-<div class="line"><a name="l04321"></a><span class="lineno"> 4321</span>&#160;    v |= v &gt;&gt; 16;</div>
-<div class="line"><a name="l04322"></a><span class="lineno"> 4322</span>&#160;    v |= v &gt;&gt; 32;</div>
-<div class="line"><a name="l04323"></a><span class="lineno"> 4323</span>&#160;    v = v ^ (v &gt;&gt; 1);</div>
-<div class="line"><a name="l04324"></a><span class="lineno"> 4324</span>&#160;    <span class="keywordflow">return</span> v;</div>
-<div class="line"><a name="l04325"></a><span class="lineno"> 4325</span>&#160;}</div>
-<div class="line"><a name="l04326"></a><span class="lineno"> 4326</span>&#160; </div>
-<div class="line"><a name="l04327"></a><span class="lineno"> 4327</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> VmaStrIsEmpty(<span class="keyword">const</span> <span class="keywordtype">char</span>* pStr)</div>
-<div class="line"><a name="l04328"></a><span class="lineno"> 4328</span>&#160;{</div>
-<div class="line"><a name="l04329"></a><span class="lineno"> 4329</span>&#160;    <span class="keywordflow">return</span> pStr == VMA_NULL || *pStr == <span class="charliteral">&#39;\0&#39;</span>;</div>
-<div class="line"><a name="l04330"></a><span class="lineno"> 4330</span>&#160;}</div>
-<div class="line"><a name="l04331"></a><span class="lineno"> 4331</span>&#160; </div>
-<div class="line"><a name="l04332"></a><span class="lineno"> 4332</span>&#160;<span class="preprocessor">#if VMA_STATS_STRING_ENABLED</span></div>
-<div class="line"><a name="l04333"></a><span class="lineno"> 4333</span>&#160; </div>
-<div class="line"><a name="l04334"></a><span class="lineno"> 4334</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* VmaAlgorithmToStr(uint32_t algorithm)</div>
-<div class="line"><a name="l04335"></a><span class="lineno"> 4335</span>&#160;{</div>
-<div class="line"><a name="l04336"></a><span class="lineno"> 4336</span>&#160;    <span class="keywordflow">switch</span>(algorithm)</div>
-<div class="line"><a name="l04337"></a><span class="lineno"> 4337</span>&#160;    {</div>
-<div class="line"><a name="l04338"></a><span class="lineno"> 4338</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726">VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT</a>:</div>
-<div class="line"><a name="l04339"></a><span class="lineno"> 4339</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&quot;Linear&quot;</span>;</div>
-<div class="line"><a name="l04340"></a><span class="lineno"> 4340</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a97a0dc38e5161b780594d998d313d35e">VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT</a>:</div>
-<div class="line"><a name="l04341"></a><span class="lineno"> 4341</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&quot;Buddy&quot;</span>;</div>
-<div class="line"><a name="l04342"></a><span class="lineno"> 4342</span>&#160;    <span class="keywordflow">case</span> 0:</div>
-<div class="line"><a name="l04343"></a><span class="lineno"> 4343</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&quot;Default&quot;</span>;</div>
-<div class="line"><a name="l04344"></a><span class="lineno"> 4344</span>&#160;    <span class="keywordflow">default</span>:</div>
-<div class="line"><a name="l04345"></a><span class="lineno"> 4345</span>&#160;        VMA_ASSERT(0);</div>
-<div class="line"><a name="l04346"></a><span class="lineno"> 4346</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&quot;&quot;</span>;</div>
-<div class="line"><a name="l04347"></a><span class="lineno"> 4347</span>&#160;    }</div>
-<div class="line"><a name="l04348"></a><span class="lineno"> 4348</span>&#160;}</div>
-<div class="line"><a name="l04349"></a><span class="lineno"> 4349</span>&#160; </div>
-<div class="line"><a name="l04350"></a><span class="lineno"> 4350</span>&#160;<span class="preprocessor">#endif // #if VMA_STATS_STRING_ENABLED</span></div>
+<div class="line"><a name="l04307"></a><span class="lineno"> 4307</span>&#160;    v--;</div>
+<div class="line"><a name="l04308"></a><span class="lineno"> 4308</span>&#160;    v |= v &gt;&gt; 1;</div>
+<div class="line"><a name="l04309"></a><span class="lineno"> 4309</span>&#160;    v |= v &gt;&gt; 2;</div>
+<div class="line"><a name="l04310"></a><span class="lineno"> 4310</span>&#160;    v |= v &gt;&gt; 4;</div>
+<div class="line"><a name="l04311"></a><span class="lineno"> 4311</span>&#160;    v |= v &gt;&gt; 8;</div>
+<div class="line"><a name="l04312"></a><span class="lineno"> 4312</span>&#160;    v |= v &gt;&gt; 16;</div>
+<div class="line"><a name="l04313"></a><span class="lineno"> 4313</span>&#160;    v++;</div>
+<div class="line"><a name="l04314"></a><span class="lineno"> 4314</span>&#160;    <span class="keywordflow">return</span> v;</div>
+<div class="line"><a name="l04315"></a><span class="lineno"> 4315</span>&#160;}</div>
+<div class="line"><a name="l04316"></a><span class="lineno"> 4316</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint64_t VmaNextPow2(uint64_t v)</div>
+<div class="line"><a name="l04317"></a><span class="lineno"> 4317</span>&#160;{</div>
+<div class="line"><a name="l04318"></a><span class="lineno"> 4318</span>&#160;    v--;</div>
+<div class="line"><a name="l04319"></a><span class="lineno"> 4319</span>&#160;    v |= v &gt;&gt; 1;</div>
+<div class="line"><a name="l04320"></a><span class="lineno"> 4320</span>&#160;    v |= v &gt;&gt; 2;</div>
+<div class="line"><a name="l04321"></a><span class="lineno"> 4321</span>&#160;    v |= v &gt;&gt; 4;</div>
+<div class="line"><a name="l04322"></a><span class="lineno"> 4322</span>&#160;    v |= v &gt;&gt; 8;</div>
+<div class="line"><a name="l04323"></a><span class="lineno"> 4323</span>&#160;    v |= v &gt;&gt; 16;</div>
+<div class="line"><a name="l04324"></a><span class="lineno"> 4324</span>&#160;    v |= v &gt;&gt; 32;</div>
+<div class="line"><a name="l04325"></a><span class="lineno"> 4325</span>&#160;    v++;</div>
+<div class="line"><a name="l04326"></a><span class="lineno"> 4326</span>&#160;    <span class="keywordflow">return</span> v;</div>
+<div class="line"><a name="l04327"></a><span class="lineno"> 4327</span>&#160;}</div>
+<div class="line"><a name="l04328"></a><span class="lineno"> 4328</span>&#160; </div>
+<div class="line"><a name="l04329"></a><span class="lineno"> 4329</span>&#160;<span class="comment">// Returns largest power of 2 less or equal to v.</span></div>
+<div class="line"><a name="l04330"></a><span class="lineno"> 4330</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint32_t VmaPrevPow2(uint32_t v)</div>
+<div class="line"><a name="l04331"></a><span class="lineno"> 4331</span>&#160;{</div>
+<div class="line"><a name="l04332"></a><span class="lineno"> 4332</span>&#160;    v |= v &gt;&gt; 1;</div>
+<div class="line"><a name="l04333"></a><span class="lineno"> 4333</span>&#160;    v |= v &gt;&gt; 2;</div>
+<div class="line"><a name="l04334"></a><span class="lineno"> 4334</span>&#160;    v |= v &gt;&gt; 4;</div>
+<div class="line"><a name="l04335"></a><span class="lineno"> 4335</span>&#160;    v |= v &gt;&gt; 8;</div>
+<div class="line"><a name="l04336"></a><span class="lineno"> 4336</span>&#160;    v |= v &gt;&gt; 16;</div>
+<div class="line"><a name="l04337"></a><span class="lineno"> 4337</span>&#160;    v = v ^ (v &gt;&gt; 1);</div>
+<div class="line"><a name="l04338"></a><span class="lineno"> 4338</span>&#160;    <span class="keywordflow">return</span> v;</div>
+<div class="line"><a name="l04339"></a><span class="lineno"> 4339</span>&#160;}</div>
+<div class="line"><a name="l04340"></a><span class="lineno"> 4340</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint64_t VmaPrevPow2(uint64_t v)</div>
+<div class="line"><a name="l04341"></a><span class="lineno"> 4341</span>&#160;{</div>
+<div class="line"><a name="l04342"></a><span class="lineno"> 4342</span>&#160;    v |= v &gt;&gt; 1;</div>
+<div class="line"><a name="l04343"></a><span class="lineno"> 4343</span>&#160;    v |= v &gt;&gt; 2;</div>
+<div class="line"><a name="l04344"></a><span class="lineno"> 4344</span>&#160;    v |= v &gt;&gt; 4;</div>
+<div class="line"><a name="l04345"></a><span class="lineno"> 4345</span>&#160;    v |= v &gt;&gt; 8;</div>
+<div class="line"><a name="l04346"></a><span class="lineno"> 4346</span>&#160;    v |= v &gt;&gt; 16;</div>
+<div class="line"><a name="l04347"></a><span class="lineno"> 4347</span>&#160;    v |= v &gt;&gt; 32;</div>
+<div class="line"><a name="l04348"></a><span class="lineno"> 4348</span>&#160;    v = v ^ (v &gt;&gt; 1);</div>
+<div class="line"><a name="l04349"></a><span class="lineno"> 4349</span>&#160;    <span class="keywordflow">return</span> v;</div>
+<div class="line"><a name="l04350"></a><span class="lineno"> 4350</span>&#160;}</div>
 <div class="line"><a name="l04351"></a><span class="lineno"> 4351</span>&#160; </div>
-<div class="line"><a name="l04352"></a><span class="lineno"> 4352</span>&#160;<span class="preprocessor">#ifndef VMA_SORT</span></div>
-<div class="line"><a name="l04353"></a><span class="lineno"> 4353</span>&#160; </div>
-<div class="line"><a name="l04354"></a><span class="lineno"> 4354</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Iterator, <span class="keyword">typename</span> Compare&gt;</div>
-<div class="line"><a name="l04355"></a><span class="lineno"> 4355</span>&#160;Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)</div>
-<div class="line"><a name="l04356"></a><span class="lineno"> 4356</span>&#160;{</div>
-<div class="line"><a name="l04357"></a><span class="lineno"> 4357</span>&#160;    Iterator centerValue = end; --centerValue;</div>
-<div class="line"><a name="l04358"></a><span class="lineno"> 4358</span>&#160;    Iterator insertIndex = beg;</div>
-<div class="line"><a name="l04359"></a><span class="lineno"> 4359</span>&#160;    <span class="keywordflow">for</span>(Iterator memTypeIndex = beg; memTypeIndex &lt; centerValue; ++memTypeIndex)</div>
-<div class="line"><a name="l04360"></a><span class="lineno"> 4360</span>&#160;    {</div>
-<div class="line"><a name="l04361"></a><span class="lineno"> 4361</span>&#160;        <span class="keywordflow">if</span>(cmp(*memTypeIndex, *centerValue))</div>
-<div class="line"><a name="l04362"></a><span class="lineno"> 4362</span>&#160;        {</div>
-<div class="line"><a name="l04363"></a><span class="lineno"> 4363</span>&#160;            <span class="keywordflow">if</span>(insertIndex != memTypeIndex)</div>
-<div class="line"><a name="l04364"></a><span class="lineno"> 4364</span>&#160;            {</div>
-<div class="line"><a name="l04365"></a><span class="lineno"> 4365</span>&#160;                VMA_SWAP(*memTypeIndex, *insertIndex);</div>
-<div class="line"><a name="l04366"></a><span class="lineno"> 4366</span>&#160;            }</div>
-<div class="line"><a name="l04367"></a><span class="lineno"> 4367</span>&#160;            ++insertIndex;</div>
-<div class="line"><a name="l04368"></a><span class="lineno"> 4368</span>&#160;        }</div>
-<div class="line"><a name="l04369"></a><span class="lineno"> 4369</span>&#160;    }</div>
-<div class="line"><a name="l04370"></a><span class="lineno"> 4370</span>&#160;    <span class="keywordflow">if</span>(insertIndex != centerValue)</div>
-<div class="line"><a name="l04371"></a><span class="lineno"> 4371</span>&#160;    {</div>
-<div class="line"><a name="l04372"></a><span class="lineno"> 4372</span>&#160;        VMA_SWAP(*insertIndex, *centerValue);</div>
-<div class="line"><a name="l04373"></a><span class="lineno"> 4373</span>&#160;    }</div>
-<div class="line"><a name="l04374"></a><span class="lineno"> 4374</span>&#160;    <span class="keywordflow">return</span> insertIndex;</div>
-<div class="line"><a name="l04375"></a><span class="lineno"> 4375</span>&#160;}</div>
+<div class="line"><a name="l04352"></a><span class="lineno"> 4352</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> VmaStrIsEmpty(<span class="keyword">const</span> <span class="keywordtype">char</span>* pStr)</div>
+<div class="line"><a name="l04353"></a><span class="lineno"> 4353</span>&#160;{</div>
+<div class="line"><a name="l04354"></a><span class="lineno"> 4354</span>&#160;    <span class="keywordflow">return</span> pStr == VMA_NULL || *pStr == <span class="charliteral">&#39;\0&#39;</span>;</div>
+<div class="line"><a name="l04355"></a><span class="lineno"> 4355</span>&#160;}</div>
+<div class="line"><a name="l04356"></a><span class="lineno"> 4356</span>&#160; </div>
+<div class="line"><a name="l04357"></a><span class="lineno"> 4357</span>&#160;<span class="preprocessor">#if VMA_STATS_STRING_ENABLED</span></div>
+<div class="line"><a name="l04358"></a><span class="lineno"> 4358</span>&#160; </div>
+<div class="line"><a name="l04359"></a><span class="lineno"> 4359</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* VmaAlgorithmToStr(uint32_t algorithm)</div>
+<div class="line"><a name="l04360"></a><span class="lineno"> 4360</span>&#160;{</div>
+<div class="line"><a name="l04361"></a><span class="lineno"> 4361</span>&#160;    <span class="keywordflow">switch</span>(algorithm)</div>
+<div class="line"><a name="l04362"></a><span class="lineno"> 4362</span>&#160;    {</div>
+<div class="line"><a name="l04363"></a><span class="lineno"> 4363</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726">VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT</a>:</div>
+<div class="line"><a name="l04364"></a><span class="lineno"> 4364</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&quot;Linear&quot;</span>;</div>
+<div class="line"><a name="l04365"></a><span class="lineno"> 4365</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a97a0dc38e5161b780594d998d313d35e">VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT</a>:</div>
+<div class="line"><a name="l04366"></a><span class="lineno"> 4366</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&quot;Buddy&quot;</span>;</div>
+<div class="line"><a name="l04367"></a><span class="lineno"> 4367</span>&#160;    <span class="keywordflow">case</span> 0:</div>
+<div class="line"><a name="l04368"></a><span class="lineno"> 4368</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&quot;Default&quot;</span>;</div>
+<div class="line"><a name="l04369"></a><span class="lineno"> 4369</span>&#160;    <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l04370"></a><span class="lineno"> 4370</span>&#160;        VMA_ASSERT(0);</div>
+<div class="line"><a name="l04371"></a><span class="lineno"> 4371</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&quot;&quot;</span>;</div>
+<div class="line"><a name="l04372"></a><span class="lineno"> 4372</span>&#160;    }</div>
+<div class="line"><a name="l04373"></a><span class="lineno"> 4373</span>&#160;}</div>
+<div class="line"><a name="l04374"></a><span class="lineno"> 4374</span>&#160; </div>
+<div class="line"><a name="l04375"></a><span class="lineno"> 4375</span>&#160;<span class="preprocessor">#endif // #if VMA_STATS_STRING_ENABLED</span></div>
 <div class="line"><a name="l04376"></a><span class="lineno"> 4376</span>&#160; </div>
-<div class="line"><a name="l04377"></a><span class="lineno"> 4377</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Iterator, <span class="keyword">typename</span> Compare&gt;</div>
-<div class="line"><a name="l04378"></a><span class="lineno"> 4378</span>&#160;<span class="keywordtype">void</span> VmaQuickSort(Iterator beg, Iterator end, Compare cmp)</div>
-<div class="line"><a name="l04379"></a><span class="lineno"> 4379</span>&#160;{</div>
-<div class="line"><a name="l04380"></a><span class="lineno"> 4380</span>&#160;    <span class="keywordflow">if</span>(beg &lt; end)</div>
-<div class="line"><a name="l04381"></a><span class="lineno"> 4381</span>&#160;    {</div>
-<div class="line"><a name="l04382"></a><span class="lineno"> 4382</span>&#160;        Iterator it = VmaQuickSortPartition&lt;Iterator, Compare&gt;(beg, end, cmp);</div>
-<div class="line"><a name="l04383"></a><span class="lineno"> 4383</span>&#160;        VmaQuickSort&lt;Iterator, Compare&gt;(beg, it, cmp);</div>
-<div class="line"><a name="l04384"></a><span class="lineno"> 4384</span>&#160;        VmaQuickSort&lt;Iterator, Compare&gt;(it + 1, end, cmp);</div>
-<div class="line"><a name="l04385"></a><span class="lineno"> 4385</span>&#160;    }</div>
-<div class="line"><a name="l04386"></a><span class="lineno"> 4386</span>&#160;}</div>
-<div class="line"><a name="l04387"></a><span class="lineno"> 4387</span>&#160; </div>
-<div class="line"><a name="l04388"></a><span class="lineno"> 4388</span>&#160;<span class="preprocessor">#define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp)</span></div>
-<div class="line"><a name="l04389"></a><span class="lineno"> 4389</span>&#160; </div>
-<div class="line"><a name="l04390"></a><span class="lineno"> 4390</span>&#160;<span class="preprocessor">#endif // #ifndef VMA_SORT</span></div>
-<div class="line"><a name="l04391"></a><span class="lineno"> 4391</span>&#160; </div>
-<div class="line"><a name="l04392"></a><span class="lineno"> 4392</span>&#160;<span class="comment">/*</span></div>
-<div class="line"><a name="l04393"></a><span class="lineno"> 4393</span>&#160;<span class="comment">Returns true if two memory blocks occupy overlapping pages.</span></div>
-<div class="line"><a name="l04394"></a><span class="lineno"> 4394</span>&#160;<span class="comment">ResourceA must be in less memory offset than ResourceB.</span></div>
-<div class="line"><a name="l04395"></a><span class="lineno"> 4395</span>&#160;<span class="comment"></span> </div>
-<div class="line"><a name="l04396"></a><span class="lineno"> 4396</span>&#160;<span class="comment">Algorithm is based on &quot;Vulkan 1.0.39 - A Specification (with all registered Vulkan extensions)&quot;</span></div>
-<div class="line"><a name="l04397"></a><span class="lineno"> 4397</span>&#160;<span class="comment">chapter 11.6 &quot;Resource Memory Association&quot;, paragraph &quot;Buffer-Image Granularity&quot;.</span></div>
-<div class="line"><a name="l04398"></a><span class="lineno"> 4398</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l04399"></a><span class="lineno"> 4399</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> VmaBlocksOnSamePage(</div>
-<div class="line"><a name="l04400"></a><span class="lineno"> 4400</span>&#160;    VkDeviceSize resourceAOffset,</div>
-<div class="line"><a name="l04401"></a><span class="lineno"> 4401</span>&#160;    VkDeviceSize resourceASize,</div>
-<div class="line"><a name="l04402"></a><span class="lineno"> 4402</span>&#160;    VkDeviceSize resourceBOffset,</div>
-<div class="line"><a name="l04403"></a><span class="lineno"> 4403</span>&#160;    VkDeviceSize pageSize)</div>
+<div class="line"><a name="l04377"></a><span class="lineno"> 4377</span>&#160;<span class="preprocessor">#ifndef VMA_SORT</span></div>
+<div class="line"><a name="l04378"></a><span class="lineno"> 4378</span>&#160; </div>
+<div class="line"><a name="l04379"></a><span class="lineno"> 4379</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Iterator, <span class="keyword">typename</span> Compare&gt;</div>
+<div class="line"><a name="l04380"></a><span class="lineno"> 4380</span>&#160;Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)</div>
+<div class="line"><a name="l04381"></a><span class="lineno"> 4381</span>&#160;{</div>
+<div class="line"><a name="l04382"></a><span class="lineno"> 4382</span>&#160;    Iterator centerValue = end; --centerValue;</div>
+<div class="line"><a name="l04383"></a><span class="lineno"> 4383</span>&#160;    Iterator insertIndex = beg;</div>
+<div class="line"><a name="l04384"></a><span class="lineno"> 4384</span>&#160;    <span class="keywordflow">for</span>(Iterator memTypeIndex = beg; memTypeIndex &lt; centerValue; ++memTypeIndex)</div>
+<div class="line"><a name="l04385"></a><span class="lineno"> 4385</span>&#160;    {</div>
+<div class="line"><a name="l04386"></a><span class="lineno"> 4386</span>&#160;        <span class="keywordflow">if</span>(cmp(*memTypeIndex, *centerValue))</div>
+<div class="line"><a name="l04387"></a><span class="lineno"> 4387</span>&#160;        {</div>
+<div class="line"><a name="l04388"></a><span class="lineno"> 4388</span>&#160;            <span class="keywordflow">if</span>(insertIndex != memTypeIndex)</div>
+<div class="line"><a name="l04389"></a><span class="lineno"> 4389</span>&#160;            {</div>
+<div class="line"><a name="l04390"></a><span class="lineno"> 4390</span>&#160;                VMA_SWAP(*memTypeIndex, *insertIndex);</div>
+<div class="line"><a name="l04391"></a><span class="lineno"> 4391</span>&#160;            }</div>
+<div class="line"><a name="l04392"></a><span class="lineno"> 4392</span>&#160;            ++insertIndex;</div>
+<div class="line"><a name="l04393"></a><span class="lineno"> 4393</span>&#160;        }</div>
+<div class="line"><a name="l04394"></a><span class="lineno"> 4394</span>&#160;    }</div>
+<div class="line"><a name="l04395"></a><span class="lineno"> 4395</span>&#160;    <span class="keywordflow">if</span>(insertIndex != centerValue)</div>
+<div class="line"><a name="l04396"></a><span class="lineno"> 4396</span>&#160;    {</div>
+<div class="line"><a name="l04397"></a><span class="lineno"> 4397</span>&#160;        VMA_SWAP(*insertIndex, *centerValue);</div>
+<div class="line"><a name="l04398"></a><span class="lineno"> 4398</span>&#160;    }</div>
+<div class="line"><a name="l04399"></a><span class="lineno"> 4399</span>&#160;    <span class="keywordflow">return</span> insertIndex;</div>
+<div class="line"><a name="l04400"></a><span class="lineno"> 4400</span>&#160;}</div>
+<div class="line"><a name="l04401"></a><span class="lineno"> 4401</span>&#160; </div>
+<div class="line"><a name="l04402"></a><span class="lineno"> 4402</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Iterator, <span class="keyword">typename</span> Compare&gt;</div>
+<div class="line"><a name="l04403"></a><span class="lineno"> 4403</span>&#160;<span class="keywordtype">void</span> VmaQuickSort(Iterator beg, Iterator end, Compare cmp)</div>
 <div class="line"><a name="l04404"></a><span class="lineno"> 4404</span>&#160;{</div>
-<div class="line"><a name="l04405"></a><span class="lineno"> 4405</span>&#160;    VMA_ASSERT(resourceAOffset + resourceASize &lt;= resourceBOffset &amp;&amp; resourceASize &gt; 0 &amp;&amp; pageSize &gt; 0);</div>
-<div class="line"><a name="l04406"></a><span class="lineno"> 4406</span>&#160;    VkDeviceSize resourceAEnd = resourceAOffset + resourceASize - 1;</div>
-<div class="line"><a name="l04407"></a><span class="lineno"> 4407</span>&#160;    VkDeviceSize resourceAEndPage = resourceAEnd &amp; ~(pageSize - 1);</div>
-<div class="line"><a name="l04408"></a><span class="lineno"> 4408</span>&#160;    VkDeviceSize resourceBStart = resourceBOffset;</div>
-<div class="line"><a name="l04409"></a><span class="lineno"> 4409</span>&#160;    VkDeviceSize resourceBStartPage = resourceBStart &amp; ~(pageSize - 1);</div>
-<div class="line"><a name="l04410"></a><span class="lineno"> 4410</span>&#160;    <span class="keywordflow">return</span> resourceAEndPage == resourceBStartPage;</div>
+<div class="line"><a name="l04405"></a><span class="lineno"> 4405</span>&#160;    <span class="keywordflow">if</span>(beg &lt; end)</div>
+<div class="line"><a name="l04406"></a><span class="lineno"> 4406</span>&#160;    {</div>
+<div class="line"><a name="l04407"></a><span class="lineno"> 4407</span>&#160;        Iterator it = VmaQuickSortPartition&lt;Iterator, Compare&gt;(beg, end, cmp);</div>
+<div class="line"><a name="l04408"></a><span class="lineno"> 4408</span>&#160;        VmaQuickSort&lt;Iterator, Compare&gt;(beg, it, cmp);</div>
+<div class="line"><a name="l04409"></a><span class="lineno"> 4409</span>&#160;        VmaQuickSort&lt;Iterator, Compare&gt;(it + 1, end, cmp);</div>
+<div class="line"><a name="l04410"></a><span class="lineno"> 4410</span>&#160;    }</div>
 <div class="line"><a name="l04411"></a><span class="lineno"> 4411</span>&#160;}</div>
 <div class="line"><a name="l04412"></a><span class="lineno"> 4412</span>&#160; </div>
-<div class="line"><a name="l04413"></a><span class="lineno"> 4413</span>&#160;<span class="keyword">enum</span> VmaSuballocationType</div>
-<div class="line"><a name="l04414"></a><span class="lineno"> 4414</span>&#160;{</div>
-<div class="line"><a name="l04415"></a><span class="lineno"> 4415</span>&#160;    VMA_SUBALLOCATION_TYPE_FREE = 0,</div>
-<div class="line"><a name="l04416"></a><span class="lineno"> 4416</span>&#160;    VMA_SUBALLOCATION_TYPE_UNKNOWN = 1,</div>
-<div class="line"><a name="l04417"></a><span class="lineno"> 4417</span>&#160;    VMA_SUBALLOCATION_TYPE_BUFFER = 2,</div>
-<div class="line"><a name="l04418"></a><span class="lineno"> 4418</span>&#160;    VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN = 3,</div>
-<div class="line"><a name="l04419"></a><span class="lineno"> 4419</span>&#160;    VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR = 4,</div>
-<div class="line"><a name="l04420"></a><span class="lineno"> 4420</span>&#160;    VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL = 5,</div>
-<div class="line"><a name="l04421"></a><span class="lineno"> 4421</span>&#160;    VMA_SUBALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF</div>
-<div class="line"><a name="l04422"></a><span class="lineno"> 4422</span>&#160;};</div>
-<div class="line"><a name="l04423"></a><span class="lineno"> 4423</span>&#160; </div>
-<div class="line"><a name="l04424"></a><span class="lineno"> 4424</span>&#160;<span class="comment">/*</span></div>
-<div class="line"><a name="l04425"></a><span class="lineno"> 4425</span>&#160;<span class="comment">Returns true if given suballocation types could conflict and must respect</span></div>
-<div class="line"><a name="l04426"></a><span class="lineno"> 4426</span>&#160;<span class="comment">VkPhysicalDeviceLimits::bufferImageGranularity. They conflict if one is buffer</span></div>
-<div class="line"><a name="l04427"></a><span class="lineno"> 4427</span>&#160;<span class="comment">or linear image and another one is optimal image. If type is unknown, behave</span></div>
-<div class="line"><a name="l04428"></a><span class="lineno"> 4428</span>&#160;<span class="comment">conservatively.</span></div>
-<div class="line"><a name="l04429"></a><span class="lineno"> 4429</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l04430"></a><span class="lineno"> 4430</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> VmaIsBufferImageGranularityConflict(</div>
-<div class="line"><a name="l04431"></a><span class="lineno"> 4431</span>&#160;    VmaSuballocationType suballocType1,</div>
-<div class="line"><a name="l04432"></a><span class="lineno"> 4432</span>&#160;    VmaSuballocationType suballocType2)</div>
-<div class="line"><a name="l04433"></a><span class="lineno"> 4433</span>&#160;{</div>
-<div class="line"><a name="l04434"></a><span class="lineno"> 4434</span>&#160;    <span class="keywordflow">if</span>(suballocType1 &gt; suballocType2)</div>
-<div class="line"><a name="l04435"></a><span class="lineno"> 4435</span>&#160;    {</div>
-<div class="line"><a name="l04436"></a><span class="lineno"> 4436</span>&#160;        VMA_SWAP(suballocType1, suballocType2);</div>
-<div class="line"><a name="l04437"></a><span class="lineno"> 4437</span>&#160;    }</div>
-<div class="line"><a name="l04438"></a><span class="lineno"> 4438</span>&#160;    </div>
-<div class="line"><a name="l04439"></a><span class="lineno"> 4439</span>&#160;    <span class="keywordflow">switch</span>(suballocType1)</div>
-<div class="line"><a name="l04440"></a><span class="lineno"> 4440</span>&#160;    {</div>
-<div class="line"><a name="l04441"></a><span class="lineno"> 4441</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_FREE:</div>
-<div class="line"><a name="l04442"></a><span class="lineno"> 4442</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l04443"></a><span class="lineno"> 4443</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_UNKNOWN:</div>
-<div class="line"><a name="l04444"></a><span class="lineno"> 4444</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l04445"></a><span class="lineno"> 4445</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_BUFFER:</div>
-<div class="line"><a name="l04446"></a><span class="lineno"> 4446</span>&#160;        <span class="keywordflow">return</span></div>
-<div class="line"><a name="l04447"></a><span class="lineno"> 4447</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||</div>
-<div class="line"><a name="l04448"></a><span class="lineno"> 4448</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;</div>
-<div class="line"><a name="l04449"></a><span class="lineno"> 4449</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN:</div>
-<div class="line"><a name="l04450"></a><span class="lineno"> 4450</span>&#160;        <span class="keywordflow">return</span></div>
-<div class="line"><a name="l04451"></a><span class="lineno"> 4451</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||</div>
-<div class="line"><a name="l04452"></a><span class="lineno"> 4452</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR ||</div>
-<div class="line"><a name="l04453"></a><span class="lineno"> 4453</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;</div>
-<div class="line"><a name="l04454"></a><span class="lineno"> 4454</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR:</div>
-<div class="line"><a name="l04455"></a><span class="lineno"> 4455</span>&#160;        <span class="keywordflow">return</span></div>
-<div class="line"><a name="l04456"></a><span class="lineno"> 4456</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;</div>
-<div class="line"><a name="l04457"></a><span class="lineno"> 4457</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL:</div>
-<div class="line"><a name="l04458"></a><span class="lineno"> 4458</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l04459"></a><span class="lineno"> 4459</span>&#160;    <span class="keywordflow">default</span>:</div>
-<div class="line"><a name="l04460"></a><span class="lineno"> 4460</span>&#160;        VMA_ASSERT(0);</div>
-<div class="line"><a name="l04461"></a><span class="lineno"> 4461</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
+<div class="line"><a name="l04413"></a><span class="lineno"> 4413</span>&#160;<span class="preprocessor">#define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp)</span></div>
+<div class="line"><a name="l04414"></a><span class="lineno"> 4414</span>&#160; </div>
+<div class="line"><a name="l04415"></a><span class="lineno"> 4415</span>&#160;<span class="preprocessor">#endif // #ifndef VMA_SORT</span></div>
+<div class="line"><a name="l04416"></a><span class="lineno"> 4416</span>&#160; </div>
+<div class="line"><a name="l04417"></a><span class="lineno"> 4417</span>&#160;<span class="comment">/*</span></div>
+<div class="line"><a name="l04418"></a><span class="lineno"> 4418</span>&#160;<span class="comment">Returns true if two memory blocks occupy overlapping pages.</span></div>
+<div class="line"><a name="l04419"></a><span class="lineno"> 4419</span>&#160;<span class="comment">ResourceA must be in less memory offset than ResourceB.</span></div>
+<div class="line"><a name="l04420"></a><span class="lineno"> 4420</span>&#160;<span class="comment"></span> </div>
+<div class="line"><a name="l04421"></a><span class="lineno"> 4421</span>&#160;<span class="comment">Algorithm is based on &quot;Vulkan 1.0.39 - A Specification (with all registered Vulkan extensions)&quot;</span></div>
+<div class="line"><a name="l04422"></a><span class="lineno"> 4422</span>&#160;<span class="comment">chapter 11.6 &quot;Resource Memory Association&quot;, paragraph &quot;Buffer-Image Granularity&quot;.</span></div>
+<div class="line"><a name="l04423"></a><span class="lineno"> 4423</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l04424"></a><span class="lineno"> 4424</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> VmaBlocksOnSamePage(</div>
+<div class="line"><a name="l04425"></a><span class="lineno"> 4425</span>&#160;    VkDeviceSize resourceAOffset,</div>
+<div class="line"><a name="l04426"></a><span class="lineno"> 4426</span>&#160;    VkDeviceSize resourceASize,</div>
+<div class="line"><a name="l04427"></a><span class="lineno"> 4427</span>&#160;    VkDeviceSize resourceBOffset,</div>
+<div class="line"><a name="l04428"></a><span class="lineno"> 4428</span>&#160;    VkDeviceSize pageSize)</div>
+<div class="line"><a name="l04429"></a><span class="lineno"> 4429</span>&#160;{</div>
+<div class="line"><a name="l04430"></a><span class="lineno"> 4430</span>&#160;    VMA_ASSERT(resourceAOffset + resourceASize &lt;= resourceBOffset &amp;&amp; resourceASize &gt; 0 &amp;&amp; pageSize &gt; 0);</div>
+<div class="line"><a name="l04431"></a><span class="lineno"> 4431</span>&#160;    VkDeviceSize resourceAEnd = resourceAOffset + resourceASize - 1;</div>
+<div class="line"><a name="l04432"></a><span class="lineno"> 4432</span>&#160;    VkDeviceSize resourceAEndPage = resourceAEnd &amp; ~(pageSize - 1);</div>
+<div class="line"><a name="l04433"></a><span class="lineno"> 4433</span>&#160;    VkDeviceSize resourceBStart = resourceBOffset;</div>
+<div class="line"><a name="l04434"></a><span class="lineno"> 4434</span>&#160;    VkDeviceSize resourceBStartPage = resourceBStart &amp; ~(pageSize - 1);</div>
+<div class="line"><a name="l04435"></a><span class="lineno"> 4435</span>&#160;    <span class="keywordflow">return</span> resourceAEndPage == resourceBStartPage;</div>
+<div class="line"><a name="l04436"></a><span class="lineno"> 4436</span>&#160;}</div>
+<div class="line"><a name="l04437"></a><span class="lineno"> 4437</span>&#160; </div>
+<div class="line"><a name="l04438"></a><span class="lineno"> 4438</span>&#160;<span class="keyword">enum</span> VmaSuballocationType</div>
+<div class="line"><a name="l04439"></a><span class="lineno"> 4439</span>&#160;{</div>
+<div class="line"><a name="l04440"></a><span class="lineno"> 4440</span>&#160;    VMA_SUBALLOCATION_TYPE_FREE = 0,</div>
+<div class="line"><a name="l04441"></a><span class="lineno"> 4441</span>&#160;    VMA_SUBALLOCATION_TYPE_UNKNOWN = 1,</div>
+<div class="line"><a name="l04442"></a><span class="lineno"> 4442</span>&#160;    VMA_SUBALLOCATION_TYPE_BUFFER = 2,</div>
+<div class="line"><a name="l04443"></a><span class="lineno"> 4443</span>&#160;    VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN = 3,</div>
+<div class="line"><a name="l04444"></a><span class="lineno"> 4444</span>&#160;    VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR = 4,</div>
+<div class="line"><a name="l04445"></a><span class="lineno"> 4445</span>&#160;    VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL = 5,</div>
+<div class="line"><a name="l04446"></a><span class="lineno"> 4446</span>&#160;    VMA_SUBALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF</div>
+<div class="line"><a name="l04447"></a><span class="lineno"> 4447</span>&#160;};</div>
+<div class="line"><a name="l04448"></a><span class="lineno"> 4448</span>&#160; </div>
+<div class="line"><a name="l04449"></a><span class="lineno"> 4449</span>&#160;<span class="comment">/*</span></div>
+<div class="line"><a name="l04450"></a><span class="lineno"> 4450</span>&#160;<span class="comment">Returns true if given suballocation types could conflict and must respect</span></div>
+<div class="line"><a name="l04451"></a><span class="lineno"> 4451</span>&#160;<span class="comment">VkPhysicalDeviceLimits::bufferImageGranularity. They conflict if one is buffer</span></div>
+<div class="line"><a name="l04452"></a><span class="lineno"> 4452</span>&#160;<span class="comment">or linear image and another one is optimal image. If type is unknown, behave</span></div>
+<div class="line"><a name="l04453"></a><span class="lineno"> 4453</span>&#160;<span class="comment">conservatively.</span></div>
+<div class="line"><a name="l04454"></a><span class="lineno"> 4454</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l04455"></a><span class="lineno"> 4455</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> VmaIsBufferImageGranularityConflict(</div>
+<div class="line"><a name="l04456"></a><span class="lineno"> 4456</span>&#160;    VmaSuballocationType suballocType1,</div>
+<div class="line"><a name="l04457"></a><span class="lineno"> 4457</span>&#160;    VmaSuballocationType suballocType2)</div>
+<div class="line"><a name="l04458"></a><span class="lineno"> 4458</span>&#160;{</div>
+<div class="line"><a name="l04459"></a><span class="lineno"> 4459</span>&#160;    <span class="keywordflow">if</span>(suballocType1 &gt; suballocType2)</div>
+<div class="line"><a name="l04460"></a><span class="lineno"> 4460</span>&#160;    {</div>
+<div class="line"><a name="l04461"></a><span class="lineno"> 4461</span>&#160;        VMA_SWAP(suballocType1, suballocType2);</div>
 <div class="line"><a name="l04462"></a><span class="lineno"> 4462</span>&#160;    }</div>
-<div class="line"><a name="l04463"></a><span class="lineno"> 4463</span>&#160;}</div>
-<div class="line"><a name="l04464"></a><span class="lineno"> 4464</span>&#160; </div>
-<div class="line"><a name="l04465"></a><span class="lineno"> 4465</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaWriteMagicValue(<span class="keywordtype">void</span>* pData, VkDeviceSize offset)</div>
-<div class="line"><a name="l04466"></a><span class="lineno"> 4466</span>&#160;{</div>
-<div class="line"><a name="l04467"></a><span class="lineno"> 4467</span>&#160;<span class="preprocessor">#if VMA_DEBUG_MARGIN &gt; 0 &amp;&amp; VMA_DEBUG_DETECT_CORRUPTION</span></div>
-<div class="line"><a name="l04468"></a><span class="lineno"> 4468</span>&#160;    uint32_t* pDst = (uint32_t*)((<span class="keywordtype">char</span>*)pData + offset);</div>
-<div class="line"><a name="l04469"></a><span class="lineno"> 4469</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">size_t</span> numberCount = VMA_DEBUG_MARGIN / <span class="keyword">sizeof</span>(uint32_t);</div>
-<div class="line"><a name="l04470"></a><span class="lineno"> 4470</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = 0; i &lt; numberCount; ++i, ++pDst)</div>
-<div class="line"><a name="l04471"></a><span class="lineno"> 4471</span>&#160;    {</div>
-<div class="line"><a name="l04472"></a><span class="lineno"> 4472</span>&#160;        *pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;</div>
-<div class="line"><a name="l04473"></a><span class="lineno"> 4473</span>&#160;    }</div>
-<div class="line"><a name="l04474"></a><span class="lineno"> 4474</span>&#160;<span class="preprocessor">#else</span></div>
-<div class="line"><a name="l04475"></a><span class="lineno"> 4475</span>&#160;    <span class="comment">// no-op</span></div>
-<div class="line"><a name="l04476"></a><span class="lineno"> 4476</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04477"></a><span class="lineno"> 4477</span>&#160;}</div>
-<div class="line"><a name="l04478"></a><span class="lineno"> 4478</span>&#160; </div>
-<div class="line"><a name="l04479"></a><span class="lineno"> 4479</span>&#160;<span class="keyword">static</span> <span class="keywordtype">bool</span> VmaValidateMagicValue(<span class="keyword">const</span> <span class="keywordtype">void</span>* pData, VkDeviceSize offset)</div>
-<div class="line"><a name="l04480"></a><span class="lineno"> 4480</span>&#160;{</div>
-<div class="line"><a name="l04481"></a><span class="lineno"> 4481</span>&#160;<span class="preprocessor">#if VMA_DEBUG_MARGIN &gt; 0 &amp;&amp; VMA_DEBUG_DETECT_CORRUPTION</span></div>
-<div class="line"><a name="l04482"></a><span class="lineno"> 4482</span>&#160;    <span class="keyword">const</span> uint32_t* pSrc = (<span class="keyword">const</span> uint32_t*)((<span class="keyword">const</span> <span class="keywordtype">char</span>*)pData + offset);</div>
-<div class="line"><a name="l04483"></a><span class="lineno"> 4483</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">size_t</span> numberCount = VMA_DEBUG_MARGIN / <span class="keyword">sizeof</span>(uint32_t);</div>
-<div class="line"><a name="l04484"></a><span class="lineno"> 4484</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = 0; i &lt; numberCount; ++i, ++pSrc)</div>
-<div class="line"><a name="l04485"></a><span class="lineno"> 4485</span>&#160;    {</div>
-<div class="line"><a name="l04486"></a><span class="lineno"> 4486</span>&#160;        <span class="keywordflow">if</span>(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)</div>
-<div class="line"><a name="l04487"></a><span class="lineno"> 4487</span>&#160;        {</div>
-<div class="line"><a name="l04488"></a><span class="lineno"> 4488</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l04489"></a><span class="lineno"> 4489</span>&#160;        }</div>
-<div class="line"><a name="l04490"></a><span class="lineno"> 4490</span>&#160;    }</div>
-<div class="line"><a name="l04491"></a><span class="lineno"> 4491</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04492"></a><span class="lineno"> 4492</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l04493"></a><span class="lineno"> 4493</span>&#160;}</div>
-<div class="line"><a name="l04494"></a><span class="lineno"> 4494</span>&#160; </div>
-<div class="line"><a name="l04495"></a><span class="lineno"> 4495</span>&#160;<span class="comment">/*</span></div>
-<div class="line"><a name="l04496"></a><span class="lineno"> 4496</span>&#160;<span class="comment">Fills structure with parameters of an example buffer to be used for transfers</span></div>
-<div class="line"><a name="l04497"></a><span class="lineno"> 4497</span>&#160;<span class="comment">during GPU memory defragmentation.</span></div>
-<div class="line"><a name="l04498"></a><span class="lineno"> 4498</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l04499"></a><span class="lineno"> 4499</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaFillGpuDefragmentationBufferCreateInfo(VkBufferCreateInfo&amp; outBufCreateInfo)</div>
-<div class="line"><a name="l04500"></a><span class="lineno"> 4500</span>&#160;{</div>
-<div class="line"><a name="l04501"></a><span class="lineno"> 4501</span>&#160;    memset(&amp;outBufCreateInfo, 0, <span class="keyword">sizeof</span>(outBufCreateInfo));</div>
-<div class="line"><a name="l04502"></a><span class="lineno"> 4502</span>&#160;    outBufCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;</div>
-<div class="line"><a name="l04503"></a><span class="lineno"> 4503</span>&#160;    outBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;</div>
-<div class="line"><a name="l04504"></a><span class="lineno"> 4504</span>&#160;    outBufCreateInfo.size = (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE; <span class="comment">// Example size.</span></div>
-<div class="line"><a name="l04505"></a><span class="lineno"> 4505</span>&#160;}</div>
-<div class="line"><a name="l04506"></a><span class="lineno"> 4506</span>&#160; </div>
-<div class="line"><a name="l04507"></a><span class="lineno"> 4507</span>&#160;<span class="comment">// Helper RAII class to lock a mutex in constructor and unlock it in destructor (at the end of scope).</span></div>
-<div class="line"><a name="l04508"></a><span class="lineno"> 4508</span>&#160;<span class="keyword">struct </span>VmaMutexLock</div>
-<div class="line"><a name="l04509"></a><span class="lineno"> 4509</span>&#160;{</div>
-<div class="line"><a name="l04510"></a><span class="lineno"> 4510</span>&#160;    VMA_CLASS_NO_COPY(VmaMutexLock)</div>
-<div class="line"><a name="l04511"></a><span class="lineno"> 4511</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l04512"></a><span class="lineno"> 4512</span>&#160;    VmaMutexLock(VMA_MUTEX&amp; mutex, <span class="keywordtype">bool</span> useMutex = <span class="keyword">true</span>) :</div>
-<div class="line"><a name="l04513"></a><span class="lineno"> 4513</span>&#160;        m_pMutex(useMutex ? &amp;mutex : VMA_NULL)</div>
-<div class="line"><a name="l04514"></a><span class="lineno"> 4514</span>&#160;    { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;Lock(); } }</div>
-<div class="line"><a name="l04515"></a><span class="lineno"> 4515</span>&#160;    ~VmaMutexLock()</div>
-<div class="line"><a name="l04516"></a><span class="lineno"> 4516</span>&#160;    { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;Unlock(); } }</div>
-<div class="line"><a name="l04517"></a><span class="lineno"> 4517</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l04518"></a><span class="lineno"> 4518</span>&#160;    VMA_MUTEX* m_pMutex;</div>
-<div class="line"><a name="l04519"></a><span class="lineno"> 4519</span>&#160;};</div>
-<div class="line"><a name="l04520"></a><span class="lineno"> 4520</span>&#160; </div>
-<div class="line"><a name="l04521"></a><span class="lineno"> 4521</span>&#160;<span class="comment">// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for reading.</span></div>
-<div class="line"><a name="l04522"></a><span class="lineno"> 4522</span>&#160;<span class="keyword">struct </span>VmaMutexLockRead</div>
-<div class="line"><a name="l04523"></a><span class="lineno"> 4523</span>&#160;{</div>
-<div class="line"><a name="l04524"></a><span class="lineno"> 4524</span>&#160;    VMA_CLASS_NO_COPY(VmaMutexLockRead)</div>
-<div class="line"><a name="l04525"></a><span class="lineno"> 4525</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l04526"></a><span class="lineno"> 4526</span>&#160;    VmaMutexLockRead(VMA_RW_MUTEX&amp; mutex, <span class="keywordtype">bool</span> useMutex) :</div>
-<div class="line"><a name="l04527"></a><span class="lineno"> 4527</span>&#160;        m_pMutex(useMutex ? &amp;mutex : VMA_NULL)</div>
-<div class="line"><a name="l04528"></a><span class="lineno"> 4528</span>&#160;    { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;LockRead(); } }</div>
-<div class="line"><a name="l04529"></a><span class="lineno"> 4529</span>&#160;    ~VmaMutexLockRead() { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;UnlockRead(); } }</div>
-<div class="line"><a name="l04530"></a><span class="lineno"> 4530</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l04531"></a><span class="lineno"> 4531</span>&#160;    VMA_RW_MUTEX* m_pMutex;</div>
-<div class="line"><a name="l04532"></a><span class="lineno"> 4532</span>&#160;};</div>
-<div class="line"><a name="l04533"></a><span class="lineno"> 4533</span>&#160; </div>
-<div class="line"><a name="l04534"></a><span class="lineno"> 4534</span>&#160;<span class="comment">// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for writing.</span></div>
-<div class="line"><a name="l04535"></a><span class="lineno"> 4535</span>&#160;<span class="keyword">struct </span>VmaMutexLockWrite</div>
-<div class="line"><a name="l04536"></a><span class="lineno"> 4536</span>&#160;{</div>
-<div class="line"><a name="l04537"></a><span class="lineno"> 4537</span>&#160;    VMA_CLASS_NO_COPY(VmaMutexLockWrite)</div>
-<div class="line"><a name="l04538"></a><span class="lineno"> 4538</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l04539"></a><span class="lineno"> 4539</span>&#160;    VmaMutexLockWrite(VMA_RW_MUTEX&amp; mutex, <span class="keywordtype">bool</span> useMutex) :</div>
-<div class="line"><a name="l04540"></a><span class="lineno"> 4540</span>&#160;        m_pMutex(useMutex ? &amp;mutex : VMA_NULL)</div>
-<div class="line"><a name="l04541"></a><span class="lineno"> 4541</span>&#160;    { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;LockWrite(); } }</div>
-<div class="line"><a name="l04542"></a><span class="lineno"> 4542</span>&#160;    ~VmaMutexLockWrite() { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;UnlockWrite(); } }</div>
-<div class="line"><a name="l04543"></a><span class="lineno"> 4543</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l04544"></a><span class="lineno"> 4544</span>&#160;    VMA_RW_MUTEX* m_pMutex;</div>
-<div class="line"><a name="l04545"></a><span class="lineno"> 4545</span>&#160;};</div>
-<div class="line"><a name="l04546"></a><span class="lineno"> 4546</span>&#160; </div>
-<div class="line"><a name="l04547"></a><span class="lineno"> 4547</span>&#160;<span class="preprocessor">#if VMA_DEBUG_GLOBAL_MUTEX</span></div>
-<div class="line"><a name="l04548"></a><span class="lineno"> 4548</span>&#160;    <span class="keyword">static</span> VMA_MUTEX gDebugGlobalMutex;</div>
-<div class="line"><a name="l04549"></a><span class="lineno"> 4549</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex, true);</span></div>
-<div class="line"><a name="l04550"></a><span class="lineno"> 4550</span>&#160;<span class="preprocessor">#else</span></div>
-<div class="line"><a name="l04551"></a><span class="lineno"> 4551</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_GLOBAL_MUTEX_LOCK</span></div>
-<div class="line"><a name="l04552"></a><span class="lineno"> 4552</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l04553"></a><span class="lineno"> 4553</span>&#160; </div>
-<div class="line"><a name="l04554"></a><span class="lineno"> 4554</span>&#160;<span class="comment">// Minimum size of a free suballocation to register it in the free suballocation collection.</span></div>
-<div class="line"><a name="l04555"></a><span class="lineno"> 4555</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> VkDeviceSize VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER = 16;</div>
-<div class="line"><a name="l04556"></a><span class="lineno"> 4556</span>&#160; </div>
-<div class="line"><a name="l04557"></a><span class="lineno"> 4557</span>&#160;<span class="comment">/*</span></div>
-<div class="line"><a name="l04558"></a><span class="lineno"> 4558</span>&#160;<span class="comment">Performs binary search and returns iterator to first element that is greater or</span></div>
-<div class="line"><a name="l04559"></a><span class="lineno"> 4559</span>&#160;<span class="comment">equal to (key), according to comparison (cmp).</span></div>
-<div class="line"><a name="l04560"></a><span class="lineno"> 4560</span>&#160;<span class="comment"></span> </div>
-<div class="line"><a name="l04561"></a><span class="lineno"> 4561</span>&#160;<span class="comment">Cmp should return true if first argument is less than second argument.</span></div>
-<div class="line"><a name="l04562"></a><span class="lineno"> 4562</span>&#160;<span class="comment"></span> </div>
-<div class="line"><a name="l04563"></a><span class="lineno"> 4563</span>&#160;<span class="comment">Returned value is the found element, if present in the collection or place where</span></div>
-<div class="line"><a name="l04564"></a><span class="lineno"> 4564</span>&#160;<span class="comment">new element with value (key) should be inserted.</span></div>
-<div class="line"><a name="l04565"></a><span class="lineno"> 4565</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l04566"></a><span class="lineno"> 4566</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> CmpLess, <span class="keyword">typename</span> IterT, <span class="keyword">typename</span> KeyT&gt;</div>
-<div class="line"><a name="l04567"></a><span class="lineno"> 4567</span>&#160;<span class="keyword">static</span> IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, <span class="keyword">const</span> KeyT &amp;key, <span class="keyword">const</span> CmpLess&amp; cmp)</div>
-<div class="line"><a name="l04568"></a><span class="lineno"> 4568</span>&#160;{</div>
-<div class="line"><a name="l04569"></a><span class="lineno"> 4569</span>&#160;    <span class="keywordtype">size_t</span> down = 0, up = (end - beg);</div>
-<div class="line"><a name="l04570"></a><span class="lineno"> 4570</span>&#160;    <span class="keywordflow">while</span>(down &lt; up)</div>
-<div class="line"><a name="l04571"></a><span class="lineno"> 4571</span>&#160;    {</div>
-<div class="line"><a name="l04572"></a><span class="lineno"> 4572</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> mid = (down + up) / 2;</div>
-<div class="line"><a name="l04573"></a><span class="lineno"> 4573</span>&#160;        <span class="keywordflow">if</span>(cmp(*(beg+mid), key))</div>
-<div class="line"><a name="l04574"></a><span class="lineno"> 4574</span>&#160;        {</div>
-<div class="line"><a name="l04575"></a><span class="lineno"> 4575</span>&#160;            down = mid + 1;</div>
-<div class="line"><a name="l04576"></a><span class="lineno"> 4576</span>&#160;        }</div>
-<div class="line"><a name="l04577"></a><span class="lineno"> 4577</span>&#160;        <span class="keywordflow">else</span></div>
-<div class="line"><a name="l04578"></a><span class="lineno"> 4578</span>&#160;        {</div>
-<div class="line"><a name="l04579"></a><span class="lineno"> 4579</span>&#160;            up = mid;</div>
-<div class="line"><a name="l04580"></a><span class="lineno"> 4580</span>&#160;        }</div>
-<div class="line"><a name="l04581"></a><span class="lineno"> 4581</span>&#160;    }</div>
-<div class="line"><a name="l04582"></a><span class="lineno"> 4582</span>&#160;    <span class="keywordflow">return</span> beg + down;</div>
-<div class="line"><a name="l04583"></a><span class="lineno"> 4583</span>&#160;}</div>
-<div class="line"><a name="l04584"></a><span class="lineno"> 4584</span>&#160; </div>
-<div class="line"><a name="l04585"></a><span class="lineno"> 4585</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> CmpLess, <span class="keyword">typename</span> IterT, <span class="keyword">typename</span> KeyT&gt;</div>
-<div class="line"><a name="l04586"></a><span class="lineno"> 4586</span>&#160;IterT VmaBinaryFindSorted(<span class="keyword">const</span> IterT&amp; beg, <span class="keyword">const</span> IterT&amp; end, <span class="keyword">const</span> KeyT&amp; value, <span class="keyword">const</span> CmpLess&amp; cmp)</div>
-<div class="line"><a name="l04587"></a><span class="lineno"> 4587</span>&#160;{</div>
-<div class="line"><a name="l04588"></a><span class="lineno"> 4588</span>&#160;    IterT it = VmaBinaryFindFirstNotLess&lt;CmpLess, IterT, KeyT&gt;(</div>
-<div class="line"><a name="l04589"></a><span class="lineno"> 4589</span>&#160;        beg, end, value, cmp);</div>
-<div class="line"><a name="l04590"></a><span class="lineno"> 4590</span>&#160;    <span class="keywordflow">if</span>(it == end ||</div>
-<div class="line"><a name="l04591"></a><span class="lineno"> 4591</span>&#160;        (!cmp(*it, value) &amp;&amp; !cmp(value, *it)))</div>
-<div class="line"><a name="l04592"></a><span class="lineno"> 4592</span>&#160;    {</div>
-<div class="line"><a name="l04593"></a><span class="lineno"> 4593</span>&#160;        <span class="keywordflow">return</span> it;</div>
-<div class="line"><a name="l04594"></a><span class="lineno"> 4594</span>&#160;    }</div>
-<div class="line"><a name="l04595"></a><span class="lineno"> 4595</span>&#160;    <span class="keywordflow">return</span> end;</div>
-<div class="line"><a name="l04596"></a><span class="lineno"> 4596</span>&#160;}</div>
-<div class="line"><a name="l04597"></a><span class="lineno"> 4597</span>&#160; </div>
-<div class="line"><a name="l04598"></a><span class="lineno"> 4598</span>&#160;<span class="comment">/*</span></div>
-<div class="line"><a name="l04599"></a><span class="lineno"> 4599</span>&#160;<span class="comment">Returns true if all pointers in the array are not-null and unique.</span></div>
-<div class="line"><a name="l04600"></a><span class="lineno"> 4600</span>&#160;<span class="comment">Warning! O(n^2) complexity. Use only inside VMA_HEAVY_ASSERT.</span></div>
-<div class="line"><a name="l04601"></a><span class="lineno"> 4601</span>&#160;<span class="comment">T must be pointer type, e.g. VmaAllocation, VmaPool.</span></div>
-<div class="line"><a name="l04602"></a><span class="lineno"> 4602</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l04603"></a><span class="lineno"> 4603</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04604"></a><span class="lineno"> 4604</span>&#160;<span class="keyword">static</span> <span class="keywordtype">bool</span> VmaValidatePointerArray(uint32_t count, <span class="keyword">const</span> T* arr)</div>
-<div class="line"><a name="l04605"></a><span class="lineno"> 4605</span>&#160;{</div>
-<div class="line"><a name="l04606"></a><span class="lineno"> 4606</span>&#160;    <span class="keywordflow">for</span>(uint32_t i = 0; i &lt; count; ++i)</div>
-<div class="line"><a name="l04607"></a><span class="lineno"> 4607</span>&#160;    {</div>
-<div class="line"><a name="l04608"></a><span class="lineno"> 4608</span>&#160;        <span class="keyword">const</span> T iPtr = arr[i];</div>
-<div class="line"><a name="l04609"></a><span class="lineno"> 4609</span>&#160;        <span class="keywordflow">if</span>(iPtr == VMA_NULL)</div>
-<div class="line"><a name="l04610"></a><span class="lineno"> 4610</span>&#160;        {</div>
-<div class="line"><a name="l04611"></a><span class="lineno"> 4611</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l04612"></a><span class="lineno"> 4612</span>&#160;        }</div>
-<div class="line"><a name="l04613"></a><span class="lineno"> 4613</span>&#160;        <span class="keywordflow">for</span>(uint32_t j = i + 1; j &lt; count; ++j)</div>
-<div class="line"><a name="l04614"></a><span class="lineno"> 4614</span>&#160;        {</div>
-<div class="line"><a name="l04615"></a><span class="lineno"> 4615</span>&#160;            <span class="keywordflow">if</span>(iPtr == arr[j])</div>
-<div class="line"><a name="l04616"></a><span class="lineno"> 4616</span>&#160;            {</div>
-<div class="line"><a name="l04617"></a><span class="lineno"> 4617</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l04618"></a><span class="lineno"> 4618</span>&#160;            }</div>
-<div class="line"><a name="l04619"></a><span class="lineno"> 4619</span>&#160;        }</div>
-<div class="line"><a name="l04620"></a><span class="lineno"> 4620</span>&#160;    }</div>
-<div class="line"><a name="l04621"></a><span class="lineno"> 4621</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l04622"></a><span class="lineno"> 4622</span>&#160;}</div>
-<div class="line"><a name="l04623"></a><span class="lineno"> 4623</span>&#160; </div>
-<div class="line"><a name="l04624"></a><span class="lineno"> 4624</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MainT, <span class="keyword">typename</span> NewT&gt;</div>
-<div class="line"><a name="l04625"></a><span class="lineno"> 4625</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> VmaPnextChainPushFront(MainT* mainStruct, NewT* newStruct)</div>
-<div class="line"><a name="l04626"></a><span class="lineno"> 4626</span>&#160;{</div>
-<div class="line"><a name="l04627"></a><span class="lineno"> 4627</span>&#160;    newStruct-&gt;pNext = mainStruct-&gt;pNext;</div>
-<div class="line"><a name="l04628"></a><span class="lineno"> 4628</span>&#160;    mainStruct-&gt;pNext = newStruct;</div>
-<div class="line"><a name="l04629"></a><span class="lineno"> 4629</span>&#160;}</div>
-<div class="line"><a name="l04630"></a><span class="lineno"> 4630</span>&#160; </div>
-<div class="line"><a name="l04632"></a><span class="lineno"> 4632</span>&#160;<span class="comment">// Memory allocation</span></div>
-<div class="line"><a name="l04633"></a><span class="lineno"> 4633</span>&#160; </div>
-<div class="line"><a name="l04634"></a><span class="lineno"> 4634</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span>* VmaMalloc(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, <span class="keywordtype">size_t</span> size, <span class="keywordtype">size_t</span> alignment)</div>
-<div class="line"><a name="l04635"></a><span class="lineno"> 4635</span>&#160;{</div>
-<div class="line"><a name="l04636"></a><span class="lineno"> 4636</span>&#160;    <span class="keywordtype">void</span>* result = VMA_NULL;</div>
-<div class="line"><a name="l04637"></a><span class="lineno"> 4637</span>&#160;    <span class="keywordflow">if</span>((pAllocationCallbacks != VMA_NULL) &amp;&amp;</div>
-<div class="line"><a name="l04638"></a><span class="lineno"> 4638</span>&#160;        (pAllocationCallbacks-&gt;pfnAllocation != VMA_NULL))</div>
-<div class="line"><a name="l04639"></a><span class="lineno"> 4639</span>&#160;    {</div>
-<div class="line"><a name="l04640"></a><span class="lineno"> 4640</span>&#160;        result = (*pAllocationCallbacks-&gt;pfnAllocation)(</div>
-<div class="line"><a name="l04641"></a><span class="lineno"> 4641</span>&#160;            pAllocationCallbacks-&gt;pUserData,</div>
-<div class="line"><a name="l04642"></a><span class="lineno"> 4642</span>&#160;            size,</div>
-<div class="line"><a name="l04643"></a><span class="lineno"> 4643</span>&#160;            alignment,</div>
-<div class="line"><a name="l04644"></a><span class="lineno"> 4644</span>&#160;            VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);</div>
+<div class="line"><a name="l04463"></a><span class="lineno"> 4463</span>&#160;    </div>
+<div class="line"><a name="l04464"></a><span class="lineno"> 4464</span>&#160;    <span class="keywordflow">switch</span>(suballocType1)</div>
+<div class="line"><a name="l04465"></a><span class="lineno"> 4465</span>&#160;    {</div>
+<div class="line"><a name="l04466"></a><span class="lineno"> 4466</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_FREE:</div>
+<div class="line"><a name="l04467"></a><span class="lineno"> 4467</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l04468"></a><span class="lineno"> 4468</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_UNKNOWN:</div>
+<div class="line"><a name="l04469"></a><span class="lineno"> 4469</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
+<div class="line"><a name="l04470"></a><span class="lineno"> 4470</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_BUFFER:</div>
+<div class="line"><a name="l04471"></a><span class="lineno"> 4471</span>&#160;        <span class="keywordflow">return</span></div>
+<div class="line"><a name="l04472"></a><span class="lineno"> 4472</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||</div>
+<div class="line"><a name="l04473"></a><span class="lineno"> 4473</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;</div>
+<div class="line"><a name="l04474"></a><span class="lineno"> 4474</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN:</div>
+<div class="line"><a name="l04475"></a><span class="lineno"> 4475</span>&#160;        <span class="keywordflow">return</span></div>
+<div class="line"><a name="l04476"></a><span class="lineno"> 4476</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||</div>
+<div class="line"><a name="l04477"></a><span class="lineno"> 4477</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR ||</div>
+<div class="line"><a name="l04478"></a><span class="lineno"> 4478</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;</div>
+<div class="line"><a name="l04479"></a><span class="lineno"> 4479</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR:</div>
+<div class="line"><a name="l04480"></a><span class="lineno"> 4480</span>&#160;        <span class="keywordflow">return</span></div>
+<div class="line"><a name="l04481"></a><span class="lineno"> 4481</span>&#160;            suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;</div>
+<div class="line"><a name="l04482"></a><span class="lineno"> 4482</span>&#160;    <span class="keywordflow">case</span> VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL:</div>
+<div class="line"><a name="l04483"></a><span class="lineno"> 4483</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l04484"></a><span class="lineno"> 4484</span>&#160;    <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l04485"></a><span class="lineno"> 4485</span>&#160;        VMA_ASSERT(0);</div>
+<div class="line"><a name="l04486"></a><span class="lineno"> 4486</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
+<div class="line"><a name="l04487"></a><span class="lineno"> 4487</span>&#160;    }</div>
+<div class="line"><a name="l04488"></a><span class="lineno"> 4488</span>&#160;}</div>
+<div class="line"><a name="l04489"></a><span class="lineno"> 4489</span>&#160; </div>
+<div class="line"><a name="l04490"></a><span class="lineno"> 4490</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaWriteMagicValue(<span class="keywordtype">void</span>* pData, VkDeviceSize offset)</div>
+<div class="line"><a name="l04491"></a><span class="lineno"> 4491</span>&#160;{</div>
+<div class="line"><a name="l04492"></a><span class="lineno"> 4492</span>&#160;<span class="preprocessor">#if VMA_DEBUG_MARGIN &gt; 0 &amp;&amp; VMA_DEBUG_DETECT_CORRUPTION</span></div>
+<div class="line"><a name="l04493"></a><span class="lineno"> 4493</span>&#160;    uint32_t* pDst = (uint32_t*)((<span class="keywordtype">char</span>*)pData + offset);</div>
+<div class="line"><a name="l04494"></a><span class="lineno"> 4494</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">size_t</span> numberCount = VMA_DEBUG_MARGIN / <span class="keyword">sizeof</span>(uint32_t);</div>
+<div class="line"><a name="l04495"></a><span class="lineno"> 4495</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = 0; i &lt; numberCount; ++i, ++pDst)</div>
+<div class="line"><a name="l04496"></a><span class="lineno"> 4496</span>&#160;    {</div>
+<div class="line"><a name="l04497"></a><span class="lineno"> 4497</span>&#160;        *pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;</div>
+<div class="line"><a name="l04498"></a><span class="lineno"> 4498</span>&#160;    }</div>
+<div class="line"><a name="l04499"></a><span class="lineno"> 4499</span>&#160;<span class="preprocessor">#else</span></div>
+<div class="line"><a name="l04500"></a><span class="lineno"> 4500</span>&#160;    <span class="comment">// no-op</span></div>
+<div class="line"><a name="l04501"></a><span class="lineno"> 4501</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04502"></a><span class="lineno"> 4502</span>&#160;}</div>
+<div class="line"><a name="l04503"></a><span class="lineno"> 4503</span>&#160; </div>
+<div class="line"><a name="l04504"></a><span class="lineno"> 4504</span>&#160;<span class="keyword">static</span> <span class="keywordtype">bool</span> VmaValidateMagicValue(<span class="keyword">const</span> <span class="keywordtype">void</span>* pData, VkDeviceSize offset)</div>
+<div class="line"><a name="l04505"></a><span class="lineno"> 4505</span>&#160;{</div>
+<div class="line"><a name="l04506"></a><span class="lineno"> 4506</span>&#160;<span class="preprocessor">#if VMA_DEBUG_MARGIN &gt; 0 &amp;&amp; VMA_DEBUG_DETECT_CORRUPTION</span></div>
+<div class="line"><a name="l04507"></a><span class="lineno"> 4507</span>&#160;    <span class="keyword">const</span> uint32_t* pSrc = (<span class="keyword">const</span> uint32_t*)((<span class="keyword">const</span> <span class="keywordtype">char</span>*)pData + offset);</div>
+<div class="line"><a name="l04508"></a><span class="lineno"> 4508</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">size_t</span> numberCount = VMA_DEBUG_MARGIN / <span class="keyword">sizeof</span>(uint32_t);</div>
+<div class="line"><a name="l04509"></a><span class="lineno"> 4509</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = 0; i &lt; numberCount; ++i, ++pSrc)</div>
+<div class="line"><a name="l04510"></a><span class="lineno"> 4510</span>&#160;    {</div>
+<div class="line"><a name="l04511"></a><span class="lineno"> 4511</span>&#160;        <span class="keywordflow">if</span>(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)</div>
+<div class="line"><a name="l04512"></a><span class="lineno"> 4512</span>&#160;        {</div>
+<div class="line"><a name="l04513"></a><span class="lineno"> 4513</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l04514"></a><span class="lineno"> 4514</span>&#160;        }</div>
+<div class="line"><a name="l04515"></a><span class="lineno"> 4515</span>&#160;    }</div>
+<div class="line"><a name="l04516"></a><span class="lineno"> 4516</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04517"></a><span class="lineno"> 4517</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
+<div class="line"><a name="l04518"></a><span class="lineno"> 4518</span>&#160;}</div>
+<div class="line"><a name="l04519"></a><span class="lineno"> 4519</span>&#160; </div>
+<div class="line"><a name="l04520"></a><span class="lineno"> 4520</span>&#160;<span class="comment">/*</span></div>
+<div class="line"><a name="l04521"></a><span class="lineno"> 4521</span>&#160;<span class="comment">Fills structure with parameters of an example buffer to be used for transfers</span></div>
+<div class="line"><a name="l04522"></a><span class="lineno"> 4522</span>&#160;<span class="comment">during GPU memory defragmentation.</span></div>
+<div class="line"><a name="l04523"></a><span class="lineno"> 4523</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l04524"></a><span class="lineno"> 4524</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaFillGpuDefragmentationBufferCreateInfo(VkBufferCreateInfo&amp; outBufCreateInfo)</div>
+<div class="line"><a name="l04525"></a><span class="lineno"> 4525</span>&#160;{</div>
+<div class="line"><a name="l04526"></a><span class="lineno"> 4526</span>&#160;    memset(&amp;outBufCreateInfo, 0, <span class="keyword">sizeof</span>(outBufCreateInfo));</div>
+<div class="line"><a name="l04527"></a><span class="lineno"> 4527</span>&#160;    outBufCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;</div>
+<div class="line"><a name="l04528"></a><span class="lineno"> 4528</span>&#160;    outBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;</div>
+<div class="line"><a name="l04529"></a><span class="lineno"> 4529</span>&#160;    outBufCreateInfo.size = (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE; <span class="comment">// Example size.</span></div>
+<div class="line"><a name="l04530"></a><span class="lineno"> 4530</span>&#160;}</div>
+<div class="line"><a name="l04531"></a><span class="lineno"> 4531</span>&#160; </div>
+<div class="line"><a name="l04532"></a><span class="lineno"> 4532</span>&#160;<span class="comment">// Helper RAII class to lock a mutex in constructor and unlock it in destructor (at the end of scope).</span></div>
+<div class="line"><a name="l04533"></a><span class="lineno"> 4533</span>&#160;<span class="keyword">struct </span>VmaMutexLock</div>
+<div class="line"><a name="l04534"></a><span class="lineno"> 4534</span>&#160;{</div>
+<div class="line"><a name="l04535"></a><span class="lineno"> 4535</span>&#160;    VMA_CLASS_NO_COPY(VmaMutexLock)</div>
+<div class="line"><a name="l04536"></a><span class="lineno"> 4536</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l04537"></a><span class="lineno"> 4537</span>&#160;    VmaMutexLock(VMA_MUTEX&amp; mutex, <span class="keywordtype">bool</span> useMutex = <span class="keyword">true</span>) :</div>
+<div class="line"><a name="l04538"></a><span class="lineno"> 4538</span>&#160;        m_pMutex(useMutex ? &amp;mutex : VMA_NULL)</div>
+<div class="line"><a name="l04539"></a><span class="lineno"> 4539</span>&#160;    { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;Lock(); } }</div>
+<div class="line"><a name="l04540"></a><span class="lineno"> 4540</span>&#160;    ~VmaMutexLock()</div>
+<div class="line"><a name="l04541"></a><span class="lineno"> 4541</span>&#160;    { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;Unlock(); } }</div>
+<div class="line"><a name="l04542"></a><span class="lineno"> 4542</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l04543"></a><span class="lineno"> 4543</span>&#160;    VMA_MUTEX* m_pMutex;</div>
+<div class="line"><a name="l04544"></a><span class="lineno"> 4544</span>&#160;};</div>
+<div class="line"><a name="l04545"></a><span class="lineno"> 4545</span>&#160; </div>
+<div class="line"><a name="l04546"></a><span class="lineno"> 4546</span>&#160;<span class="comment">// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for reading.</span></div>
+<div class="line"><a name="l04547"></a><span class="lineno"> 4547</span>&#160;<span class="keyword">struct </span>VmaMutexLockRead</div>
+<div class="line"><a name="l04548"></a><span class="lineno"> 4548</span>&#160;{</div>
+<div class="line"><a name="l04549"></a><span class="lineno"> 4549</span>&#160;    VMA_CLASS_NO_COPY(VmaMutexLockRead)</div>
+<div class="line"><a name="l04550"></a><span class="lineno"> 4550</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l04551"></a><span class="lineno"> 4551</span>&#160;    VmaMutexLockRead(VMA_RW_MUTEX&amp; mutex, <span class="keywordtype">bool</span> useMutex) :</div>
+<div class="line"><a name="l04552"></a><span class="lineno"> 4552</span>&#160;        m_pMutex(useMutex ? &amp;mutex : VMA_NULL)</div>
+<div class="line"><a name="l04553"></a><span class="lineno"> 4553</span>&#160;    { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;LockRead(); } }</div>
+<div class="line"><a name="l04554"></a><span class="lineno"> 4554</span>&#160;    ~VmaMutexLockRead() { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;UnlockRead(); } }</div>
+<div class="line"><a name="l04555"></a><span class="lineno"> 4555</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l04556"></a><span class="lineno"> 4556</span>&#160;    VMA_RW_MUTEX* m_pMutex;</div>
+<div class="line"><a name="l04557"></a><span class="lineno"> 4557</span>&#160;};</div>
+<div class="line"><a name="l04558"></a><span class="lineno"> 4558</span>&#160; </div>
+<div class="line"><a name="l04559"></a><span class="lineno"> 4559</span>&#160;<span class="comment">// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for writing.</span></div>
+<div class="line"><a name="l04560"></a><span class="lineno"> 4560</span>&#160;<span class="keyword">struct </span>VmaMutexLockWrite</div>
+<div class="line"><a name="l04561"></a><span class="lineno"> 4561</span>&#160;{</div>
+<div class="line"><a name="l04562"></a><span class="lineno"> 4562</span>&#160;    VMA_CLASS_NO_COPY(VmaMutexLockWrite)</div>
+<div class="line"><a name="l04563"></a><span class="lineno"> 4563</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l04564"></a><span class="lineno"> 4564</span>&#160;    VmaMutexLockWrite(VMA_RW_MUTEX&amp; mutex, <span class="keywordtype">bool</span> useMutex) :</div>
+<div class="line"><a name="l04565"></a><span class="lineno"> 4565</span>&#160;        m_pMutex(useMutex ? &amp;mutex : VMA_NULL)</div>
+<div class="line"><a name="l04566"></a><span class="lineno"> 4566</span>&#160;    { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;LockWrite(); } }</div>
+<div class="line"><a name="l04567"></a><span class="lineno"> 4567</span>&#160;    ~VmaMutexLockWrite() { <span class="keywordflow">if</span>(m_pMutex) { m_pMutex-&gt;UnlockWrite(); } }</div>
+<div class="line"><a name="l04568"></a><span class="lineno"> 4568</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l04569"></a><span class="lineno"> 4569</span>&#160;    VMA_RW_MUTEX* m_pMutex;</div>
+<div class="line"><a name="l04570"></a><span class="lineno"> 4570</span>&#160;};</div>
+<div class="line"><a name="l04571"></a><span class="lineno"> 4571</span>&#160; </div>
+<div class="line"><a name="l04572"></a><span class="lineno"> 4572</span>&#160;<span class="preprocessor">#if VMA_DEBUG_GLOBAL_MUTEX</span></div>
+<div class="line"><a name="l04573"></a><span class="lineno"> 4573</span>&#160;    <span class="keyword">static</span> VMA_MUTEX gDebugGlobalMutex;</div>
+<div class="line"><a name="l04574"></a><span class="lineno"> 4574</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex, true);</span></div>
+<div class="line"><a name="l04575"></a><span class="lineno"> 4575</span>&#160;<span class="preprocessor">#else</span></div>
+<div class="line"><a name="l04576"></a><span class="lineno"> 4576</span>&#160;<span class="preprocessor">    #define VMA_DEBUG_GLOBAL_MUTEX_LOCK</span></div>
+<div class="line"><a name="l04577"></a><span class="lineno"> 4577</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l04578"></a><span class="lineno"> 4578</span>&#160; </div>
+<div class="line"><a name="l04579"></a><span class="lineno"> 4579</span>&#160;<span class="comment">// Minimum size of a free suballocation to register it in the free suballocation collection.</span></div>
+<div class="line"><a name="l04580"></a><span class="lineno"> 4580</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> VkDeviceSize VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER = 16;</div>
+<div class="line"><a name="l04581"></a><span class="lineno"> 4581</span>&#160; </div>
+<div class="line"><a name="l04582"></a><span class="lineno"> 4582</span>&#160;<span class="comment">/*</span></div>
+<div class="line"><a name="l04583"></a><span class="lineno"> 4583</span>&#160;<span class="comment">Performs binary search and returns iterator to first element that is greater or</span></div>
+<div class="line"><a name="l04584"></a><span class="lineno"> 4584</span>&#160;<span class="comment">equal to (key), according to comparison (cmp).</span></div>
+<div class="line"><a name="l04585"></a><span class="lineno"> 4585</span>&#160;<span class="comment"></span> </div>
+<div class="line"><a name="l04586"></a><span class="lineno"> 4586</span>&#160;<span class="comment">Cmp should return true if first argument is less than second argument.</span></div>
+<div class="line"><a name="l04587"></a><span class="lineno"> 4587</span>&#160;<span class="comment"></span> </div>
+<div class="line"><a name="l04588"></a><span class="lineno"> 4588</span>&#160;<span class="comment">Returned value is the found element, if present in the collection or place where</span></div>
+<div class="line"><a name="l04589"></a><span class="lineno"> 4589</span>&#160;<span class="comment">new element with value (key) should be inserted.</span></div>
+<div class="line"><a name="l04590"></a><span class="lineno"> 4590</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l04591"></a><span class="lineno"> 4591</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> CmpLess, <span class="keyword">typename</span> IterT, <span class="keyword">typename</span> KeyT&gt;</div>
+<div class="line"><a name="l04592"></a><span class="lineno"> 4592</span>&#160;<span class="keyword">static</span> IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, <span class="keyword">const</span> KeyT &amp;key, <span class="keyword">const</span> CmpLess&amp; cmp)</div>
+<div class="line"><a name="l04593"></a><span class="lineno"> 4593</span>&#160;{</div>
+<div class="line"><a name="l04594"></a><span class="lineno"> 4594</span>&#160;    <span class="keywordtype">size_t</span> down = 0, up = (end - beg);</div>
+<div class="line"><a name="l04595"></a><span class="lineno"> 4595</span>&#160;    <span class="keywordflow">while</span>(down &lt; up)</div>
+<div class="line"><a name="l04596"></a><span class="lineno"> 4596</span>&#160;    {</div>
+<div class="line"><a name="l04597"></a><span class="lineno"> 4597</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> mid = (down + up) / 2;</div>
+<div class="line"><a name="l04598"></a><span class="lineno"> 4598</span>&#160;        <span class="keywordflow">if</span>(cmp(*(beg+mid), key))</div>
+<div class="line"><a name="l04599"></a><span class="lineno"> 4599</span>&#160;        {</div>
+<div class="line"><a name="l04600"></a><span class="lineno"> 4600</span>&#160;            down = mid + 1;</div>
+<div class="line"><a name="l04601"></a><span class="lineno"> 4601</span>&#160;        }</div>
+<div class="line"><a name="l04602"></a><span class="lineno"> 4602</span>&#160;        <span class="keywordflow">else</span></div>
+<div class="line"><a name="l04603"></a><span class="lineno"> 4603</span>&#160;        {</div>
+<div class="line"><a name="l04604"></a><span class="lineno"> 4604</span>&#160;            up = mid;</div>
+<div class="line"><a name="l04605"></a><span class="lineno"> 4605</span>&#160;        }</div>
+<div class="line"><a name="l04606"></a><span class="lineno"> 4606</span>&#160;    }</div>
+<div class="line"><a name="l04607"></a><span class="lineno"> 4607</span>&#160;    <span class="keywordflow">return</span> beg + down;</div>
+<div class="line"><a name="l04608"></a><span class="lineno"> 4608</span>&#160;}</div>
+<div class="line"><a name="l04609"></a><span class="lineno"> 4609</span>&#160; </div>
+<div class="line"><a name="l04610"></a><span class="lineno"> 4610</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> CmpLess, <span class="keyword">typename</span> IterT, <span class="keyword">typename</span> KeyT&gt;</div>
+<div class="line"><a name="l04611"></a><span class="lineno"> 4611</span>&#160;IterT VmaBinaryFindSorted(<span class="keyword">const</span> IterT&amp; beg, <span class="keyword">const</span> IterT&amp; end, <span class="keyword">const</span> KeyT&amp; value, <span class="keyword">const</span> CmpLess&amp; cmp)</div>
+<div class="line"><a name="l04612"></a><span class="lineno"> 4612</span>&#160;{</div>
+<div class="line"><a name="l04613"></a><span class="lineno"> 4613</span>&#160;    IterT it = VmaBinaryFindFirstNotLess&lt;CmpLess, IterT, KeyT&gt;(</div>
+<div class="line"><a name="l04614"></a><span class="lineno"> 4614</span>&#160;        beg, end, value, cmp);</div>
+<div class="line"><a name="l04615"></a><span class="lineno"> 4615</span>&#160;    <span class="keywordflow">if</span>(it == end ||</div>
+<div class="line"><a name="l04616"></a><span class="lineno"> 4616</span>&#160;        (!cmp(*it, value) &amp;&amp; !cmp(value, *it)))</div>
+<div class="line"><a name="l04617"></a><span class="lineno"> 4617</span>&#160;    {</div>
+<div class="line"><a name="l04618"></a><span class="lineno"> 4618</span>&#160;        <span class="keywordflow">return</span> it;</div>
+<div class="line"><a name="l04619"></a><span class="lineno"> 4619</span>&#160;    }</div>
+<div class="line"><a name="l04620"></a><span class="lineno"> 4620</span>&#160;    <span class="keywordflow">return</span> end;</div>
+<div class="line"><a name="l04621"></a><span class="lineno"> 4621</span>&#160;}</div>
+<div class="line"><a name="l04622"></a><span class="lineno"> 4622</span>&#160; </div>
+<div class="line"><a name="l04623"></a><span class="lineno"> 4623</span>&#160;<span class="comment">/*</span></div>
+<div class="line"><a name="l04624"></a><span class="lineno"> 4624</span>&#160;<span class="comment">Returns true if all pointers in the array are not-null and unique.</span></div>
+<div class="line"><a name="l04625"></a><span class="lineno"> 4625</span>&#160;<span class="comment">Warning! O(n^2) complexity. Use only inside VMA_HEAVY_ASSERT.</span></div>
+<div class="line"><a name="l04626"></a><span class="lineno"> 4626</span>&#160;<span class="comment">T must be pointer type, e.g. VmaAllocation, VmaPool.</span></div>
+<div class="line"><a name="l04627"></a><span class="lineno"> 4627</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l04628"></a><span class="lineno"> 4628</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04629"></a><span class="lineno"> 4629</span>&#160;<span class="keyword">static</span> <span class="keywordtype">bool</span> VmaValidatePointerArray(uint32_t count, <span class="keyword">const</span> T* arr)</div>
+<div class="line"><a name="l04630"></a><span class="lineno"> 4630</span>&#160;{</div>
+<div class="line"><a name="l04631"></a><span class="lineno"> 4631</span>&#160;    <span class="keywordflow">for</span>(uint32_t i = 0; i &lt; count; ++i)</div>
+<div class="line"><a name="l04632"></a><span class="lineno"> 4632</span>&#160;    {</div>
+<div class="line"><a name="l04633"></a><span class="lineno"> 4633</span>&#160;        <span class="keyword">const</span> T iPtr = arr[i];</div>
+<div class="line"><a name="l04634"></a><span class="lineno"> 4634</span>&#160;        <span class="keywordflow">if</span>(iPtr == VMA_NULL)</div>
+<div class="line"><a name="l04635"></a><span class="lineno"> 4635</span>&#160;        {</div>
+<div class="line"><a name="l04636"></a><span class="lineno"> 4636</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l04637"></a><span class="lineno"> 4637</span>&#160;        }</div>
+<div class="line"><a name="l04638"></a><span class="lineno"> 4638</span>&#160;        <span class="keywordflow">for</span>(uint32_t j = i + 1; j &lt; count; ++j)</div>
+<div class="line"><a name="l04639"></a><span class="lineno"> 4639</span>&#160;        {</div>
+<div class="line"><a name="l04640"></a><span class="lineno"> 4640</span>&#160;            <span class="keywordflow">if</span>(iPtr == arr[j])</div>
+<div class="line"><a name="l04641"></a><span class="lineno"> 4641</span>&#160;            {</div>
+<div class="line"><a name="l04642"></a><span class="lineno"> 4642</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l04643"></a><span class="lineno"> 4643</span>&#160;            }</div>
+<div class="line"><a name="l04644"></a><span class="lineno"> 4644</span>&#160;        }</div>
 <div class="line"><a name="l04645"></a><span class="lineno"> 4645</span>&#160;    }</div>
-<div class="line"><a name="l04646"></a><span class="lineno"> 4646</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l04647"></a><span class="lineno"> 4647</span>&#160;    {</div>
-<div class="line"><a name="l04648"></a><span class="lineno"> 4648</span>&#160;        result = VMA_SYSTEM_ALIGNED_MALLOC(size, alignment);</div>
-<div class="line"><a name="l04649"></a><span class="lineno"> 4649</span>&#160;    }</div>
-<div class="line"><a name="l04650"></a><span class="lineno"> 4650</span>&#160;    VMA_ASSERT(result != VMA_NULL &amp;&amp; <span class="stringliteral">&quot;CPU memory allocation failed.&quot;</span>);</div>
-<div class="line"><a name="l04651"></a><span class="lineno"> 4651</span>&#160;    <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l04652"></a><span class="lineno"> 4652</span>&#160;}</div>
-<div class="line"><a name="l04653"></a><span class="lineno"> 4653</span>&#160; </div>
-<div class="line"><a name="l04654"></a><span class="lineno"> 4654</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaFree(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, <span class="keywordtype">void</span>* ptr)</div>
-<div class="line"><a name="l04655"></a><span class="lineno"> 4655</span>&#160;{</div>
-<div class="line"><a name="l04656"></a><span class="lineno"> 4656</span>&#160;    <span class="keywordflow">if</span>((pAllocationCallbacks != VMA_NULL) &amp;&amp;</div>
-<div class="line"><a name="l04657"></a><span class="lineno"> 4657</span>&#160;        (pAllocationCallbacks-&gt;pfnFree != VMA_NULL))</div>
-<div class="line"><a name="l04658"></a><span class="lineno"> 4658</span>&#160;    {</div>
-<div class="line"><a name="l04659"></a><span class="lineno"> 4659</span>&#160;        (*pAllocationCallbacks-&gt;pfnFree)(pAllocationCallbacks-&gt;pUserData, ptr);</div>
-<div class="line"><a name="l04660"></a><span class="lineno"> 4660</span>&#160;    }</div>
-<div class="line"><a name="l04661"></a><span class="lineno"> 4661</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l04662"></a><span class="lineno"> 4662</span>&#160;    {</div>
-<div class="line"><a name="l04663"></a><span class="lineno"> 4663</span>&#160;        VMA_SYSTEM_FREE(ptr);</div>
-<div class="line"><a name="l04664"></a><span class="lineno"> 4664</span>&#160;    }</div>
-<div class="line"><a name="l04665"></a><span class="lineno"> 4665</span>&#160;}</div>
-<div class="line"><a name="l04666"></a><span class="lineno"> 4666</span>&#160; </div>
-<div class="line"><a name="l04667"></a><span class="lineno"> 4667</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04668"></a><span class="lineno"> 4668</span>&#160;<span class="keyword">static</span> T* VmaAllocate(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks)</div>
-<div class="line"><a name="l04669"></a><span class="lineno"> 4669</span>&#160;{</div>
-<div class="line"><a name="l04670"></a><span class="lineno"> 4670</span>&#160;    <span class="keywordflow">return</span> (T*)VmaMalloc(pAllocationCallbacks, <span class="keyword">sizeof</span>(T), VMA_ALIGN_OF(T));</div>
-<div class="line"><a name="l04671"></a><span class="lineno"> 4671</span>&#160;}</div>
-<div class="line"><a name="l04672"></a><span class="lineno"> 4672</span>&#160; </div>
-<div class="line"><a name="l04673"></a><span class="lineno"> 4673</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04674"></a><span class="lineno"> 4674</span>&#160;<span class="keyword">static</span> T* VmaAllocateArray(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, <span class="keywordtype">size_t</span> count)</div>
-<div class="line"><a name="l04675"></a><span class="lineno"> 4675</span>&#160;{</div>
-<div class="line"><a name="l04676"></a><span class="lineno"> 4676</span>&#160;    <span class="keywordflow">return</span> (T*)VmaMalloc(pAllocationCallbacks, <span class="keyword">sizeof</span>(T) * count, VMA_ALIGN_OF(T));</div>
+<div class="line"><a name="l04646"></a><span class="lineno"> 4646</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
+<div class="line"><a name="l04647"></a><span class="lineno"> 4647</span>&#160;}</div>
+<div class="line"><a name="l04648"></a><span class="lineno"> 4648</span>&#160; </div>
+<div class="line"><a name="l04649"></a><span class="lineno"> 4649</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MainT, <span class="keyword">typename</span> NewT&gt;</div>
+<div class="line"><a name="l04650"></a><span class="lineno"> 4650</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> VmaPnextChainPushFront(MainT* mainStruct, NewT* newStruct)</div>
+<div class="line"><a name="l04651"></a><span class="lineno"> 4651</span>&#160;{</div>
+<div class="line"><a name="l04652"></a><span class="lineno"> 4652</span>&#160;    newStruct-&gt;pNext = mainStruct-&gt;pNext;</div>
+<div class="line"><a name="l04653"></a><span class="lineno"> 4653</span>&#160;    mainStruct-&gt;pNext = newStruct;</div>
+<div class="line"><a name="l04654"></a><span class="lineno"> 4654</span>&#160;}</div>
+<div class="line"><a name="l04655"></a><span class="lineno"> 4655</span>&#160; </div>
+<div class="line"><a name="l04657"></a><span class="lineno"> 4657</span>&#160;<span class="comment">// Memory allocation</span></div>
+<div class="line"><a name="l04658"></a><span class="lineno"> 4658</span>&#160; </div>
+<div class="line"><a name="l04659"></a><span class="lineno"> 4659</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span>* VmaMalloc(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, <span class="keywordtype">size_t</span> size, <span class="keywordtype">size_t</span> alignment)</div>
+<div class="line"><a name="l04660"></a><span class="lineno"> 4660</span>&#160;{</div>
+<div class="line"><a name="l04661"></a><span class="lineno"> 4661</span>&#160;    <span class="keywordtype">void</span>* result = VMA_NULL;</div>
+<div class="line"><a name="l04662"></a><span class="lineno"> 4662</span>&#160;    <span class="keywordflow">if</span>((pAllocationCallbacks != VMA_NULL) &amp;&amp;</div>
+<div class="line"><a name="l04663"></a><span class="lineno"> 4663</span>&#160;        (pAllocationCallbacks-&gt;pfnAllocation != VMA_NULL))</div>
+<div class="line"><a name="l04664"></a><span class="lineno"> 4664</span>&#160;    {</div>
+<div class="line"><a name="l04665"></a><span class="lineno"> 4665</span>&#160;        result = (*pAllocationCallbacks-&gt;pfnAllocation)(</div>
+<div class="line"><a name="l04666"></a><span class="lineno"> 4666</span>&#160;            pAllocationCallbacks-&gt;pUserData,</div>
+<div class="line"><a name="l04667"></a><span class="lineno"> 4667</span>&#160;            size,</div>
+<div class="line"><a name="l04668"></a><span class="lineno"> 4668</span>&#160;            alignment,</div>
+<div class="line"><a name="l04669"></a><span class="lineno"> 4669</span>&#160;            VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);</div>
+<div class="line"><a name="l04670"></a><span class="lineno"> 4670</span>&#160;    }</div>
+<div class="line"><a name="l04671"></a><span class="lineno"> 4671</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l04672"></a><span class="lineno"> 4672</span>&#160;    {</div>
+<div class="line"><a name="l04673"></a><span class="lineno"> 4673</span>&#160;        result = VMA_SYSTEM_ALIGNED_MALLOC(size, alignment);</div>
+<div class="line"><a name="l04674"></a><span class="lineno"> 4674</span>&#160;    }</div>
+<div class="line"><a name="l04675"></a><span class="lineno"> 4675</span>&#160;    VMA_ASSERT(result != VMA_NULL &amp;&amp; <span class="stringliteral">&quot;CPU memory allocation failed.&quot;</span>);</div>
+<div class="line"><a name="l04676"></a><span class="lineno"> 4676</span>&#160;    <span class="keywordflow">return</span> result;</div>
 <div class="line"><a name="l04677"></a><span class="lineno"> 4677</span>&#160;}</div>
 <div class="line"><a name="l04678"></a><span class="lineno"> 4678</span>&#160; </div>
-<div class="line"><a name="l04679"></a><span class="lineno"> 4679</span>&#160;<span class="preprocessor">#define vma_new(allocator, type)   new(VmaAllocate&lt;type&gt;(allocator))(type)</span></div>
-<div class="line"><a name="l04680"></a><span class="lineno"> 4680</span>&#160; </div>
-<div class="line"><a name="l04681"></a><span class="lineno"> 4681</span>&#160;<span class="preprocessor">#define vma_new_array(allocator, type, count)   new(VmaAllocateArray&lt;type&gt;((allocator), (count)))(type)</span></div>
-<div class="line"><a name="l04682"></a><span class="lineno"> 4682</span>&#160; </div>
-<div class="line"><a name="l04683"></a><span class="lineno"> 4683</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04684"></a><span class="lineno"> 4684</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> vma_delete(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, T* ptr)</div>
-<div class="line"><a name="l04685"></a><span class="lineno"> 4685</span>&#160;{</div>
-<div class="line"><a name="l04686"></a><span class="lineno"> 4686</span>&#160;    ptr-&gt;~T();</div>
-<div class="line"><a name="l04687"></a><span class="lineno"> 4687</span>&#160;    VmaFree(pAllocationCallbacks, ptr);</div>
-<div class="line"><a name="l04688"></a><span class="lineno"> 4688</span>&#160;}</div>
-<div class="line"><a name="l04689"></a><span class="lineno"> 4689</span>&#160; </div>
-<div class="line"><a name="l04690"></a><span class="lineno"> 4690</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04691"></a><span class="lineno"> 4691</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> vma_delete_array(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, T* ptr, <span class="keywordtype">size_t</span> count)</div>
-<div class="line"><a name="l04692"></a><span class="lineno"> 4692</span>&#160;{</div>
-<div class="line"><a name="l04693"></a><span class="lineno"> 4693</span>&#160;    <span class="keywordflow">if</span>(ptr != VMA_NULL)</div>
-<div class="line"><a name="l04694"></a><span class="lineno"> 4694</span>&#160;    {</div>
-<div class="line"><a name="l04695"></a><span class="lineno"> 4695</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = count; i--; )</div>
-<div class="line"><a name="l04696"></a><span class="lineno"> 4696</span>&#160;        {</div>
-<div class="line"><a name="l04697"></a><span class="lineno"> 4697</span>&#160;            ptr[i].~T();</div>
-<div class="line"><a name="l04698"></a><span class="lineno"> 4698</span>&#160;        }</div>
-<div class="line"><a name="l04699"></a><span class="lineno"> 4699</span>&#160;        VmaFree(pAllocationCallbacks, ptr);</div>
-<div class="line"><a name="l04700"></a><span class="lineno"> 4700</span>&#160;    }</div>
-<div class="line"><a name="l04701"></a><span class="lineno"> 4701</span>&#160;}</div>
-<div class="line"><a name="l04702"></a><span class="lineno"> 4702</span>&#160; </div>
-<div class="line"><a name="l04703"></a><span class="lineno"> 4703</span>&#160;<span class="keyword">static</span> <span class="keywordtype">char</span>* VmaCreateStringCopy(<span class="keyword">const</span> VkAllocationCallbacks* allocs, <span class="keyword">const</span> <span class="keywordtype">char</span>* srcStr)</div>
-<div class="line"><a name="l04704"></a><span class="lineno"> 4704</span>&#160;{</div>
-<div class="line"><a name="l04705"></a><span class="lineno"> 4705</span>&#160;    <span class="keywordflow">if</span>(srcStr != VMA_NULL)</div>
-<div class="line"><a name="l04706"></a><span class="lineno"> 4706</span>&#160;    {</div>
-<div class="line"><a name="l04707"></a><span class="lineno"> 4707</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> len = strlen(srcStr);</div>
-<div class="line"><a name="l04708"></a><span class="lineno"> 4708</span>&#160;        <span class="keywordtype">char</span>* <span class="keyword">const</span> result = vma_new_array(allocs, <span class="keywordtype">char</span>, len + 1);</div>
-<div class="line"><a name="l04709"></a><span class="lineno"> 4709</span>&#160;        memcpy(result, srcStr, len + 1);</div>
-<div class="line"><a name="l04710"></a><span class="lineno"> 4710</span>&#160;        <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l04711"></a><span class="lineno"> 4711</span>&#160;    }</div>
-<div class="line"><a name="l04712"></a><span class="lineno"> 4712</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l04713"></a><span class="lineno"> 4713</span>&#160;    {</div>
-<div class="line"><a name="l04714"></a><span class="lineno"> 4714</span>&#160;        <span class="keywordflow">return</span> VMA_NULL;</div>
-<div class="line"><a name="l04715"></a><span class="lineno"> 4715</span>&#160;    }</div>
-<div class="line"><a name="l04716"></a><span class="lineno"> 4716</span>&#160;}</div>
-<div class="line"><a name="l04717"></a><span class="lineno"> 4717</span>&#160; </div>
-<div class="line"><a name="l04718"></a><span class="lineno"> 4718</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaFreeString(<span class="keyword">const</span> VkAllocationCallbacks* allocs, <span class="keywordtype">char</span>* str)</div>
-<div class="line"><a name="l04719"></a><span class="lineno"> 4719</span>&#160;{</div>
-<div class="line"><a name="l04720"></a><span class="lineno"> 4720</span>&#160;    <span class="keywordflow">if</span>(str != VMA_NULL)</div>
-<div class="line"><a name="l04721"></a><span class="lineno"> 4721</span>&#160;    {</div>
-<div class="line"><a name="l04722"></a><span class="lineno"> 4722</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> len = strlen(str);</div>
-<div class="line"><a name="l04723"></a><span class="lineno"> 4723</span>&#160;        vma_delete_array(allocs, str, len + 1);</div>
-<div class="line"><a name="l04724"></a><span class="lineno"> 4724</span>&#160;    }</div>
-<div class="line"><a name="l04725"></a><span class="lineno"> 4725</span>&#160;}</div>
-<div class="line"><a name="l04726"></a><span class="lineno"> 4726</span>&#160; </div>
-<div class="line"><a name="l04727"></a><span class="lineno"> 4727</span>&#160;<span class="comment">// STL-compatible allocator.</span></div>
-<div class="line"><a name="l04728"></a><span class="lineno"> 4728</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l04729"></a><span class="lineno"> 4729</span>&#160;<span class="keyword">class </span>VmaStlAllocator</div>
-<div class="line"><a name="l04730"></a><span class="lineno"> 4730</span>&#160;{</div>
-<div class="line"><a name="l04731"></a><span class="lineno"> 4731</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l04732"></a><span class="lineno"> 4732</span>&#160;    <span class="keyword">const</span> VkAllocationCallbacks* <span class="keyword">const</span> m_pCallbacks;</div>
-<div class="line"><a name="l04733"></a><span class="lineno"> 4733</span>&#160;    <span class="keyword">typedef</span> T value_type;</div>
-<div class="line"><a name="l04734"></a><span class="lineno"> 4734</span>&#160;    </div>
-<div class="line"><a name="l04735"></a><span class="lineno"> 4735</span>&#160;    VmaStlAllocator(<span class="keyword">const</span> VkAllocationCallbacks* pCallbacks) : m_pCallbacks(pCallbacks) { }</div>
-<div class="line"><a name="l04736"></a><span class="lineno"> 4736</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> U&gt; VmaStlAllocator(<span class="keyword">const</span> VmaStlAllocator&lt;U&gt;&amp; src) : m_pCallbacks(src.m_pCallbacks) { }</div>
-<div class="line"><a name="l04737"></a><span class="lineno"> 4737</span>&#160; </div>
-<div class="line"><a name="l04738"></a><span class="lineno"> 4738</span>&#160;    T* allocate(<span class="keywordtype">size_t</span> n) { <span class="keywordflow">return</span> VmaAllocateArray&lt;T&gt;(m_pCallbacks, n); }</div>
-<div class="line"><a name="l04739"></a><span class="lineno"> 4739</span>&#160;    <span class="keywordtype">void</span> deallocate(T* p, <span class="keywordtype">size_t</span> n) { VmaFree(m_pCallbacks, p); }</div>
-<div class="line"><a name="l04740"></a><span class="lineno"> 4740</span>&#160; </div>
-<div class="line"><a name="l04741"></a><span class="lineno"> 4741</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> U&gt;</div>
-<div class="line"><a name="l04742"></a><span class="lineno"> 4742</span>&#160;    <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> VmaStlAllocator&lt;U&gt;&amp; rhs)<span class="keyword"> const</span></div>
-<div class="line"><a name="l04743"></a><span class="lineno"> 4743</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l04744"></a><span class="lineno"> 4744</span>&#160;        <span class="keywordflow">return</span> m_pCallbacks == rhs.m_pCallbacks;</div>
-<div class="line"><a name="l04745"></a><span class="lineno"> 4745</span>&#160;    }</div>
-<div class="line"><a name="l04746"></a><span class="lineno"> 4746</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> U&gt;</div>
-<div class="line"><a name="l04747"></a><span class="lineno"> 4747</span>&#160;    <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> VmaStlAllocator&lt;U&gt;&amp; rhs)<span class="keyword"> const</span></div>
-<div class="line"><a name="l04748"></a><span class="lineno"> 4748</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l04749"></a><span class="lineno"> 4749</span>&#160;        <span class="keywordflow">return</span> m_pCallbacks != rhs.m_pCallbacks;</div>
-<div class="line"><a name="l04750"></a><span class="lineno"> 4750</span>&#160;    }</div>
+<div class="line"><a name="l04679"></a><span class="lineno"> 4679</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaFree(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, <span class="keywordtype">void</span>* ptr)</div>
+<div class="line"><a name="l04680"></a><span class="lineno"> 4680</span>&#160;{</div>
+<div class="line"><a name="l04681"></a><span class="lineno"> 4681</span>&#160;    <span class="keywordflow">if</span>((pAllocationCallbacks != VMA_NULL) &amp;&amp;</div>
+<div class="line"><a name="l04682"></a><span class="lineno"> 4682</span>&#160;        (pAllocationCallbacks-&gt;pfnFree != VMA_NULL))</div>
+<div class="line"><a name="l04683"></a><span class="lineno"> 4683</span>&#160;    {</div>
+<div class="line"><a name="l04684"></a><span class="lineno"> 4684</span>&#160;        (*pAllocationCallbacks-&gt;pfnFree)(pAllocationCallbacks-&gt;pUserData, ptr);</div>
+<div class="line"><a name="l04685"></a><span class="lineno"> 4685</span>&#160;    }</div>
+<div class="line"><a name="l04686"></a><span class="lineno"> 4686</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l04687"></a><span class="lineno"> 4687</span>&#160;    {</div>
+<div class="line"><a name="l04688"></a><span class="lineno"> 4688</span>&#160;        VMA_SYSTEM_FREE(ptr);</div>
+<div class="line"><a name="l04689"></a><span class="lineno"> 4689</span>&#160;    }</div>
+<div class="line"><a name="l04690"></a><span class="lineno"> 4690</span>&#160;}</div>
+<div class="line"><a name="l04691"></a><span class="lineno"> 4691</span>&#160; </div>
+<div class="line"><a name="l04692"></a><span class="lineno"> 4692</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04693"></a><span class="lineno"> 4693</span>&#160;<span class="keyword">static</span> T* VmaAllocate(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks)</div>
+<div class="line"><a name="l04694"></a><span class="lineno"> 4694</span>&#160;{</div>
+<div class="line"><a name="l04695"></a><span class="lineno"> 4695</span>&#160;    <span class="keywordflow">return</span> (T*)VmaMalloc(pAllocationCallbacks, <span class="keyword">sizeof</span>(T), VMA_ALIGN_OF(T));</div>
+<div class="line"><a name="l04696"></a><span class="lineno"> 4696</span>&#160;}</div>
+<div class="line"><a name="l04697"></a><span class="lineno"> 4697</span>&#160; </div>
+<div class="line"><a name="l04698"></a><span class="lineno"> 4698</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04699"></a><span class="lineno"> 4699</span>&#160;<span class="keyword">static</span> T* VmaAllocateArray(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, <span class="keywordtype">size_t</span> count)</div>
+<div class="line"><a name="l04700"></a><span class="lineno"> 4700</span>&#160;{</div>
+<div class="line"><a name="l04701"></a><span class="lineno"> 4701</span>&#160;    <span class="keywordflow">return</span> (T*)VmaMalloc(pAllocationCallbacks, <span class="keyword">sizeof</span>(T) * count, VMA_ALIGN_OF(T));</div>
+<div class="line"><a name="l04702"></a><span class="lineno"> 4702</span>&#160;}</div>
+<div class="line"><a name="l04703"></a><span class="lineno"> 4703</span>&#160; </div>
+<div class="line"><a name="l04704"></a><span class="lineno"> 4704</span>&#160;<span class="preprocessor">#define vma_new(allocator, type)   new(VmaAllocate&lt;type&gt;(allocator))(type)</span></div>
+<div class="line"><a name="l04705"></a><span class="lineno"> 4705</span>&#160; </div>
+<div class="line"><a name="l04706"></a><span class="lineno"> 4706</span>&#160;<span class="preprocessor">#define vma_new_array(allocator, type, count)   new(VmaAllocateArray&lt;type&gt;((allocator), (count)))(type)</span></div>
+<div class="line"><a name="l04707"></a><span class="lineno"> 4707</span>&#160; </div>
+<div class="line"><a name="l04708"></a><span class="lineno"> 4708</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04709"></a><span class="lineno"> 4709</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> vma_delete(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, T* ptr)</div>
+<div class="line"><a name="l04710"></a><span class="lineno"> 4710</span>&#160;{</div>
+<div class="line"><a name="l04711"></a><span class="lineno"> 4711</span>&#160;    ptr-&gt;~T();</div>
+<div class="line"><a name="l04712"></a><span class="lineno"> 4712</span>&#160;    VmaFree(pAllocationCallbacks, ptr);</div>
+<div class="line"><a name="l04713"></a><span class="lineno"> 4713</span>&#160;}</div>
+<div class="line"><a name="l04714"></a><span class="lineno"> 4714</span>&#160; </div>
+<div class="line"><a name="l04715"></a><span class="lineno"> 4715</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04716"></a><span class="lineno"> 4716</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> vma_delete_array(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, T* ptr, <span class="keywordtype">size_t</span> count)</div>
+<div class="line"><a name="l04717"></a><span class="lineno"> 4717</span>&#160;{</div>
+<div class="line"><a name="l04718"></a><span class="lineno"> 4718</span>&#160;    <span class="keywordflow">if</span>(ptr != VMA_NULL)</div>
+<div class="line"><a name="l04719"></a><span class="lineno"> 4719</span>&#160;    {</div>
+<div class="line"><a name="l04720"></a><span class="lineno"> 4720</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = count; i--; )</div>
+<div class="line"><a name="l04721"></a><span class="lineno"> 4721</span>&#160;        {</div>
+<div class="line"><a name="l04722"></a><span class="lineno"> 4722</span>&#160;            ptr[i].~T();</div>
+<div class="line"><a name="l04723"></a><span class="lineno"> 4723</span>&#160;        }</div>
+<div class="line"><a name="l04724"></a><span class="lineno"> 4724</span>&#160;        VmaFree(pAllocationCallbacks, ptr);</div>
+<div class="line"><a name="l04725"></a><span class="lineno"> 4725</span>&#160;    }</div>
+<div class="line"><a name="l04726"></a><span class="lineno"> 4726</span>&#160;}</div>
+<div class="line"><a name="l04727"></a><span class="lineno"> 4727</span>&#160; </div>
+<div class="line"><a name="l04728"></a><span class="lineno"> 4728</span>&#160;<span class="keyword">static</span> <span class="keywordtype">char</span>* VmaCreateStringCopy(<span class="keyword">const</span> VkAllocationCallbacks* allocs, <span class="keyword">const</span> <span class="keywordtype">char</span>* srcStr)</div>
+<div class="line"><a name="l04729"></a><span class="lineno"> 4729</span>&#160;{</div>
+<div class="line"><a name="l04730"></a><span class="lineno"> 4730</span>&#160;    <span class="keywordflow">if</span>(srcStr != VMA_NULL)</div>
+<div class="line"><a name="l04731"></a><span class="lineno"> 4731</span>&#160;    {</div>
+<div class="line"><a name="l04732"></a><span class="lineno"> 4732</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> len = strlen(srcStr);</div>
+<div class="line"><a name="l04733"></a><span class="lineno"> 4733</span>&#160;        <span class="keywordtype">char</span>* <span class="keyword">const</span> result = vma_new_array(allocs, <span class="keywordtype">char</span>, len + 1);</div>
+<div class="line"><a name="l04734"></a><span class="lineno"> 4734</span>&#160;        memcpy(result, srcStr, len + 1);</div>
+<div class="line"><a name="l04735"></a><span class="lineno"> 4735</span>&#160;        <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l04736"></a><span class="lineno"> 4736</span>&#160;    }</div>
+<div class="line"><a name="l04737"></a><span class="lineno"> 4737</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l04738"></a><span class="lineno"> 4738</span>&#160;    {</div>
+<div class="line"><a name="l04739"></a><span class="lineno"> 4739</span>&#160;        <span class="keywordflow">return</span> VMA_NULL;</div>
+<div class="line"><a name="l04740"></a><span class="lineno"> 4740</span>&#160;    }</div>
+<div class="line"><a name="l04741"></a><span class="lineno"> 4741</span>&#160;}</div>
+<div class="line"><a name="l04742"></a><span class="lineno"> 4742</span>&#160; </div>
+<div class="line"><a name="l04743"></a><span class="lineno"> 4743</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaFreeString(<span class="keyword">const</span> VkAllocationCallbacks* allocs, <span class="keywordtype">char</span>* str)</div>
+<div class="line"><a name="l04744"></a><span class="lineno"> 4744</span>&#160;{</div>
+<div class="line"><a name="l04745"></a><span class="lineno"> 4745</span>&#160;    <span class="keywordflow">if</span>(str != VMA_NULL)</div>
+<div class="line"><a name="l04746"></a><span class="lineno"> 4746</span>&#160;    {</div>
+<div class="line"><a name="l04747"></a><span class="lineno"> 4747</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> len = strlen(str);</div>
+<div class="line"><a name="l04748"></a><span class="lineno"> 4748</span>&#160;        vma_delete_array(allocs, str, len + 1);</div>
+<div class="line"><a name="l04749"></a><span class="lineno"> 4749</span>&#160;    }</div>
+<div class="line"><a name="l04750"></a><span class="lineno"> 4750</span>&#160;}</div>
 <div class="line"><a name="l04751"></a><span class="lineno"> 4751</span>&#160; </div>
-<div class="line"><a name="l04752"></a><span class="lineno"> 4752</span>&#160;    VmaStlAllocator&amp; operator=(<span class="keyword">const</span> VmaStlAllocator&amp; x) = <span class="keyword">delete</span>;</div>
-<div class="line"><a name="l04753"></a><span class="lineno"> 4753</span>&#160;};</div>
-<div class="line"><a name="l04754"></a><span class="lineno"> 4754</span>&#160; </div>
-<div class="line"><a name="l04755"></a><span class="lineno"> 4755</span>&#160;<span class="preprocessor">#if VMA_USE_STL_VECTOR</span></div>
-<div class="line"><a name="l04756"></a><span class="lineno"> 4756</span>&#160; </div>
-<div class="line"><a name="l04757"></a><span class="lineno"> 4757</span>&#160;<span class="preprocessor">#define VmaVector std::vector</span></div>
-<div class="line"><a name="l04758"></a><span class="lineno"> 4758</span>&#160; </div>
-<div class="line"><a name="l04759"></a><span class="lineno"> 4759</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> allocatorT&gt;</div>
-<div class="line"><a name="l04760"></a><span class="lineno"> 4760</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaVectorInsert(std::vector&lt;T, allocatorT&gt;&amp; vec, <span class="keywordtype">size_t</span> index, <span class="keyword">const</span> T&amp; item)</div>
-<div class="line"><a name="l04761"></a><span class="lineno"> 4761</span>&#160;{</div>
-<div class="line"><a name="l04762"></a><span class="lineno"> 4762</span>&#160;    vec.insert(vec.begin() + index, item);</div>
-<div class="line"><a name="l04763"></a><span class="lineno"> 4763</span>&#160;}</div>
-<div class="line"><a name="l04764"></a><span class="lineno"> 4764</span>&#160; </div>
-<div class="line"><a name="l04765"></a><span class="lineno"> 4765</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> allocatorT&gt;</div>
-<div class="line"><a name="l04766"></a><span class="lineno"> 4766</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaVectorRemove(std::vector&lt;T, allocatorT&gt;&amp; vec, <span class="keywordtype">size_t</span> index)</div>
-<div class="line"><a name="l04767"></a><span class="lineno"> 4767</span>&#160;{</div>
-<div class="line"><a name="l04768"></a><span class="lineno"> 4768</span>&#160;    vec.erase(vec.begin() + index);</div>
-<div class="line"><a name="l04769"></a><span class="lineno"> 4769</span>&#160;}</div>
-<div class="line"><a name="l04770"></a><span class="lineno"> 4770</span>&#160; </div>
-<div class="line"><a name="l04771"></a><span class="lineno"> 4771</span>&#160;<span class="preprocessor">#else // #if VMA_USE_STL_VECTOR</span></div>
-<div class="line"><a name="l04772"></a><span class="lineno"> 4772</span>&#160; </div>
-<div class="line"><a name="l04773"></a><span class="lineno"> 4773</span>&#160;<span class="comment">/* Class with interface compatible with subset of std::vector.</span></div>
-<div class="line"><a name="l04774"></a><span class="lineno"> 4774</span>&#160;<span class="comment">T must be POD because constructors and destructors are not called and memcpy is</span></div>
-<div class="line"><a name="l04775"></a><span class="lineno"> 4775</span>&#160;<span class="comment">used for these objects. */</span></div>
-<div class="line"><a name="l04776"></a><span class="lineno"> 4776</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> AllocatorT&gt;</div>
-<div class="line"><a name="l04777"></a><span class="lineno"> 4777</span>&#160;<span class="keyword">class </span>VmaVector</div>
-<div class="line"><a name="l04778"></a><span class="lineno"> 4778</span>&#160;{</div>
-<div class="line"><a name="l04779"></a><span class="lineno"> 4779</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l04780"></a><span class="lineno"> 4780</span>&#160;    <span class="keyword">typedef</span> T value_type;</div>
+<div class="line"><a name="l04752"></a><span class="lineno"> 4752</span>&#160;<span class="comment">// STL-compatible allocator.</span></div>
+<div class="line"><a name="l04753"></a><span class="lineno"> 4753</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l04754"></a><span class="lineno"> 4754</span>&#160;<span class="keyword">class </span>VmaStlAllocator</div>
+<div class="line"><a name="l04755"></a><span class="lineno"> 4755</span>&#160;{</div>
+<div class="line"><a name="l04756"></a><span class="lineno"> 4756</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l04757"></a><span class="lineno"> 4757</span>&#160;    <span class="keyword">const</span> VkAllocationCallbacks* <span class="keyword">const</span> m_pCallbacks;</div>
+<div class="line"><a name="l04758"></a><span class="lineno"> 4758</span>&#160;    <span class="keyword">typedef</span> T value_type;</div>
+<div class="line"><a name="l04759"></a><span class="lineno"> 4759</span>&#160;    </div>
+<div class="line"><a name="l04760"></a><span class="lineno"> 4760</span>&#160;    VmaStlAllocator(<span class="keyword">const</span> VkAllocationCallbacks* pCallbacks) : m_pCallbacks(pCallbacks) { }</div>
+<div class="line"><a name="l04761"></a><span class="lineno"> 4761</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> U&gt; VmaStlAllocator(<span class="keyword">const</span> VmaStlAllocator&lt;U&gt;&amp; src) : m_pCallbacks(src.m_pCallbacks) { }</div>
+<div class="line"><a name="l04762"></a><span class="lineno"> 4762</span>&#160; </div>
+<div class="line"><a name="l04763"></a><span class="lineno"> 4763</span>&#160;    T* allocate(<span class="keywordtype">size_t</span> n) { <span class="keywordflow">return</span> VmaAllocateArray&lt;T&gt;(m_pCallbacks, n); }</div>
+<div class="line"><a name="l04764"></a><span class="lineno"> 4764</span>&#160;    <span class="keywordtype">void</span> deallocate(T* p, <span class="keywordtype">size_t</span> n) { VmaFree(m_pCallbacks, p); }</div>
+<div class="line"><a name="l04765"></a><span class="lineno"> 4765</span>&#160; </div>
+<div class="line"><a name="l04766"></a><span class="lineno"> 4766</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> U&gt;</div>
+<div class="line"><a name="l04767"></a><span class="lineno"> 4767</span>&#160;    <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> VmaStlAllocator&lt;U&gt;&amp; rhs)<span class="keyword"> const</span></div>
+<div class="line"><a name="l04768"></a><span class="lineno"> 4768</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l04769"></a><span class="lineno"> 4769</span>&#160;        <span class="keywordflow">return</span> m_pCallbacks == rhs.m_pCallbacks;</div>
+<div class="line"><a name="l04770"></a><span class="lineno"> 4770</span>&#160;    }</div>
+<div class="line"><a name="l04771"></a><span class="lineno"> 4771</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> U&gt;</div>
+<div class="line"><a name="l04772"></a><span class="lineno"> 4772</span>&#160;    <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> VmaStlAllocator&lt;U&gt;&amp; rhs)<span class="keyword"> const</span></div>
+<div class="line"><a name="l04773"></a><span class="lineno"> 4773</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l04774"></a><span class="lineno"> 4774</span>&#160;        <span class="keywordflow">return</span> m_pCallbacks != rhs.m_pCallbacks;</div>
+<div class="line"><a name="l04775"></a><span class="lineno"> 4775</span>&#160;    }</div>
+<div class="line"><a name="l04776"></a><span class="lineno"> 4776</span>&#160; </div>
+<div class="line"><a name="l04777"></a><span class="lineno"> 4777</span>&#160;    VmaStlAllocator&amp; operator=(<span class="keyword">const</span> VmaStlAllocator&amp; x) = <span class="keyword">delete</span>;</div>
+<div class="line"><a name="l04778"></a><span class="lineno"> 4778</span>&#160;};</div>
+<div class="line"><a name="l04779"></a><span class="lineno"> 4779</span>&#160; </div>
+<div class="line"><a name="l04780"></a><span class="lineno"> 4780</span>&#160;<span class="preprocessor">#if VMA_USE_STL_VECTOR</span></div>
 <div class="line"><a name="l04781"></a><span class="lineno"> 4781</span>&#160; </div>
-<div class="line"><a name="l04782"></a><span class="lineno"> 4782</span>&#160;    VmaVector(<span class="keyword">const</span> AllocatorT&amp; allocator) :</div>
-<div class="line"><a name="l04783"></a><span class="lineno"> 4783</span>&#160;        m_Allocator(allocator),</div>
-<div class="line"><a name="l04784"></a><span class="lineno"> 4784</span>&#160;        m_pArray(VMA_NULL),</div>
-<div class="line"><a name="l04785"></a><span class="lineno"> 4785</span>&#160;        m_Count(0),</div>
-<div class="line"><a name="l04786"></a><span class="lineno"> 4786</span>&#160;        m_Capacity(0)</div>
-<div class="line"><a name="l04787"></a><span class="lineno"> 4787</span>&#160;    {</div>
-<div class="line"><a name="l04788"></a><span class="lineno"> 4788</span>&#160;    }</div>
+<div class="line"><a name="l04782"></a><span class="lineno"> 4782</span>&#160;<span class="preprocessor">#define VmaVector std::vector</span></div>
+<div class="line"><a name="l04783"></a><span class="lineno"> 4783</span>&#160; </div>
+<div class="line"><a name="l04784"></a><span class="lineno"> 4784</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> allocatorT&gt;</div>
+<div class="line"><a name="l04785"></a><span class="lineno"> 4785</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaVectorInsert(std::vector&lt;T, allocatorT&gt;&amp; vec, <span class="keywordtype">size_t</span> index, <span class="keyword">const</span> T&amp; item)</div>
+<div class="line"><a name="l04786"></a><span class="lineno"> 4786</span>&#160;{</div>
+<div class="line"><a name="l04787"></a><span class="lineno"> 4787</span>&#160;    vec.insert(vec.begin() + index, item);</div>
+<div class="line"><a name="l04788"></a><span class="lineno"> 4788</span>&#160;}</div>
 <div class="line"><a name="l04789"></a><span class="lineno"> 4789</span>&#160; </div>
-<div class="line"><a name="l04790"></a><span class="lineno"> 4790</span>&#160;    VmaVector(<span class="keywordtype">size_t</span> count, <span class="keyword">const</span> AllocatorT&amp; allocator) :</div>
-<div class="line"><a name="l04791"></a><span class="lineno"> 4791</span>&#160;        m_Allocator(allocator),</div>
-<div class="line"><a name="l04792"></a><span class="lineno"> 4792</span>&#160;        m_pArray(count ? (T*)VmaAllocateArray&lt;T&gt;(allocator.m_pCallbacks, count) : VMA_NULL),</div>
-<div class="line"><a name="l04793"></a><span class="lineno"> 4793</span>&#160;        m_Count(count),</div>
-<div class="line"><a name="l04794"></a><span class="lineno"> 4794</span>&#160;        m_Capacity(count)</div>
-<div class="line"><a name="l04795"></a><span class="lineno"> 4795</span>&#160;    {</div>
-<div class="line"><a name="l04796"></a><span class="lineno"> 4796</span>&#160;    }</div>
-<div class="line"><a name="l04797"></a><span class="lineno"> 4797</span>&#160;    </div>
-<div class="line"><a name="l04798"></a><span class="lineno"> 4798</span>&#160;    <span class="comment">// This version of the constructor is here for compatibility with pre-C++14 std::vector.</span></div>
-<div class="line"><a name="l04799"></a><span class="lineno"> 4799</span>&#160;    <span class="comment">// value is unused.</span></div>
-<div class="line"><a name="l04800"></a><span class="lineno"> 4800</span>&#160;    VmaVector(<span class="keywordtype">size_t</span> count, <span class="keyword">const</span> T&amp; value, <span class="keyword">const</span> AllocatorT&amp; allocator)</div>
-<div class="line"><a name="l04801"></a><span class="lineno"> 4801</span>&#160;        : VmaVector(count, allocator) {}</div>
-<div class="line"><a name="l04802"></a><span class="lineno"> 4802</span>&#160;    </div>
-<div class="line"><a name="l04803"></a><span class="lineno"> 4803</span>&#160;    VmaVector(<span class="keyword">const</span> VmaVector&lt;T, AllocatorT&gt;&amp; src) :</div>
-<div class="line"><a name="l04804"></a><span class="lineno"> 4804</span>&#160;        m_Allocator(src.m_Allocator),</div>
-<div class="line"><a name="l04805"></a><span class="lineno"> 4805</span>&#160;        m_pArray(src.m_Count ? (T*)VmaAllocateArray&lt;T&gt;(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),</div>
-<div class="line"><a name="l04806"></a><span class="lineno"> 4806</span>&#160;        m_Count(src.m_Count),</div>
-<div class="line"><a name="l04807"></a><span class="lineno"> 4807</span>&#160;        m_Capacity(src.m_Count)</div>
-<div class="line"><a name="l04808"></a><span class="lineno"> 4808</span>&#160;    {</div>
-<div class="line"><a name="l04809"></a><span class="lineno"> 4809</span>&#160;        <span class="keywordflow">if</span>(m_Count != 0)</div>
-<div class="line"><a name="l04810"></a><span class="lineno"> 4810</span>&#160;        {</div>
-<div class="line"><a name="l04811"></a><span class="lineno"> 4811</span>&#160;            memcpy(m_pArray, src.m_pArray, m_Count * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l04812"></a><span class="lineno"> 4812</span>&#160;        }</div>
+<div class="line"><a name="l04790"></a><span class="lineno"> 4790</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> allocatorT&gt;</div>
+<div class="line"><a name="l04791"></a><span class="lineno"> 4791</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaVectorRemove(std::vector&lt;T, allocatorT&gt;&amp; vec, <span class="keywordtype">size_t</span> index)</div>
+<div class="line"><a name="l04792"></a><span class="lineno"> 4792</span>&#160;{</div>
+<div class="line"><a name="l04793"></a><span class="lineno"> 4793</span>&#160;    vec.erase(vec.begin() + index);</div>
+<div class="line"><a name="l04794"></a><span class="lineno"> 4794</span>&#160;}</div>
+<div class="line"><a name="l04795"></a><span class="lineno"> 4795</span>&#160; </div>
+<div class="line"><a name="l04796"></a><span class="lineno"> 4796</span>&#160;<span class="preprocessor">#else // #if VMA_USE_STL_VECTOR</span></div>
+<div class="line"><a name="l04797"></a><span class="lineno"> 4797</span>&#160; </div>
+<div class="line"><a name="l04798"></a><span class="lineno"> 4798</span>&#160;<span class="comment">/* Class with interface compatible with subset of std::vector.</span></div>
+<div class="line"><a name="l04799"></a><span class="lineno"> 4799</span>&#160;<span class="comment">T must be POD because constructors and destructors are not called and memcpy is</span></div>
+<div class="line"><a name="l04800"></a><span class="lineno"> 4800</span>&#160;<span class="comment">used for these objects. */</span></div>
+<div class="line"><a name="l04801"></a><span class="lineno"> 4801</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> AllocatorT&gt;</div>
+<div class="line"><a name="l04802"></a><span class="lineno"> 4802</span>&#160;<span class="keyword">class </span>VmaVector</div>
+<div class="line"><a name="l04803"></a><span class="lineno"> 4803</span>&#160;{</div>
+<div class="line"><a name="l04804"></a><span class="lineno"> 4804</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l04805"></a><span class="lineno"> 4805</span>&#160;    <span class="keyword">typedef</span> T value_type;</div>
+<div class="line"><a name="l04806"></a><span class="lineno"> 4806</span>&#160; </div>
+<div class="line"><a name="l04807"></a><span class="lineno"> 4807</span>&#160;    VmaVector(<span class="keyword">const</span> AllocatorT&amp; allocator) :</div>
+<div class="line"><a name="l04808"></a><span class="lineno"> 4808</span>&#160;        m_Allocator(allocator),</div>
+<div class="line"><a name="l04809"></a><span class="lineno"> 4809</span>&#160;        m_pArray(VMA_NULL),</div>
+<div class="line"><a name="l04810"></a><span class="lineno"> 4810</span>&#160;        m_Count(0),</div>
+<div class="line"><a name="l04811"></a><span class="lineno"> 4811</span>&#160;        m_Capacity(0)</div>
+<div class="line"><a name="l04812"></a><span class="lineno"> 4812</span>&#160;    {</div>
 <div class="line"><a name="l04813"></a><span class="lineno"> 4813</span>&#160;    }</div>
-<div class="line"><a name="l04814"></a><span class="lineno"> 4814</span>&#160;    </div>
-<div class="line"><a name="l04815"></a><span class="lineno"> 4815</span>&#160;    ~VmaVector()</div>
-<div class="line"><a name="l04816"></a><span class="lineno"> 4816</span>&#160;    {</div>
-<div class="line"><a name="l04817"></a><span class="lineno"> 4817</span>&#160;        VmaFree(m_Allocator.m_pCallbacks, m_pArray);</div>
-<div class="line"><a name="l04818"></a><span class="lineno"> 4818</span>&#160;    }</div>
-<div class="line"><a name="l04819"></a><span class="lineno"> 4819</span>&#160; </div>
-<div class="line"><a name="l04820"></a><span class="lineno"> 4820</span>&#160;    VmaVector&amp; operator=(<span class="keyword">const</span> VmaVector&lt;T, AllocatorT&gt;&amp; rhs)</div>
-<div class="line"><a name="l04821"></a><span class="lineno"> 4821</span>&#160;    {</div>
-<div class="line"><a name="l04822"></a><span class="lineno"> 4822</span>&#160;        <span class="keywordflow">if</span>(&amp;rhs != <span class="keyword">this</span>)</div>
-<div class="line"><a name="l04823"></a><span class="lineno"> 4823</span>&#160;        {</div>
-<div class="line"><a name="l04824"></a><span class="lineno"> 4824</span>&#160;            resize(rhs.m_Count);</div>
-<div class="line"><a name="l04825"></a><span class="lineno"> 4825</span>&#160;            <span class="keywordflow">if</span>(m_Count != 0)</div>
-<div class="line"><a name="l04826"></a><span class="lineno"> 4826</span>&#160;            {</div>
-<div class="line"><a name="l04827"></a><span class="lineno"> 4827</span>&#160;                memcpy(m_pArray, rhs.m_pArray, m_Count * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l04828"></a><span class="lineno"> 4828</span>&#160;            }</div>
-<div class="line"><a name="l04829"></a><span class="lineno"> 4829</span>&#160;        }</div>
-<div class="line"><a name="l04830"></a><span class="lineno"> 4830</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
-<div class="line"><a name="l04831"></a><span class="lineno"> 4831</span>&#160;    }</div>
-<div class="line"><a name="l04832"></a><span class="lineno"> 4832</span>&#160;    </div>
-<div class="line"><a name="l04833"></a><span class="lineno"> 4833</span>&#160;    <span class="keywordtype">bool</span> empty()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count == 0; }</div>
-<div class="line"><a name="l04834"></a><span class="lineno"> 4834</span>&#160;    <span class="keywordtype">size_t</span> size()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count; }</div>
-<div class="line"><a name="l04835"></a><span class="lineno"> 4835</span>&#160;    T* data() { <span class="keywordflow">return</span> m_pArray; }</div>
-<div class="line"><a name="l04836"></a><span class="lineno"> 4836</span>&#160;    <span class="keyword">const</span> T* data()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_pArray; }</div>
-<div class="line"><a name="l04837"></a><span class="lineno"> 4837</span>&#160;    </div>
-<div class="line"><a name="l04838"></a><span class="lineno"> 4838</span>&#160;    T&amp; operator[](<span class="keywordtype">size_t</span> index)</div>
-<div class="line"><a name="l04839"></a><span class="lineno"> 4839</span>&#160;    {</div>
-<div class="line"><a name="l04840"></a><span class="lineno"> 4840</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
-<div class="line"><a name="l04841"></a><span class="lineno"> 4841</span>&#160;        <span class="keywordflow">return</span> m_pArray[index];</div>
-<div class="line"><a name="l04842"></a><span class="lineno"> 4842</span>&#160;    }</div>
-<div class="line"><a name="l04843"></a><span class="lineno"> 4843</span>&#160;    <span class="keyword">const</span> T&amp; operator[](<span class="keywordtype">size_t</span> index)<span class="keyword"> const</span></div>
-<div class="line"><a name="l04844"></a><span class="lineno"> 4844</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l04845"></a><span class="lineno"> 4845</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
-<div class="line"><a name="l04846"></a><span class="lineno"> 4846</span>&#160;        <span class="keywordflow">return</span> m_pArray[index];</div>
-<div class="line"><a name="l04847"></a><span class="lineno"> 4847</span>&#160;    }</div>
-<div class="line"><a name="l04848"></a><span class="lineno"> 4848</span>&#160; </div>
-<div class="line"><a name="l04849"></a><span class="lineno"> 4849</span>&#160;    T&amp; front()</div>
-<div class="line"><a name="l04850"></a><span class="lineno"> 4850</span>&#160;    {</div>
-<div class="line"><a name="l04851"></a><span class="lineno"> 4851</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l04852"></a><span class="lineno"> 4852</span>&#160;        <span class="keywordflow">return</span> m_pArray[0];</div>
-<div class="line"><a name="l04853"></a><span class="lineno"> 4853</span>&#160;    }</div>
-<div class="line"><a name="l04854"></a><span class="lineno"> 4854</span>&#160;    <span class="keyword">const</span> T&amp; front()<span class="keyword"> const</span></div>
-<div class="line"><a name="l04855"></a><span class="lineno"> 4855</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l04856"></a><span class="lineno"> 4856</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l04857"></a><span class="lineno"> 4857</span>&#160;        <span class="keywordflow">return</span> m_pArray[0];</div>
-<div class="line"><a name="l04858"></a><span class="lineno"> 4858</span>&#160;    }</div>
-<div class="line"><a name="l04859"></a><span class="lineno"> 4859</span>&#160;    T&amp; back()</div>
-<div class="line"><a name="l04860"></a><span class="lineno"> 4860</span>&#160;    {</div>
-<div class="line"><a name="l04861"></a><span class="lineno"> 4861</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l04862"></a><span class="lineno"> 4862</span>&#160;        <span class="keywordflow">return</span> m_pArray[m_Count - 1];</div>
-<div class="line"><a name="l04863"></a><span class="lineno"> 4863</span>&#160;    }</div>
-<div class="line"><a name="l04864"></a><span class="lineno"> 4864</span>&#160;    <span class="keyword">const</span> T&amp; back()<span class="keyword"> const</span></div>
-<div class="line"><a name="l04865"></a><span class="lineno"> 4865</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l04866"></a><span class="lineno"> 4866</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l04867"></a><span class="lineno"> 4867</span>&#160;        <span class="keywordflow">return</span> m_pArray[m_Count - 1];</div>
-<div class="line"><a name="l04868"></a><span class="lineno"> 4868</span>&#160;    }</div>
-<div class="line"><a name="l04869"></a><span class="lineno"> 4869</span>&#160; </div>
-<div class="line"><a name="l04870"></a><span class="lineno"> 4870</span>&#160;    <span class="keywordtype">void</span> reserve(<span class="keywordtype">size_t</span> newCapacity, <span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
-<div class="line"><a name="l04871"></a><span class="lineno"> 4871</span>&#160;    {</div>
-<div class="line"><a name="l04872"></a><span class="lineno"> 4872</span>&#160;        newCapacity = VMA_MAX(newCapacity, m_Count);</div>
-<div class="line"><a name="l04873"></a><span class="lineno"> 4873</span>&#160;        </div>
-<div class="line"><a name="l04874"></a><span class="lineno"> 4874</span>&#160;        <span class="keywordflow">if</span>((newCapacity &lt; m_Capacity) &amp;&amp; !freeMemory)</div>
-<div class="line"><a name="l04875"></a><span class="lineno"> 4875</span>&#160;        {</div>
-<div class="line"><a name="l04876"></a><span class="lineno"> 4876</span>&#160;            newCapacity = m_Capacity;</div>
-<div class="line"><a name="l04877"></a><span class="lineno"> 4877</span>&#160;        }</div>
-<div class="line"><a name="l04878"></a><span class="lineno"> 4878</span>&#160;        </div>
-<div class="line"><a name="l04879"></a><span class="lineno"> 4879</span>&#160;        <span class="keywordflow">if</span>(newCapacity != m_Capacity)</div>
-<div class="line"><a name="l04880"></a><span class="lineno"> 4880</span>&#160;        {</div>
-<div class="line"><a name="l04881"></a><span class="lineno"> 4881</span>&#160;            T* <span class="keyword">const</span> newArray = newCapacity ? VmaAllocateArray&lt;T&gt;(m_Allocator, newCapacity) : VMA_NULL;</div>
-<div class="line"><a name="l04882"></a><span class="lineno"> 4882</span>&#160;            <span class="keywordflow">if</span>(m_Count != 0)</div>
-<div class="line"><a name="l04883"></a><span class="lineno"> 4883</span>&#160;            {</div>
-<div class="line"><a name="l04884"></a><span class="lineno"> 4884</span>&#160;                memcpy(newArray, m_pArray, m_Count * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l04885"></a><span class="lineno"> 4885</span>&#160;            }</div>
-<div class="line"><a name="l04886"></a><span class="lineno"> 4886</span>&#160;            VmaFree(m_Allocator.m_pCallbacks, m_pArray);</div>
-<div class="line"><a name="l04887"></a><span class="lineno"> 4887</span>&#160;            m_Capacity = newCapacity;</div>
-<div class="line"><a name="l04888"></a><span class="lineno"> 4888</span>&#160;            m_pArray = newArray;</div>
-<div class="line"><a name="l04889"></a><span class="lineno"> 4889</span>&#160;        }</div>
-<div class="line"><a name="l04890"></a><span class="lineno"> 4890</span>&#160;    }</div>
-<div class="line"><a name="l04891"></a><span class="lineno"> 4891</span>&#160; </div>
-<div class="line"><a name="l04892"></a><span class="lineno"> 4892</span>&#160;    <span class="keywordtype">void</span> resize(<span class="keywordtype">size_t</span> newCount, <span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
-<div class="line"><a name="l04893"></a><span class="lineno"> 4893</span>&#160;    {</div>
-<div class="line"><a name="l04894"></a><span class="lineno"> 4894</span>&#160;        <span class="keywordtype">size_t</span> newCapacity = m_Capacity;</div>
-<div class="line"><a name="l04895"></a><span class="lineno"> 4895</span>&#160;        <span class="keywordflow">if</span>(newCount &gt; m_Capacity)</div>
-<div class="line"><a name="l04896"></a><span class="lineno"> 4896</span>&#160;        {</div>
-<div class="line"><a name="l04897"></a><span class="lineno"> 4897</span>&#160;            newCapacity = VMA_MAX(newCount, VMA_MAX(m_Capacity * 3 / 2, (<span class="keywordtype">size_t</span>)8));</div>
-<div class="line"><a name="l04898"></a><span class="lineno"> 4898</span>&#160;        }</div>
-<div class="line"><a name="l04899"></a><span class="lineno"> 4899</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span>(freeMemory)</div>
+<div class="line"><a name="l04814"></a><span class="lineno"> 4814</span>&#160; </div>
+<div class="line"><a name="l04815"></a><span class="lineno"> 4815</span>&#160;    VmaVector(<span class="keywordtype">size_t</span> count, <span class="keyword">const</span> AllocatorT&amp; allocator) :</div>
+<div class="line"><a name="l04816"></a><span class="lineno"> 4816</span>&#160;        m_Allocator(allocator),</div>
+<div class="line"><a name="l04817"></a><span class="lineno"> 4817</span>&#160;        m_pArray(count ? (T*)VmaAllocateArray&lt;T&gt;(allocator.m_pCallbacks, count) : VMA_NULL),</div>
+<div class="line"><a name="l04818"></a><span class="lineno"> 4818</span>&#160;        m_Count(count),</div>
+<div class="line"><a name="l04819"></a><span class="lineno"> 4819</span>&#160;        m_Capacity(count)</div>
+<div class="line"><a name="l04820"></a><span class="lineno"> 4820</span>&#160;    {</div>
+<div class="line"><a name="l04821"></a><span class="lineno"> 4821</span>&#160;    }</div>
+<div class="line"><a name="l04822"></a><span class="lineno"> 4822</span>&#160;    </div>
+<div class="line"><a name="l04823"></a><span class="lineno"> 4823</span>&#160;    <span class="comment">// This version of the constructor is here for compatibility with pre-C++14 std::vector.</span></div>
+<div class="line"><a name="l04824"></a><span class="lineno"> 4824</span>&#160;    <span class="comment">// value is unused.</span></div>
+<div class="line"><a name="l04825"></a><span class="lineno"> 4825</span>&#160;    VmaVector(<span class="keywordtype">size_t</span> count, <span class="keyword">const</span> T&amp; value, <span class="keyword">const</span> AllocatorT&amp; allocator)</div>
+<div class="line"><a name="l04826"></a><span class="lineno"> 4826</span>&#160;        : VmaVector(count, allocator) {}</div>
+<div class="line"><a name="l04827"></a><span class="lineno"> 4827</span>&#160;    </div>
+<div class="line"><a name="l04828"></a><span class="lineno"> 4828</span>&#160;    VmaVector(<span class="keyword">const</span> VmaVector&lt;T, AllocatorT&gt;&amp; src) :</div>
+<div class="line"><a name="l04829"></a><span class="lineno"> 4829</span>&#160;        m_Allocator(src.m_Allocator),</div>
+<div class="line"><a name="l04830"></a><span class="lineno"> 4830</span>&#160;        m_pArray(src.m_Count ? (T*)VmaAllocateArray&lt;T&gt;(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),</div>
+<div class="line"><a name="l04831"></a><span class="lineno"> 4831</span>&#160;        m_Count(src.m_Count),</div>
+<div class="line"><a name="l04832"></a><span class="lineno"> 4832</span>&#160;        m_Capacity(src.m_Count)</div>
+<div class="line"><a name="l04833"></a><span class="lineno"> 4833</span>&#160;    {</div>
+<div class="line"><a name="l04834"></a><span class="lineno"> 4834</span>&#160;        <span class="keywordflow">if</span>(m_Count != 0)</div>
+<div class="line"><a name="l04835"></a><span class="lineno"> 4835</span>&#160;        {</div>
+<div class="line"><a name="l04836"></a><span class="lineno"> 4836</span>&#160;            memcpy(m_pArray, src.m_pArray, m_Count * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l04837"></a><span class="lineno"> 4837</span>&#160;        }</div>
+<div class="line"><a name="l04838"></a><span class="lineno"> 4838</span>&#160;    }</div>
+<div class="line"><a name="l04839"></a><span class="lineno"> 4839</span>&#160;    </div>
+<div class="line"><a name="l04840"></a><span class="lineno"> 4840</span>&#160;    ~VmaVector()</div>
+<div class="line"><a name="l04841"></a><span class="lineno"> 4841</span>&#160;    {</div>
+<div class="line"><a name="l04842"></a><span class="lineno"> 4842</span>&#160;        VmaFree(m_Allocator.m_pCallbacks, m_pArray);</div>
+<div class="line"><a name="l04843"></a><span class="lineno"> 4843</span>&#160;    }</div>
+<div class="line"><a name="l04844"></a><span class="lineno"> 4844</span>&#160; </div>
+<div class="line"><a name="l04845"></a><span class="lineno"> 4845</span>&#160;    VmaVector&amp; operator=(<span class="keyword">const</span> VmaVector&lt;T, AllocatorT&gt;&amp; rhs)</div>
+<div class="line"><a name="l04846"></a><span class="lineno"> 4846</span>&#160;    {</div>
+<div class="line"><a name="l04847"></a><span class="lineno"> 4847</span>&#160;        <span class="keywordflow">if</span>(&amp;rhs != <span class="keyword">this</span>)</div>
+<div class="line"><a name="l04848"></a><span class="lineno"> 4848</span>&#160;        {</div>
+<div class="line"><a name="l04849"></a><span class="lineno"> 4849</span>&#160;            resize(rhs.m_Count);</div>
+<div class="line"><a name="l04850"></a><span class="lineno"> 4850</span>&#160;            <span class="keywordflow">if</span>(m_Count != 0)</div>
+<div class="line"><a name="l04851"></a><span class="lineno"> 4851</span>&#160;            {</div>
+<div class="line"><a name="l04852"></a><span class="lineno"> 4852</span>&#160;                memcpy(m_pArray, rhs.m_pArray, m_Count * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l04853"></a><span class="lineno"> 4853</span>&#160;            }</div>
+<div class="line"><a name="l04854"></a><span class="lineno"> 4854</span>&#160;        }</div>
+<div class="line"><a name="l04855"></a><span class="lineno"> 4855</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l04856"></a><span class="lineno"> 4856</span>&#160;    }</div>
+<div class="line"><a name="l04857"></a><span class="lineno"> 4857</span>&#160;    </div>
+<div class="line"><a name="l04858"></a><span class="lineno"> 4858</span>&#160;    <span class="keywordtype">bool</span> empty()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count == 0; }</div>
+<div class="line"><a name="l04859"></a><span class="lineno"> 4859</span>&#160;    <span class="keywordtype">size_t</span> size()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count; }</div>
+<div class="line"><a name="l04860"></a><span class="lineno"> 4860</span>&#160;    T* data() { <span class="keywordflow">return</span> m_pArray; }</div>
+<div class="line"><a name="l04861"></a><span class="lineno"> 4861</span>&#160;    <span class="keyword">const</span> T* data()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_pArray; }</div>
+<div class="line"><a name="l04862"></a><span class="lineno"> 4862</span>&#160;    </div>
+<div class="line"><a name="l04863"></a><span class="lineno"> 4863</span>&#160;    T&amp; operator[](<span class="keywordtype">size_t</span> index)</div>
+<div class="line"><a name="l04864"></a><span class="lineno"> 4864</span>&#160;    {</div>
+<div class="line"><a name="l04865"></a><span class="lineno"> 4865</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
+<div class="line"><a name="l04866"></a><span class="lineno"> 4866</span>&#160;        <span class="keywordflow">return</span> m_pArray[index];</div>
+<div class="line"><a name="l04867"></a><span class="lineno"> 4867</span>&#160;    }</div>
+<div class="line"><a name="l04868"></a><span class="lineno"> 4868</span>&#160;    <span class="keyword">const</span> T&amp; operator[](<span class="keywordtype">size_t</span> index)<span class="keyword"> const</span></div>
+<div class="line"><a name="l04869"></a><span class="lineno"> 4869</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l04870"></a><span class="lineno"> 4870</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
+<div class="line"><a name="l04871"></a><span class="lineno"> 4871</span>&#160;        <span class="keywordflow">return</span> m_pArray[index];</div>
+<div class="line"><a name="l04872"></a><span class="lineno"> 4872</span>&#160;    }</div>
+<div class="line"><a name="l04873"></a><span class="lineno"> 4873</span>&#160; </div>
+<div class="line"><a name="l04874"></a><span class="lineno"> 4874</span>&#160;    T&amp; front()</div>
+<div class="line"><a name="l04875"></a><span class="lineno"> 4875</span>&#160;    {</div>
+<div class="line"><a name="l04876"></a><span class="lineno"> 4876</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l04877"></a><span class="lineno"> 4877</span>&#160;        <span class="keywordflow">return</span> m_pArray[0];</div>
+<div class="line"><a name="l04878"></a><span class="lineno"> 4878</span>&#160;    }</div>
+<div class="line"><a name="l04879"></a><span class="lineno"> 4879</span>&#160;    <span class="keyword">const</span> T&amp; front()<span class="keyword"> const</span></div>
+<div class="line"><a name="l04880"></a><span class="lineno"> 4880</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l04881"></a><span class="lineno"> 4881</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l04882"></a><span class="lineno"> 4882</span>&#160;        <span class="keywordflow">return</span> m_pArray[0];</div>
+<div class="line"><a name="l04883"></a><span class="lineno"> 4883</span>&#160;    }</div>
+<div class="line"><a name="l04884"></a><span class="lineno"> 4884</span>&#160;    T&amp; back()</div>
+<div class="line"><a name="l04885"></a><span class="lineno"> 4885</span>&#160;    {</div>
+<div class="line"><a name="l04886"></a><span class="lineno"> 4886</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l04887"></a><span class="lineno"> 4887</span>&#160;        <span class="keywordflow">return</span> m_pArray[m_Count - 1];</div>
+<div class="line"><a name="l04888"></a><span class="lineno"> 4888</span>&#160;    }</div>
+<div class="line"><a name="l04889"></a><span class="lineno"> 4889</span>&#160;    <span class="keyword">const</span> T&amp; back()<span class="keyword"> const</span></div>
+<div class="line"><a name="l04890"></a><span class="lineno"> 4890</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l04891"></a><span class="lineno"> 4891</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l04892"></a><span class="lineno"> 4892</span>&#160;        <span class="keywordflow">return</span> m_pArray[m_Count - 1];</div>
+<div class="line"><a name="l04893"></a><span class="lineno"> 4893</span>&#160;    }</div>
+<div class="line"><a name="l04894"></a><span class="lineno"> 4894</span>&#160; </div>
+<div class="line"><a name="l04895"></a><span class="lineno"> 4895</span>&#160;    <span class="keywordtype">void</span> reserve(<span class="keywordtype">size_t</span> newCapacity, <span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
+<div class="line"><a name="l04896"></a><span class="lineno"> 4896</span>&#160;    {</div>
+<div class="line"><a name="l04897"></a><span class="lineno"> 4897</span>&#160;        newCapacity = VMA_MAX(newCapacity, m_Count);</div>
+<div class="line"><a name="l04898"></a><span class="lineno"> 4898</span>&#160;        </div>
+<div class="line"><a name="l04899"></a><span class="lineno"> 4899</span>&#160;        <span class="keywordflow">if</span>((newCapacity &lt; m_Capacity) &amp;&amp; !freeMemory)</div>
 <div class="line"><a name="l04900"></a><span class="lineno"> 4900</span>&#160;        {</div>
-<div class="line"><a name="l04901"></a><span class="lineno"> 4901</span>&#160;            newCapacity = newCount;</div>
+<div class="line"><a name="l04901"></a><span class="lineno"> 4901</span>&#160;            newCapacity = m_Capacity;</div>
 <div class="line"><a name="l04902"></a><span class="lineno"> 4902</span>&#160;        }</div>
-<div class="line"><a name="l04903"></a><span class="lineno"> 4903</span>&#160; </div>
+<div class="line"><a name="l04903"></a><span class="lineno"> 4903</span>&#160;        </div>
 <div class="line"><a name="l04904"></a><span class="lineno"> 4904</span>&#160;        <span class="keywordflow">if</span>(newCapacity != m_Capacity)</div>
 <div class="line"><a name="l04905"></a><span class="lineno"> 4905</span>&#160;        {</div>
-<div class="line"><a name="l04906"></a><span class="lineno"> 4906</span>&#160;            T* <span class="keyword">const</span> newArray = newCapacity ? VmaAllocateArray&lt;T&gt;(m_Allocator.m_pCallbacks, newCapacity) : VMA_NULL;</div>
-<div class="line"><a name="l04907"></a><span class="lineno"> 4907</span>&#160;            <span class="keyword">const</span> <span class="keywordtype">size_t</span> elementsToCopy = VMA_MIN(m_Count, newCount);</div>
-<div class="line"><a name="l04908"></a><span class="lineno"> 4908</span>&#160;            <span class="keywordflow">if</span>(elementsToCopy != 0)</div>
-<div class="line"><a name="l04909"></a><span class="lineno"> 4909</span>&#160;            {</div>
-<div class="line"><a name="l04910"></a><span class="lineno"> 4910</span>&#160;                memcpy(newArray, m_pArray, elementsToCopy * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l04911"></a><span class="lineno"> 4911</span>&#160;            }</div>
-<div class="line"><a name="l04912"></a><span class="lineno"> 4912</span>&#160;            VmaFree(m_Allocator.m_pCallbacks, m_pArray);</div>
-<div class="line"><a name="l04913"></a><span class="lineno"> 4913</span>&#160;            m_Capacity = newCapacity;</div>
-<div class="line"><a name="l04914"></a><span class="lineno"> 4914</span>&#160;            m_pArray = newArray;</div>
-<div class="line"><a name="l04915"></a><span class="lineno"> 4915</span>&#160;        }</div>
+<div class="line"><a name="l04906"></a><span class="lineno"> 4906</span>&#160;            T* <span class="keyword">const</span> newArray = newCapacity ? VmaAllocateArray&lt;T&gt;(m_Allocator, newCapacity) : VMA_NULL;</div>
+<div class="line"><a name="l04907"></a><span class="lineno"> 4907</span>&#160;            <span class="keywordflow">if</span>(m_Count != 0)</div>
+<div class="line"><a name="l04908"></a><span class="lineno"> 4908</span>&#160;            {</div>
+<div class="line"><a name="l04909"></a><span class="lineno"> 4909</span>&#160;                memcpy(newArray, m_pArray, m_Count * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l04910"></a><span class="lineno"> 4910</span>&#160;            }</div>
+<div class="line"><a name="l04911"></a><span class="lineno"> 4911</span>&#160;            VmaFree(m_Allocator.m_pCallbacks, m_pArray);</div>
+<div class="line"><a name="l04912"></a><span class="lineno"> 4912</span>&#160;            m_Capacity = newCapacity;</div>
+<div class="line"><a name="l04913"></a><span class="lineno"> 4913</span>&#160;            m_pArray = newArray;</div>
+<div class="line"><a name="l04914"></a><span class="lineno"> 4914</span>&#160;        }</div>
+<div class="line"><a name="l04915"></a><span class="lineno"> 4915</span>&#160;    }</div>
 <div class="line"><a name="l04916"></a><span class="lineno"> 4916</span>&#160; </div>
-<div class="line"><a name="l04917"></a><span class="lineno"> 4917</span>&#160;        m_Count = newCount;</div>
-<div class="line"><a name="l04918"></a><span class="lineno"> 4918</span>&#160;    }</div>
-<div class="line"><a name="l04919"></a><span class="lineno"> 4919</span>&#160; </div>
-<div class="line"><a name="l04920"></a><span class="lineno"> 4920</span>&#160;    <span class="keywordtype">void</span> clear(<span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
-<div class="line"><a name="l04921"></a><span class="lineno"> 4921</span>&#160;    {</div>
-<div class="line"><a name="l04922"></a><span class="lineno"> 4922</span>&#160;        resize(0, freeMemory);</div>
-<div class="line"><a name="l04923"></a><span class="lineno"> 4923</span>&#160;    }</div>
-<div class="line"><a name="l04924"></a><span class="lineno"> 4924</span>&#160; </div>
-<div class="line"><a name="l04925"></a><span class="lineno"> 4925</span>&#160;    <span class="keywordtype">void</span> insert(<span class="keywordtype">size_t</span> index, <span class="keyword">const</span> T&amp; src)</div>
-<div class="line"><a name="l04926"></a><span class="lineno"> 4926</span>&#160;    {</div>
-<div class="line"><a name="l04927"></a><span class="lineno"> 4927</span>&#160;        VMA_HEAVY_ASSERT(index &lt;= m_Count);</div>
-<div class="line"><a name="l04928"></a><span class="lineno"> 4928</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> oldCount = size();</div>
-<div class="line"><a name="l04929"></a><span class="lineno"> 4929</span>&#160;        resize(oldCount + 1);</div>
-<div class="line"><a name="l04930"></a><span class="lineno"> 4930</span>&#160;        <span class="keywordflow">if</span>(index &lt; oldCount)</div>
-<div class="line"><a name="l04931"></a><span class="lineno"> 4931</span>&#160;        {</div>
-<div class="line"><a name="l04932"></a><span class="lineno"> 4932</span>&#160;            memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l04933"></a><span class="lineno"> 4933</span>&#160;        }</div>
-<div class="line"><a name="l04934"></a><span class="lineno"> 4934</span>&#160;        m_pArray[index] = src;</div>
-<div class="line"><a name="l04935"></a><span class="lineno"> 4935</span>&#160;    }</div>
-<div class="line"><a name="l04936"></a><span class="lineno"> 4936</span>&#160; </div>
-<div class="line"><a name="l04937"></a><span class="lineno"> 4937</span>&#160;    <span class="keywordtype">void</span> remove(<span class="keywordtype">size_t</span> index)</div>
-<div class="line"><a name="l04938"></a><span class="lineno"> 4938</span>&#160;    {</div>
-<div class="line"><a name="l04939"></a><span class="lineno"> 4939</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
-<div class="line"><a name="l04940"></a><span class="lineno"> 4940</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> oldCount = size();</div>
-<div class="line"><a name="l04941"></a><span class="lineno"> 4941</span>&#160;        <span class="keywordflow">if</span>(index &lt; oldCount - 1)</div>
-<div class="line"><a name="l04942"></a><span class="lineno"> 4942</span>&#160;        {</div>
-<div class="line"><a name="l04943"></a><span class="lineno"> 4943</span>&#160;            memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l04944"></a><span class="lineno"> 4944</span>&#160;        }</div>
-<div class="line"><a name="l04945"></a><span class="lineno"> 4945</span>&#160;        resize(oldCount - 1);</div>
-<div class="line"><a name="l04946"></a><span class="lineno"> 4946</span>&#160;    }</div>
-<div class="line"><a name="l04947"></a><span class="lineno"> 4947</span>&#160; </div>
-<div class="line"><a name="l04948"></a><span class="lineno"> 4948</span>&#160;    <span class="keywordtype">void</span> push_back(<span class="keyword">const</span> T&amp; src)</div>
-<div class="line"><a name="l04949"></a><span class="lineno"> 4949</span>&#160;    {</div>
-<div class="line"><a name="l04950"></a><span class="lineno"> 4950</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> newIndex = size();</div>
-<div class="line"><a name="l04951"></a><span class="lineno"> 4951</span>&#160;        resize(newIndex + 1);</div>
-<div class="line"><a name="l04952"></a><span class="lineno"> 4952</span>&#160;        m_pArray[newIndex] = src;</div>
-<div class="line"><a name="l04953"></a><span class="lineno"> 4953</span>&#160;    }</div>
-<div class="line"><a name="l04954"></a><span class="lineno"> 4954</span>&#160; </div>
-<div class="line"><a name="l04955"></a><span class="lineno"> 4955</span>&#160;    <span class="keywordtype">void</span> pop_back()</div>
-<div class="line"><a name="l04956"></a><span class="lineno"> 4956</span>&#160;    {</div>
-<div class="line"><a name="l04957"></a><span class="lineno"> 4957</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l04958"></a><span class="lineno"> 4958</span>&#160;        resize(size() - 1);</div>
-<div class="line"><a name="l04959"></a><span class="lineno"> 4959</span>&#160;    }</div>
-<div class="line"><a name="l04960"></a><span class="lineno"> 4960</span>&#160; </div>
-<div class="line"><a name="l04961"></a><span class="lineno"> 4961</span>&#160;    <span class="keywordtype">void</span> push_front(<span class="keyword">const</span> T&amp; src)</div>
-<div class="line"><a name="l04962"></a><span class="lineno"> 4962</span>&#160;    {</div>
-<div class="line"><a name="l04963"></a><span class="lineno"> 4963</span>&#160;        insert(0, src);</div>
-<div class="line"><a name="l04964"></a><span class="lineno"> 4964</span>&#160;    }</div>
-<div class="line"><a name="l04965"></a><span class="lineno"> 4965</span>&#160; </div>
-<div class="line"><a name="l04966"></a><span class="lineno"> 4966</span>&#160;    <span class="keywordtype">void</span> pop_front()</div>
-<div class="line"><a name="l04967"></a><span class="lineno"> 4967</span>&#160;    {</div>
-<div class="line"><a name="l04968"></a><span class="lineno"> 4968</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l04969"></a><span class="lineno"> 4969</span>&#160;        remove(0);</div>
-<div class="line"><a name="l04970"></a><span class="lineno"> 4970</span>&#160;    }</div>
-<div class="line"><a name="l04971"></a><span class="lineno"> 4971</span>&#160; </div>
-<div class="line"><a name="l04972"></a><span class="lineno"> 4972</span>&#160;    <span class="keyword">typedef</span> T* iterator;</div>
-<div class="line"><a name="l04973"></a><span class="lineno"> 4973</span>&#160; </div>
-<div class="line"><a name="l04974"></a><span class="lineno"> 4974</span>&#160;    iterator begin() { <span class="keywordflow">return</span> m_pArray; }</div>
-<div class="line"><a name="l04975"></a><span class="lineno"> 4975</span>&#160;    iterator end() { <span class="keywordflow">return</span> m_pArray + m_Count; }</div>
-<div class="line"><a name="l04976"></a><span class="lineno"> 4976</span>&#160; </div>
-<div class="line"><a name="l04977"></a><span class="lineno"> 4977</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l04978"></a><span class="lineno"> 4978</span>&#160;    AllocatorT m_Allocator;</div>
-<div class="line"><a name="l04979"></a><span class="lineno"> 4979</span>&#160;    T* m_pArray;</div>
-<div class="line"><a name="l04980"></a><span class="lineno"> 4980</span>&#160;    <span class="keywordtype">size_t</span> m_Count;</div>
-<div class="line"><a name="l04981"></a><span class="lineno"> 4981</span>&#160;    <span class="keywordtype">size_t</span> m_Capacity;</div>
-<div class="line"><a name="l04982"></a><span class="lineno"> 4982</span>&#160;};</div>
-<div class="line"><a name="l04983"></a><span class="lineno"> 4983</span>&#160; </div>
-<div class="line"><a name="l04984"></a><span class="lineno"> 4984</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> allocatorT&gt;</div>
-<div class="line"><a name="l04985"></a><span class="lineno"> 4985</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaVectorInsert(VmaVector&lt;T, allocatorT&gt;&amp; vec, <span class="keywordtype">size_t</span> index, <span class="keyword">const</span> T&amp; item)</div>
-<div class="line"><a name="l04986"></a><span class="lineno"> 4986</span>&#160;{</div>
-<div class="line"><a name="l04987"></a><span class="lineno"> 4987</span>&#160;    vec.insert(index, item);</div>
-<div class="line"><a name="l04988"></a><span class="lineno"> 4988</span>&#160;}</div>
-<div class="line"><a name="l04989"></a><span class="lineno"> 4989</span>&#160; </div>
-<div class="line"><a name="l04990"></a><span class="lineno"> 4990</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> allocatorT&gt;</div>
-<div class="line"><a name="l04991"></a><span class="lineno"> 4991</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaVectorRemove(VmaVector&lt;T, allocatorT&gt;&amp; vec, <span class="keywordtype">size_t</span> index)</div>
-<div class="line"><a name="l04992"></a><span class="lineno"> 4992</span>&#160;{</div>
-<div class="line"><a name="l04993"></a><span class="lineno"> 4993</span>&#160;    vec.remove(index);</div>
-<div class="line"><a name="l04994"></a><span class="lineno"> 4994</span>&#160;}</div>
-<div class="line"><a name="l04995"></a><span class="lineno"> 4995</span>&#160; </div>
-<div class="line"><a name="l04996"></a><span class="lineno"> 4996</span>&#160;<span class="preprocessor">#endif // #if VMA_USE_STL_VECTOR</span></div>
-<div class="line"><a name="l04997"></a><span class="lineno"> 4997</span>&#160; </div>
-<div class="line"><a name="l04998"></a><span class="lineno"> 4998</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> CmpLess, <span class="keyword">typename</span> VectorT&gt;</div>
-<div class="line"><a name="l04999"></a><span class="lineno"> 4999</span>&#160;<span class="keywordtype">size_t</span> VmaVectorInsertSorted(VectorT&amp; vector, <span class="keyword">const</span> <span class="keyword">typename</span> VectorT::value_type&amp; value)</div>
-<div class="line"><a name="l05000"></a><span class="lineno"> 5000</span>&#160;{</div>
-<div class="line"><a name="l05001"></a><span class="lineno"> 5001</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">size_t</span> indexToInsert = VmaBinaryFindFirstNotLess(</div>
-<div class="line"><a name="l05002"></a><span class="lineno"> 5002</span>&#160;        vector.data(),</div>
-<div class="line"><a name="l05003"></a><span class="lineno"> 5003</span>&#160;        vector.data() + vector.size(),</div>
-<div class="line"><a name="l05004"></a><span class="lineno"> 5004</span>&#160;        value,</div>
-<div class="line"><a name="l05005"></a><span class="lineno"> 5005</span>&#160;        CmpLess()) - vector.data();</div>
-<div class="line"><a name="l05006"></a><span class="lineno"> 5006</span>&#160;    VmaVectorInsert(vector, indexToInsert, value);</div>
-<div class="line"><a name="l05007"></a><span class="lineno"> 5007</span>&#160;    <span class="keywordflow">return</span> indexToInsert;</div>
-<div class="line"><a name="l05008"></a><span class="lineno"> 5008</span>&#160;}</div>
-<div class="line"><a name="l05009"></a><span class="lineno"> 5009</span>&#160; </div>
-<div class="line"><a name="l05010"></a><span class="lineno"> 5010</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> CmpLess, <span class="keyword">typename</span> VectorT&gt;</div>
-<div class="line"><a name="l05011"></a><span class="lineno"> 5011</span>&#160;<span class="keywordtype">bool</span> VmaVectorRemoveSorted(VectorT&amp; vector, <span class="keyword">const</span> <span class="keyword">typename</span> VectorT::value_type&amp; value)</div>
-<div class="line"><a name="l05012"></a><span class="lineno"> 5012</span>&#160;{</div>
-<div class="line"><a name="l05013"></a><span class="lineno"> 5013</span>&#160;    CmpLess comparator;</div>
-<div class="line"><a name="l05014"></a><span class="lineno"> 5014</span>&#160;    <span class="keyword">typename</span> VectorT::iterator it = VmaBinaryFindFirstNotLess(</div>
-<div class="line"><a name="l05015"></a><span class="lineno"> 5015</span>&#160;        vector.begin(),</div>
-<div class="line"><a name="l05016"></a><span class="lineno"> 5016</span>&#160;        vector.end(),</div>
-<div class="line"><a name="l05017"></a><span class="lineno"> 5017</span>&#160;        value,</div>
-<div class="line"><a name="l05018"></a><span class="lineno"> 5018</span>&#160;        comparator);</div>
-<div class="line"><a name="l05019"></a><span class="lineno"> 5019</span>&#160;    <span class="keywordflow">if</span>((it != vector.end()) &amp;&amp; !comparator(*it, value) &amp;&amp; !comparator(value, *it))</div>
-<div class="line"><a name="l05020"></a><span class="lineno"> 5020</span>&#160;    {</div>
-<div class="line"><a name="l05021"></a><span class="lineno"> 5021</span>&#160;        <span class="keywordtype">size_t</span> indexToRemove = it - vector.begin();</div>
-<div class="line"><a name="l05022"></a><span class="lineno"> 5022</span>&#160;        VmaVectorRemove(vector, indexToRemove);</div>
-<div class="line"><a name="l05023"></a><span class="lineno"> 5023</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l05024"></a><span class="lineno"> 5024</span>&#160;    }</div>
-<div class="line"><a name="l05025"></a><span class="lineno"> 5025</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l05026"></a><span class="lineno"> 5026</span>&#160;}</div>
-<div class="line"><a name="l05027"></a><span class="lineno"> 5027</span>&#160; </div>
-<div class="line"><a name="l05029"></a><span class="lineno"> 5029</span>&#160;<span class="comment">// class VmaSmallVector</span></div>
-<div class="line"><a name="l05030"></a><span class="lineno"> 5030</span>&#160; </div>
-<div class="line"><a name="l05031"></a><span class="lineno"> 5031</span>&#160;<span class="comment">/*</span></div>
-<div class="line"><a name="l05032"></a><span class="lineno"> 5032</span>&#160;<span class="comment">This is a vector (a variable-sized array), optimized for the case when the array is small.</span></div>
-<div class="line"><a name="l05033"></a><span class="lineno"> 5033</span>&#160;<span class="comment"></span> </div>
-<div class="line"><a name="l05034"></a><span class="lineno"> 5034</span>&#160;<span class="comment">It contains some number of elements in-place, which allows it to avoid heap allocation</span></div>
-<div class="line"><a name="l05035"></a><span class="lineno"> 5035</span>&#160;<span class="comment">when the actual number of elements is below that threshold. This allows normal &quot;small&quot;</span></div>
-<div class="line"><a name="l05036"></a><span class="lineno"> 5036</span>&#160;<span class="comment">cases to be fast without losing generality for large inputs.</span></div>
-<div class="line"><a name="l05037"></a><span class="lineno"> 5037</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l05038"></a><span class="lineno"> 5038</span>&#160; </div>
-<div class="line"><a name="l05039"></a><span class="lineno"> 5039</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> AllocatorT, <span class="keywordtype">size_t</span> N&gt;</div>
-<div class="line"><a name="l05040"></a><span class="lineno"> 5040</span>&#160;<span class="keyword">class </span>VmaSmallVector</div>
-<div class="line"><a name="l05041"></a><span class="lineno"> 5041</span>&#160;{</div>
-<div class="line"><a name="l05042"></a><span class="lineno"> 5042</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l05043"></a><span class="lineno"> 5043</span>&#160;    <span class="keyword">typedef</span> T value_type;</div>
-<div class="line"><a name="l05044"></a><span class="lineno"> 5044</span>&#160; </div>
-<div class="line"><a name="l05045"></a><span class="lineno"> 5045</span>&#160;    VmaSmallVector(<span class="keyword">const</span> AllocatorT&amp; allocator) :</div>
-<div class="line"><a name="l05046"></a><span class="lineno"> 5046</span>&#160;        m_Count(0),</div>
-<div class="line"><a name="l05047"></a><span class="lineno"> 5047</span>&#160;        m_DynamicArray(allocator)</div>
-<div class="line"><a name="l05048"></a><span class="lineno"> 5048</span>&#160;    {</div>
+<div class="line"><a name="l04917"></a><span class="lineno"> 4917</span>&#160;    <span class="keywordtype">void</span> resize(<span class="keywordtype">size_t</span> newCount, <span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
+<div class="line"><a name="l04918"></a><span class="lineno"> 4918</span>&#160;    {</div>
+<div class="line"><a name="l04919"></a><span class="lineno"> 4919</span>&#160;        <span class="keywordtype">size_t</span> newCapacity = m_Capacity;</div>
+<div class="line"><a name="l04920"></a><span class="lineno"> 4920</span>&#160;        <span class="keywordflow">if</span>(newCount &gt; m_Capacity)</div>
+<div class="line"><a name="l04921"></a><span class="lineno"> 4921</span>&#160;        {</div>
+<div class="line"><a name="l04922"></a><span class="lineno"> 4922</span>&#160;            newCapacity = VMA_MAX(newCount, VMA_MAX(m_Capacity * 3 / 2, (<span class="keywordtype">size_t</span>)8));</div>
+<div class="line"><a name="l04923"></a><span class="lineno"> 4923</span>&#160;        }</div>
+<div class="line"><a name="l04924"></a><span class="lineno"> 4924</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span>(freeMemory)</div>
+<div class="line"><a name="l04925"></a><span class="lineno"> 4925</span>&#160;        {</div>
+<div class="line"><a name="l04926"></a><span class="lineno"> 4926</span>&#160;            newCapacity = newCount;</div>
+<div class="line"><a name="l04927"></a><span class="lineno"> 4927</span>&#160;        }</div>
+<div class="line"><a name="l04928"></a><span class="lineno"> 4928</span>&#160; </div>
+<div class="line"><a name="l04929"></a><span class="lineno"> 4929</span>&#160;        <span class="keywordflow">if</span>(newCapacity != m_Capacity)</div>
+<div class="line"><a name="l04930"></a><span class="lineno"> 4930</span>&#160;        {</div>
+<div class="line"><a name="l04931"></a><span class="lineno"> 4931</span>&#160;            T* <span class="keyword">const</span> newArray = newCapacity ? VmaAllocateArray&lt;T&gt;(m_Allocator.m_pCallbacks, newCapacity) : VMA_NULL;</div>
+<div class="line"><a name="l04932"></a><span class="lineno"> 4932</span>&#160;            <span class="keyword">const</span> <span class="keywordtype">size_t</span> elementsToCopy = VMA_MIN(m_Count, newCount);</div>
+<div class="line"><a name="l04933"></a><span class="lineno"> 4933</span>&#160;            <span class="keywordflow">if</span>(elementsToCopy != 0)</div>
+<div class="line"><a name="l04934"></a><span class="lineno"> 4934</span>&#160;            {</div>
+<div class="line"><a name="l04935"></a><span class="lineno"> 4935</span>&#160;                memcpy(newArray, m_pArray, elementsToCopy * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l04936"></a><span class="lineno"> 4936</span>&#160;            }</div>
+<div class="line"><a name="l04937"></a><span class="lineno"> 4937</span>&#160;            VmaFree(m_Allocator.m_pCallbacks, m_pArray);</div>
+<div class="line"><a name="l04938"></a><span class="lineno"> 4938</span>&#160;            m_Capacity = newCapacity;</div>
+<div class="line"><a name="l04939"></a><span class="lineno"> 4939</span>&#160;            m_pArray = newArray;</div>
+<div class="line"><a name="l04940"></a><span class="lineno"> 4940</span>&#160;        }</div>
+<div class="line"><a name="l04941"></a><span class="lineno"> 4941</span>&#160; </div>
+<div class="line"><a name="l04942"></a><span class="lineno"> 4942</span>&#160;        m_Count = newCount;</div>
+<div class="line"><a name="l04943"></a><span class="lineno"> 4943</span>&#160;    }</div>
+<div class="line"><a name="l04944"></a><span class="lineno"> 4944</span>&#160; </div>
+<div class="line"><a name="l04945"></a><span class="lineno"> 4945</span>&#160;    <span class="keywordtype">void</span> clear(<span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
+<div class="line"><a name="l04946"></a><span class="lineno"> 4946</span>&#160;    {</div>
+<div class="line"><a name="l04947"></a><span class="lineno"> 4947</span>&#160;        resize(0, freeMemory);</div>
+<div class="line"><a name="l04948"></a><span class="lineno"> 4948</span>&#160;    }</div>
+<div class="line"><a name="l04949"></a><span class="lineno"> 4949</span>&#160; </div>
+<div class="line"><a name="l04950"></a><span class="lineno"> 4950</span>&#160;    <span class="keywordtype">void</span> insert(<span class="keywordtype">size_t</span> index, <span class="keyword">const</span> T&amp; src)</div>
+<div class="line"><a name="l04951"></a><span class="lineno"> 4951</span>&#160;    {</div>
+<div class="line"><a name="l04952"></a><span class="lineno"> 4952</span>&#160;        VMA_HEAVY_ASSERT(index &lt;= m_Count);</div>
+<div class="line"><a name="l04953"></a><span class="lineno"> 4953</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> oldCount = size();</div>
+<div class="line"><a name="l04954"></a><span class="lineno"> 4954</span>&#160;        resize(oldCount + 1);</div>
+<div class="line"><a name="l04955"></a><span class="lineno"> 4955</span>&#160;        <span class="keywordflow">if</span>(index &lt; oldCount)</div>
+<div class="line"><a name="l04956"></a><span class="lineno"> 4956</span>&#160;        {</div>
+<div class="line"><a name="l04957"></a><span class="lineno"> 4957</span>&#160;            memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l04958"></a><span class="lineno"> 4958</span>&#160;        }</div>
+<div class="line"><a name="l04959"></a><span class="lineno"> 4959</span>&#160;        m_pArray[index] = src;</div>
+<div class="line"><a name="l04960"></a><span class="lineno"> 4960</span>&#160;    }</div>
+<div class="line"><a name="l04961"></a><span class="lineno"> 4961</span>&#160; </div>
+<div class="line"><a name="l04962"></a><span class="lineno"> 4962</span>&#160;    <span class="keywordtype">void</span> remove(<span class="keywordtype">size_t</span> index)</div>
+<div class="line"><a name="l04963"></a><span class="lineno"> 4963</span>&#160;    {</div>
+<div class="line"><a name="l04964"></a><span class="lineno"> 4964</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
+<div class="line"><a name="l04965"></a><span class="lineno"> 4965</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> oldCount = size();</div>
+<div class="line"><a name="l04966"></a><span class="lineno"> 4966</span>&#160;        <span class="keywordflow">if</span>(index &lt; oldCount - 1)</div>
+<div class="line"><a name="l04967"></a><span class="lineno"> 4967</span>&#160;        {</div>
+<div class="line"><a name="l04968"></a><span class="lineno"> 4968</span>&#160;            memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l04969"></a><span class="lineno"> 4969</span>&#160;        }</div>
+<div class="line"><a name="l04970"></a><span class="lineno"> 4970</span>&#160;        resize(oldCount - 1);</div>
+<div class="line"><a name="l04971"></a><span class="lineno"> 4971</span>&#160;    }</div>
+<div class="line"><a name="l04972"></a><span class="lineno"> 4972</span>&#160; </div>
+<div class="line"><a name="l04973"></a><span class="lineno"> 4973</span>&#160;    <span class="keywordtype">void</span> push_back(<span class="keyword">const</span> T&amp; src)</div>
+<div class="line"><a name="l04974"></a><span class="lineno"> 4974</span>&#160;    {</div>
+<div class="line"><a name="l04975"></a><span class="lineno"> 4975</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> newIndex = size();</div>
+<div class="line"><a name="l04976"></a><span class="lineno"> 4976</span>&#160;        resize(newIndex + 1);</div>
+<div class="line"><a name="l04977"></a><span class="lineno"> 4977</span>&#160;        m_pArray[newIndex] = src;</div>
+<div class="line"><a name="l04978"></a><span class="lineno"> 4978</span>&#160;    }</div>
+<div class="line"><a name="l04979"></a><span class="lineno"> 4979</span>&#160; </div>
+<div class="line"><a name="l04980"></a><span class="lineno"> 4980</span>&#160;    <span class="keywordtype">void</span> pop_back()</div>
+<div class="line"><a name="l04981"></a><span class="lineno"> 4981</span>&#160;    {</div>
+<div class="line"><a name="l04982"></a><span class="lineno"> 4982</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l04983"></a><span class="lineno"> 4983</span>&#160;        resize(size() - 1);</div>
+<div class="line"><a name="l04984"></a><span class="lineno"> 4984</span>&#160;    }</div>
+<div class="line"><a name="l04985"></a><span class="lineno"> 4985</span>&#160; </div>
+<div class="line"><a name="l04986"></a><span class="lineno"> 4986</span>&#160;    <span class="keywordtype">void</span> push_front(<span class="keyword">const</span> T&amp; src)</div>
+<div class="line"><a name="l04987"></a><span class="lineno"> 4987</span>&#160;    {</div>
+<div class="line"><a name="l04988"></a><span class="lineno"> 4988</span>&#160;        insert(0, src);</div>
+<div class="line"><a name="l04989"></a><span class="lineno"> 4989</span>&#160;    }</div>
+<div class="line"><a name="l04990"></a><span class="lineno"> 4990</span>&#160; </div>
+<div class="line"><a name="l04991"></a><span class="lineno"> 4991</span>&#160;    <span class="keywordtype">void</span> pop_front()</div>
+<div class="line"><a name="l04992"></a><span class="lineno"> 4992</span>&#160;    {</div>
+<div class="line"><a name="l04993"></a><span class="lineno"> 4993</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l04994"></a><span class="lineno"> 4994</span>&#160;        remove(0);</div>
+<div class="line"><a name="l04995"></a><span class="lineno"> 4995</span>&#160;    }</div>
+<div class="line"><a name="l04996"></a><span class="lineno"> 4996</span>&#160; </div>
+<div class="line"><a name="l04997"></a><span class="lineno"> 4997</span>&#160;    <span class="keyword">typedef</span> T* iterator;</div>
+<div class="line"><a name="l04998"></a><span class="lineno"> 4998</span>&#160; </div>
+<div class="line"><a name="l04999"></a><span class="lineno"> 4999</span>&#160;    iterator begin() { <span class="keywordflow">return</span> m_pArray; }</div>
+<div class="line"><a name="l05000"></a><span class="lineno"> 5000</span>&#160;    iterator end() { <span class="keywordflow">return</span> m_pArray + m_Count; }</div>
+<div class="line"><a name="l05001"></a><span class="lineno"> 5001</span>&#160; </div>
+<div class="line"><a name="l05002"></a><span class="lineno"> 5002</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l05003"></a><span class="lineno"> 5003</span>&#160;    AllocatorT m_Allocator;</div>
+<div class="line"><a name="l05004"></a><span class="lineno"> 5004</span>&#160;    T* m_pArray;</div>
+<div class="line"><a name="l05005"></a><span class="lineno"> 5005</span>&#160;    <span class="keywordtype">size_t</span> m_Count;</div>
+<div class="line"><a name="l05006"></a><span class="lineno"> 5006</span>&#160;    <span class="keywordtype">size_t</span> m_Capacity;</div>
+<div class="line"><a name="l05007"></a><span class="lineno"> 5007</span>&#160;};</div>
+<div class="line"><a name="l05008"></a><span class="lineno"> 5008</span>&#160; </div>
+<div class="line"><a name="l05009"></a><span class="lineno"> 5009</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> allocatorT&gt;</div>
+<div class="line"><a name="l05010"></a><span class="lineno"> 5010</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaVectorInsert(VmaVector&lt;T, allocatorT&gt;&amp; vec, <span class="keywordtype">size_t</span> index, <span class="keyword">const</span> T&amp; item)</div>
+<div class="line"><a name="l05011"></a><span class="lineno"> 5011</span>&#160;{</div>
+<div class="line"><a name="l05012"></a><span class="lineno"> 5012</span>&#160;    vec.insert(index, item);</div>
+<div class="line"><a name="l05013"></a><span class="lineno"> 5013</span>&#160;}</div>
+<div class="line"><a name="l05014"></a><span class="lineno"> 5014</span>&#160; </div>
+<div class="line"><a name="l05015"></a><span class="lineno"> 5015</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> allocatorT&gt;</div>
+<div class="line"><a name="l05016"></a><span class="lineno"> 5016</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> VmaVectorRemove(VmaVector&lt;T, allocatorT&gt;&amp; vec, <span class="keywordtype">size_t</span> index)</div>
+<div class="line"><a name="l05017"></a><span class="lineno"> 5017</span>&#160;{</div>
+<div class="line"><a name="l05018"></a><span class="lineno"> 5018</span>&#160;    vec.remove(index);</div>
+<div class="line"><a name="l05019"></a><span class="lineno"> 5019</span>&#160;}</div>
+<div class="line"><a name="l05020"></a><span class="lineno"> 5020</span>&#160; </div>
+<div class="line"><a name="l05021"></a><span class="lineno"> 5021</span>&#160;<span class="preprocessor">#endif // #if VMA_USE_STL_VECTOR</span></div>
+<div class="line"><a name="l05022"></a><span class="lineno"> 5022</span>&#160; </div>
+<div class="line"><a name="l05023"></a><span class="lineno"> 5023</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> CmpLess, <span class="keyword">typename</span> VectorT&gt;</div>
+<div class="line"><a name="l05024"></a><span class="lineno"> 5024</span>&#160;<span class="keywordtype">size_t</span> VmaVectorInsertSorted(VectorT&amp; vector, <span class="keyword">const</span> <span class="keyword">typename</span> VectorT::value_type&amp; value)</div>
+<div class="line"><a name="l05025"></a><span class="lineno"> 5025</span>&#160;{</div>
+<div class="line"><a name="l05026"></a><span class="lineno"> 5026</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">size_t</span> indexToInsert = VmaBinaryFindFirstNotLess(</div>
+<div class="line"><a name="l05027"></a><span class="lineno"> 5027</span>&#160;        vector.data(),</div>
+<div class="line"><a name="l05028"></a><span class="lineno"> 5028</span>&#160;        vector.data() + vector.size(),</div>
+<div class="line"><a name="l05029"></a><span class="lineno"> 5029</span>&#160;        value,</div>
+<div class="line"><a name="l05030"></a><span class="lineno"> 5030</span>&#160;        CmpLess()) - vector.data();</div>
+<div class="line"><a name="l05031"></a><span class="lineno"> 5031</span>&#160;    VmaVectorInsert(vector, indexToInsert, value);</div>
+<div class="line"><a name="l05032"></a><span class="lineno"> 5032</span>&#160;    <span class="keywordflow">return</span> indexToInsert;</div>
+<div class="line"><a name="l05033"></a><span class="lineno"> 5033</span>&#160;}</div>
+<div class="line"><a name="l05034"></a><span class="lineno"> 5034</span>&#160; </div>
+<div class="line"><a name="l05035"></a><span class="lineno"> 5035</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> CmpLess, <span class="keyword">typename</span> VectorT&gt;</div>
+<div class="line"><a name="l05036"></a><span class="lineno"> 5036</span>&#160;<span class="keywordtype">bool</span> VmaVectorRemoveSorted(VectorT&amp; vector, <span class="keyword">const</span> <span class="keyword">typename</span> VectorT::value_type&amp; value)</div>
+<div class="line"><a name="l05037"></a><span class="lineno"> 5037</span>&#160;{</div>
+<div class="line"><a name="l05038"></a><span class="lineno"> 5038</span>&#160;    CmpLess comparator;</div>
+<div class="line"><a name="l05039"></a><span class="lineno"> 5039</span>&#160;    <span class="keyword">typename</span> VectorT::iterator it = VmaBinaryFindFirstNotLess(</div>
+<div class="line"><a name="l05040"></a><span class="lineno"> 5040</span>&#160;        vector.begin(),</div>
+<div class="line"><a name="l05041"></a><span class="lineno"> 5041</span>&#160;        vector.end(),</div>
+<div class="line"><a name="l05042"></a><span class="lineno"> 5042</span>&#160;        value,</div>
+<div class="line"><a name="l05043"></a><span class="lineno"> 5043</span>&#160;        comparator);</div>
+<div class="line"><a name="l05044"></a><span class="lineno"> 5044</span>&#160;    <span class="keywordflow">if</span>((it != vector.end()) &amp;&amp; !comparator(*it, value) &amp;&amp; !comparator(value, *it))</div>
+<div class="line"><a name="l05045"></a><span class="lineno"> 5045</span>&#160;    {</div>
+<div class="line"><a name="l05046"></a><span class="lineno"> 5046</span>&#160;        <span class="keywordtype">size_t</span> indexToRemove = it - vector.begin();</div>
+<div class="line"><a name="l05047"></a><span class="lineno"> 5047</span>&#160;        VmaVectorRemove(vector, indexToRemove);</div>
+<div class="line"><a name="l05048"></a><span class="lineno"> 5048</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
 <div class="line"><a name="l05049"></a><span class="lineno"> 5049</span>&#160;    }</div>
-<div class="line"><a name="l05050"></a><span class="lineno"> 5050</span>&#160;    VmaSmallVector(<span class="keywordtype">size_t</span> count, <span class="keyword">const</span> AllocatorT&amp; allocator) :</div>
-<div class="line"><a name="l05051"></a><span class="lineno"> 5051</span>&#160;        m_Count(count),</div>
-<div class="line"><a name="l05052"></a><span class="lineno"> 5052</span>&#160;        m_DynamicArray(count &gt; N ? count : 0, allocator)</div>
-<div class="line"><a name="l05053"></a><span class="lineno"> 5053</span>&#160;    {</div>
-<div class="line"><a name="l05054"></a><span class="lineno"> 5054</span>&#160;    }</div>
-<div class="line"><a name="l05055"></a><span class="lineno"> 5055</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> SrcT, <span class="keyword">typename</span> SrcAllocatorT, <span class="keywordtype">size_t</span> SrcN&gt;</div>
-<div class="line"><a name="l05056"></a><span class="lineno"> 5056</span>&#160;    VmaSmallVector(<span class="keyword">const</span> VmaSmallVector&lt;SrcT, SrcAllocatorT, SrcN&gt;&amp; src) = <span class="keyword">delete</span>;</div>
-<div class="line"><a name="l05057"></a><span class="lineno"> 5057</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> SrcT, <span class="keyword">typename</span> SrcAllocatorT, <span class="keywordtype">size_t</span> SrcN&gt;</div>
-<div class="line"><a name="l05058"></a><span class="lineno"> 5058</span>&#160;    VmaSmallVector&lt;T, AllocatorT, N&gt;&amp; operator=(<span class="keyword">const</span> VmaSmallVector&lt;SrcT, SrcAllocatorT, SrcN&gt;&amp; rhs) = <span class="keyword">delete</span>;</div>
-<div class="line"><a name="l05059"></a><span class="lineno"> 5059</span>&#160; </div>
-<div class="line"><a name="l05060"></a><span class="lineno"> 5060</span>&#160;    <span class="keywordtype">bool</span> empty()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count == 0; }</div>
-<div class="line"><a name="l05061"></a><span class="lineno"> 5061</span>&#160;    <span class="keywordtype">size_t</span> size()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count; }</div>
-<div class="line"><a name="l05062"></a><span class="lineno"> 5062</span>&#160;    T* data() { <span class="keywordflow">return</span> m_Count &gt; N ? m_DynamicArray.data() : m_StaticArray; }</div>
-<div class="line"><a name="l05063"></a><span class="lineno"> 5063</span>&#160;    <span class="keyword">const</span> T* data()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count &gt; N ? m_DynamicArray.data() : m_StaticArray; }</div>
-<div class="line"><a name="l05064"></a><span class="lineno"> 5064</span>&#160; </div>
-<div class="line"><a name="l05065"></a><span class="lineno"> 5065</span>&#160;    T&amp; operator[](<span class="keywordtype">size_t</span> index)</div>
-<div class="line"><a name="l05066"></a><span class="lineno"> 5066</span>&#160;    {</div>
-<div class="line"><a name="l05067"></a><span class="lineno"> 5067</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
-<div class="line"><a name="l05068"></a><span class="lineno"> 5068</span>&#160;        <span class="keywordflow">return</span> data()[index];</div>
-<div class="line"><a name="l05069"></a><span class="lineno"> 5069</span>&#160;    }</div>
-<div class="line"><a name="l05070"></a><span class="lineno"> 5070</span>&#160;    <span class="keyword">const</span> T&amp; operator[](<span class="keywordtype">size_t</span> index)<span class="keyword"> const</span></div>
-<div class="line"><a name="l05071"></a><span class="lineno"> 5071</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l05072"></a><span class="lineno"> 5072</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
-<div class="line"><a name="l05073"></a><span class="lineno"> 5073</span>&#160;        <span class="keywordflow">return</span> data()[index];</div>
+<div class="line"><a name="l05050"></a><span class="lineno"> 5050</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l05051"></a><span class="lineno"> 5051</span>&#160;}</div>
+<div class="line"><a name="l05052"></a><span class="lineno"> 5052</span>&#160; </div>
+<div class="line"><a name="l05054"></a><span class="lineno"> 5054</span>&#160;<span class="comment">// class VmaSmallVector</span></div>
+<div class="line"><a name="l05055"></a><span class="lineno"> 5055</span>&#160; </div>
+<div class="line"><a name="l05056"></a><span class="lineno"> 5056</span>&#160;<span class="comment">/*</span></div>
+<div class="line"><a name="l05057"></a><span class="lineno"> 5057</span>&#160;<span class="comment">This is a vector (a variable-sized array), optimized for the case when the array is small.</span></div>
+<div class="line"><a name="l05058"></a><span class="lineno"> 5058</span>&#160;<span class="comment"></span> </div>
+<div class="line"><a name="l05059"></a><span class="lineno"> 5059</span>&#160;<span class="comment">It contains some number of elements in-place, which allows it to avoid heap allocation</span></div>
+<div class="line"><a name="l05060"></a><span class="lineno"> 5060</span>&#160;<span class="comment">when the actual number of elements is below that threshold. This allows normal &quot;small&quot;</span></div>
+<div class="line"><a name="l05061"></a><span class="lineno"> 5061</span>&#160;<span class="comment">cases to be fast without losing generality for large inputs.</span></div>
+<div class="line"><a name="l05062"></a><span class="lineno"> 5062</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l05063"></a><span class="lineno"> 5063</span>&#160; </div>
+<div class="line"><a name="l05064"></a><span class="lineno"> 5064</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> AllocatorT, <span class="keywordtype">size_t</span> N&gt;</div>
+<div class="line"><a name="l05065"></a><span class="lineno"> 5065</span>&#160;<span class="keyword">class </span>VmaSmallVector</div>
+<div class="line"><a name="l05066"></a><span class="lineno"> 5066</span>&#160;{</div>
+<div class="line"><a name="l05067"></a><span class="lineno"> 5067</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l05068"></a><span class="lineno"> 5068</span>&#160;    <span class="keyword">typedef</span> T value_type;</div>
+<div class="line"><a name="l05069"></a><span class="lineno"> 5069</span>&#160; </div>
+<div class="line"><a name="l05070"></a><span class="lineno"> 5070</span>&#160;    VmaSmallVector(<span class="keyword">const</span> AllocatorT&amp; allocator) :</div>
+<div class="line"><a name="l05071"></a><span class="lineno"> 5071</span>&#160;        m_Count(0),</div>
+<div class="line"><a name="l05072"></a><span class="lineno"> 5072</span>&#160;        m_DynamicArray(allocator)</div>
+<div class="line"><a name="l05073"></a><span class="lineno"> 5073</span>&#160;    {</div>
 <div class="line"><a name="l05074"></a><span class="lineno"> 5074</span>&#160;    }</div>
-<div class="line"><a name="l05075"></a><span class="lineno"> 5075</span>&#160; </div>
-<div class="line"><a name="l05076"></a><span class="lineno"> 5076</span>&#160;    T&amp; front()</div>
-<div class="line"><a name="l05077"></a><span class="lineno"> 5077</span>&#160;    {</div>
-<div class="line"><a name="l05078"></a><span class="lineno"> 5078</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l05079"></a><span class="lineno"> 5079</span>&#160;        <span class="keywordflow">return</span> data()[0];</div>
-<div class="line"><a name="l05080"></a><span class="lineno"> 5080</span>&#160;    }</div>
-<div class="line"><a name="l05081"></a><span class="lineno"> 5081</span>&#160;    <span class="keyword">const</span> T&amp; front()<span class="keyword"> const</span></div>
-<div class="line"><a name="l05082"></a><span class="lineno"> 5082</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l05083"></a><span class="lineno"> 5083</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l05084"></a><span class="lineno"> 5084</span>&#160;        <span class="keywordflow">return</span> data()[0];</div>
-<div class="line"><a name="l05085"></a><span class="lineno"> 5085</span>&#160;    }</div>
-<div class="line"><a name="l05086"></a><span class="lineno"> 5086</span>&#160;    T&amp; back()</div>
-<div class="line"><a name="l05087"></a><span class="lineno"> 5087</span>&#160;    {</div>
-<div class="line"><a name="l05088"></a><span class="lineno"> 5088</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l05089"></a><span class="lineno"> 5089</span>&#160;        <span class="keywordflow">return</span> data()[m_Count - 1];</div>
-<div class="line"><a name="l05090"></a><span class="lineno"> 5090</span>&#160;    }</div>
-<div class="line"><a name="l05091"></a><span class="lineno"> 5091</span>&#160;    <span class="keyword">const</span> T&amp; back()<span class="keyword"> const</span></div>
-<div class="line"><a name="l05092"></a><span class="lineno"> 5092</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l05093"></a><span class="lineno"> 5093</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l05094"></a><span class="lineno"> 5094</span>&#160;        <span class="keywordflow">return</span> data()[m_Count - 1];</div>
-<div class="line"><a name="l05095"></a><span class="lineno"> 5095</span>&#160;    }</div>
-<div class="line"><a name="l05096"></a><span class="lineno"> 5096</span>&#160; </div>
-<div class="line"><a name="l05097"></a><span class="lineno"> 5097</span>&#160;    <span class="keywordtype">void</span> resize(<span class="keywordtype">size_t</span> newCount, <span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
-<div class="line"><a name="l05098"></a><span class="lineno"> 5098</span>&#160;    {</div>
-<div class="line"><a name="l05099"></a><span class="lineno"> 5099</span>&#160;        <span class="keywordflow">if</span>(newCount &gt; N &amp;&amp; m_Count &gt; N)</div>
-<div class="line"><a name="l05100"></a><span class="lineno"> 5100</span>&#160;        {</div>
-<div class="line"><a name="l05101"></a><span class="lineno"> 5101</span>&#160;            <span class="comment">// Any direction, staying in m_DynamicArray</span></div>
-<div class="line"><a name="l05102"></a><span class="lineno"> 5102</span>&#160;            m_DynamicArray.resize(newCount, freeMemory);</div>
-<div class="line"><a name="l05103"></a><span class="lineno"> 5103</span>&#160;        }</div>
-<div class="line"><a name="l05104"></a><span class="lineno"> 5104</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span>(newCount &gt; N &amp;&amp; m_Count &lt;= N)</div>
-<div class="line"><a name="l05105"></a><span class="lineno"> 5105</span>&#160;        {</div>
-<div class="line"><a name="l05106"></a><span class="lineno"> 5106</span>&#160;            <span class="comment">// Growing, moving from m_StaticArray to m_DynamicArray</span></div>
-<div class="line"><a name="l05107"></a><span class="lineno"> 5107</span>&#160;            m_DynamicArray.resize(newCount, freeMemory);</div>
-<div class="line"><a name="l05108"></a><span class="lineno"> 5108</span>&#160;            <span class="keywordflow">if</span>(m_Count &gt; 0)</div>
-<div class="line"><a name="l05109"></a><span class="lineno"> 5109</span>&#160;            {</div>
-<div class="line"><a name="l05110"></a><span class="lineno"> 5110</span>&#160;                memcpy(m_DynamicArray.data(), m_StaticArray, m_Count * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l05111"></a><span class="lineno"> 5111</span>&#160;            }</div>
-<div class="line"><a name="l05112"></a><span class="lineno"> 5112</span>&#160;        }</div>
-<div class="line"><a name="l05113"></a><span class="lineno"> 5113</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span>(newCount &lt;= N &amp;&amp; m_Count &gt; N)</div>
-<div class="line"><a name="l05114"></a><span class="lineno"> 5114</span>&#160;        {</div>
-<div class="line"><a name="l05115"></a><span class="lineno"> 5115</span>&#160;            <span class="comment">// Shrinking, moving from m_DynamicArray to m_StaticArray</span></div>
-<div class="line"><a name="l05116"></a><span class="lineno"> 5116</span>&#160;            <span class="keywordflow">if</span>(newCount &gt; 0)</div>
-<div class="line"><a name="l05117"></a><span class="lineno"> 5117</span>&#160;            {</div>
-<div class="line"><a name="l05118"></a><span class="lineno"> 5118</span>&#160;                memcpy(m_StaticArray, m_DynamicArray.data(), newCount * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l05119"></a><span class="lineno"> 5119</span>&#160;            }</div>
-<div class="line"><a name="l05120"></a><span class="lineno"> 5120</span>&#160;            m_DynamicArray.resize(0, freeMemory);</div>
-<div class="line"><a name="l05121"></a><span class="lineno"> 5121</span>&#160;        }</div>
-<div class="line"><a name="l05122"></a><span class="lineno"> 5122</span>&#160;        <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05123"></a><span class="lineno"> 5123</span>&#160;        {</div>
-<div class="line"><a name="l05124"></a><span class="lineno"> 5124</span>&#160;            <span class="comment">// Any direction, staying in m_StaticArray - nothing to do here</span></div>
-<div class="line"><a name="l05125"></a><span class="lineno"> 5125</span>&#160;        }</div>
-<div class="line"><a name="l05126"></a><span class="lineno"> 5126</span>&#160;        m_Count = newCount;</div>
-<div class="line"><a name="l05127"></a><span class="lineno"> 5127</span>&#160;    }</div>
-<div class="line"><a name="l05128"></a><span class="lineno"> 5128</span>&#160; </div>
-<div class="line"><a name="l05129"></a><span class="lineno"> 5129</span>&#160;    <span class="keywordtype">void</span> clear(<span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
-<div class="line"><a name="l05130"></a><span class="lineno"> 5130</span>&#160;    {</div>
-<div class="line"><a name="l05131"></a><span class="lineno"> 5131</span>&#160;        m_DynamicArray.clear(freeMemory);</div>
-<div class="line"><a name="l05132"></a><span class="lineno"> 5132</span>&#160;        m_Count = 0;</div>
-<div class="line"><a name="l05133"></a><span class="lineno"> 5133</span>&#160;    }</div>
-<div class="line"><a name="l05134"></a><span class="lineno"> 5134</span>&#160; </div>
-<div class="line"><a name="l05135"></a><span class="lineno"> 5135</span>&#160;    <span class="keywordtype">void</span> insert(<span class="keywordtype">size_t</span> index, <span class="keyword">const</span> T&amp; src)</div>
-<div class="line"><a name="l05136"></a><span class="lineno"> 5136</span>&#160;    {</div>
-<div class="line"><a name="l05137"></a><span class="lineno"> 5137</span>&#160;        VMA_HEAVY_ASSERT(index &lt;= m_Count);</div>
-<div class="line"><a name="l05138"></a><span class="lineno"> 5138</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> oldCount = size();</div>
-<div class="line"><a name="l05139"></a><span class="lineno"> 5139</span>&#160;        resize(oldCount + 1);</div>
-<div class="line"><a name="l05140"></a><span class="lineno"> 5140</span>&#160;        T* <span class="keyword">const</span> dataPtr = data();</div>
-<div class="line"><a name="l05141"></a><span class="lineno"> 5141</span>&#160;        <span class="keywordflow">if</span>(index &lt; oldCount)</div>
-<div class="line"><a name="l05142"></a><span class="lineno"> 5142</span>&#160;        {</div>
-<div class="line"><a name="l05143"></a><span class="lineno"> 5143</span>&#160;            <span class="comment">//  I know, this could be more optimal for case where memmove can be memcpy directly from m_StaticArray to m_DynamicArray.</span></div>
-<div class="line"><a name="l05144"></a><span class="lineno"> 5144</span>&#160;            memmove(dataPtr + (index + 1), dataPtr + index, (oldCount - index) * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l05145"></a><span class="lineno"> 5145</span>&#160;        }</div>
-<div class="line"><a name="l05146"></a><span class="lineno"> 5146</span>&#160;        dataPtr[index] = src;</div>
-<div class="line"><a name="l05147"></a><span class="lineno"> 5147</span>&#160;    }</div>
-<div class="line"><a name="l05148"></a><span class="lineno"> 5148</span>&#160; </div>
-<div class="line"><a name="l05149"></a><span class="lineno"> 5149</span>&#160;    <span class="keywordtype">void</span> remove(<span class="keywordtype">size_t</span> index)</div>
-<div class="line"><a name="l05150"></a><span class="lineno"> 5150</span>&#160;    {</div>
-<div class="line"><a name="l05151"></a><span class="lineno"> 5151</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
-<div class="line"><a name="l05152"></a><span class="lineno"> 5152</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> oldCount = size();</div>
-<div class="line"><a name="l05153"></a><span class="lineno"> 5153</span>&#160;        <span class="keywordflow">if</span>(index &lt; oldCount - 1)</div>
-<div class="line"><a name="l05154"></a><span class="lineno"> 5154</span>&#160;        {</div>
-<div class="line"><a name="l05155"></a><span class="lineno"> 5155</span>&#160;            <span class="comment">//  I know, this could be more optimal for case where memmove can be memcpy directly from m_DynamicArray to m_StaticArray.</span></div>
-<div class="line"><a name="l05156"></a><span class="lineno"> 5156</span>&#160;            T* <span class="keyword">const</span> dataPtr = data();</div>
-<div class="line"><a name="l05157"></a><span class="lineno"> 5157</span>&#160;            memmove(dataPtr + index, dataPtr + (index + 1), (oldCount - index - 1) * <span class="keyword">sizeof</span>(T));</div>
-<div class="line"><a name="l05158"></a><span class="lineno"> 5158</span>&#160;        }</div>
-<div class="line"><a name="l05159"></a><span class="lineno"> 5159</span>&#160;        resize(oldCount - 1);</div>
-<div class="line"><a name="l05160"></a><span class="lineno"> 5160</span>&#160;    }</div>
-<div class="line"><a name="l05161"></a><span class="lineno"> 5161</span>&#160; </div>
-<div class="line"><a name="l05162"></a><span class="lineno"> 5162</span>&#160;    <span class="keywordtype">void</span> push_back(<span class="keyword">const</span> T&amp; src)</div>
-<div class="line"><a name="l05163"></a><span class="lineno"> 5163</span>&#160;    {</div>
-<div class="line"><a name="l05164"></a><span class="lineno"> 5164</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> newIndex = size();</div>
-<div class="line"><a name="l05165"></a><span class="lineno"> 5165</span>&#160;        resize(newIndex + 1);</div>
-<div class="line"><a name="l05166"></a><span class="lineno"> 5166</span>&#160;        data()[newIndex] = src;</div>
-<div class="line"><a name="l05167"></a><span class="lineno"> 5167</span>&#160;    }</div>
-<div class="line"><a name="l05168"></a><span class="lineno"> 5168</span>&#160; </div>
-<div class="line"><a name="l05169"></a><span class="lineno"> 5169</span>&#160;    <span class="keywordtype">void</span> pop_back()</div>
-<div class="line"><a name="l05170"></a><span class="lineno"> 5170</span>&#160;    {</div>
-<div class="line"><a name="l05171"></a><span class="lineno"> 5171</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l05172"></a><span class="lineno"> 5172</span>&#160;        resize(size() - 1);</div>
-<div class="line"><a name="l05173"></a><span class="lineno"> 5173</span>&#160;    }</div>
-<div class="line"><a name="l05174"></a><span class="lineno"> 5174</span>&#160; </div>
-<div class="line"><a name="l05175"></a><span class="lineno"> 5175</span>&#160;    <span class="keywordtype">void</span> push_front(<span class="keyword">const</span> T&amp; src)</div>
-<div class="line"><a name="l05176"></a><span class="lineno"> 5176</span>&#160;    {</div>
-<div class="line"><a name="l05177"></a><span class="lineno"> 5177</span>&#160;        insert(0, src);</div>
-<div class="line"><a name="l05178"></a><span class="lineno"> 5178</span>&#160;    }</div>
-<div class="line"><a name="l05179"></a><span class="lineno"> 5179</span>&#160; </div>
-<div class="line"><a name="l05180"></a><span class="lineno"> 5180</span>&#160;    <span class="keywordtype">void</span> pop_front()</div>
-<div class="line"><a name="l05181"></a><span class="lineno"> 5181</span>&#160;    {</div>
-<div class="line"><a name="l05182"></a><span class="lineno"> 5182</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l05183"></a><span class="lineno"> 5183</span>&#160;        remove(0);</div>
-<div class="line"><a name="l05184"></a><span class="lineno"> 5184</span>&#160;    }</div>
-<div class="line"><a name="l05185"></a><span class="lineno"> 5185</span>&#160; </div>
-<div class="line"><a name="l05186"></a><span class="lineno"> 5186</span>&#160;    <span class="keyword">typedef</span> T* iterator;</div>
-<div class="line"><a name="l05187"></a><span class="lineno"> 5187</span>&#160; </div>
-<div class="line"><a name="l05188"></a><span class="lineno"> 5188</span>&#160;    iterator begin() { <span class="keywordflow">return</span> data(); }</div>
-<div class="line"><a name="l05189"></a><span class="lineno"> 5189</span>&#160;    iterator end() { <span class="keywordflow">return</span> data() + m_Count; }</div>
-<div class="line"><a name="l05190"></a><span class="lineno"> 5190</span>&#160; </div>
-<div class="line"><a name="l05191"></a><span class="lineno"> 5191</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l05192"></a><span class="lineno"> 5192</span>&#160;    <span class="keywordtype">size_t</span> m_Count;</div>
-<div class="line"><a name="l05193"></a><span class="lineno"> 5193</span>&#160;    T m_StaticArray[N]; <span class="comment">// Used when m_Size &lt;= N</span></div>
-<div class="line"><a name="l05194"></a><span class="lineno"> 5194</span>&#160;    VmaVector&lt;T, AllocatorT&gt; m_DynamicArray; <span class="comment">// Used when m_Size &gt; N</span></div>
-<div class="line"><a name="l05195"></a><span class="lineno"> 5195</span>&#160;};</div>
-<div class="line"><a name="l05196"></a><span class="lineno"> 5196</span>&#160; </div>
-<div class="line"><a name="l05198"></a><span class="lineno"> 5198</span>&#160;<span class="comment">// class VmaPoolAllocator</span></div>
+<div class="line"><a name="l05075"></a><span class="lineno"> 5075</span>&#160;    VmaSmallVector(<span class="keywordtype">size_t</span> count, <span class="keyword">const</span> AllocatorT&amp; allocator) :</div>
+<div class="line"><a name="l05076"></a><span class="lineno"> 5076</span>&#160;        m_Count(count),</div>
+<div class="line"><a name="l05077"></a><span class="lineno"> 5077</span>&#160;        m_DynamicArray(count &gt; N ? count : 0, allocator)</div>
+<div class="line"><a name="l05078"></a><span class="lineno"> 5078</span>&#160;    {</div>
+<div class="line"><a name="l05079"></a><span class="lineno"> 5079</span>&#160;    }</div>
+<div class="line"><a name="l05080"></a><span class="lineno"> 5080</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> SrcT, <span class="keyword">typename</span> SrcAllocatorT, <span class="keywordtype">size_t</span> SrcN&gt;</div>
+<div class="line"><a name="l05081"></a><span class="lineno"> 5081</span>&#160;    VmaSmallVector(<span class="keyword">const</span> VmaSmallVector&lt;SrcT, SrcAllocatorT, SrcN&gt;&amp; src) = <span class="keyword">delete</span>;</div>
+<div class="line"><a name="l05082"></a><span class="lineno"> 5082</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> SrcT, <span class="keyword">typename</span> SrcAllocatorT, <span class="keywordtype">size_t</span> SrcN&gt;</div>
+<div class="line"><a name="l05083"></a><span class="lineno"> 5083</span>&#160;    VmaSmallVector&lt;T, AllocatorT, N&gt;&amp; operator=(<span class="keyword">const</span> VmaSmallVector&lt;SrcT, SrcAllocatorT, SrcN&gt;&amp; rhs) = <span class="keyword">delete</span>;</div>
+<div class="line"><a name="l05084"></a><span class="lineno"> 5084</span>&#160; </div>
+<div class="line"><a name="l05085"></a><span class="lineno"> 5085</span>&#160;    <span class="keywordtype">bool</span> empty()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count == 0; }</div>
+<div class="line"><a name="l05086"></a><span class="lineno"> 5086</span>&#160;    <span class="keywordtype">size_t</span> size()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count; }</div>
+<div class="line"><a name="l05087"></a><span class="lineno"> 5087</span>&#160;    T* data() { <span class="keywordflow">return</span> m_Count &gt; N ? m_DynamicArray.data() : m_StaticArray; }</div>
+<div class="line"><a name="l05088"></a><span class="lineno"> 5088</span>&#160;    <span class="keyword">const</span> T* data()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count &gt; N ? m_DynamicArray.data() : m_StaticArray; }</div>
+<div class="line"><a name="l05089"></a><span class="lineno"> 5089</span>&#160; </div>
+<div class="line"><a name="l05090"></a><span class="lineno"> 5090</span>&#160;    T&amp; operator[](<span class="keywordtype">size_t</span> index)</div>
+<div class="line"><a name="l05091"></a><span class="lineno"> 5091</span>&#160;    {</div>
+<div class="line"><a name="l05092"></a><span class="lineno"> 5092</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
+<div class="line"><a name="l05093"></a><span class="lineno"> 5093</span>&#160;        <span class="keywordflow">return</span> data()[index];</div>
+<div class="line"><a name="l05094"></a><span class="lineno"> 5094</span>&#160;    }</div>
+<div class="line"><a name="l05095"></a><span class="lineno"> 5095</span>&#160;    <span class="keyword">const</span> T&amp; operator[](<span class="keywordtype">size_t</span> index)<span class="keyword"> const</span></div>
+<div class="line"><a name="l05096"></a><span class="lineno"> 5096</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l05097"></a><span class="lineno"> 5097</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
+<div class="line"><a name="l05098"></a><span class="lineno"> 5098</span>&#160;        <span class="keywordflow">return</span> data()[index];</div>
+<div class="line"><a name="l05099"></a><span class="lineno"> 5099</span>&#160;    }</div>
+<div class="line"><a name="l05100"></a><span class="lineno"> 5100</span>&#160; </div>
+<div class="line"><a name="l05101"></a><span class="lineno"> 5101</span>&#160;    T&amp; front()</div>
+<div class="line"><a name="l05102"></a><span class="lineno"> 5102</span>&#160;    {</div>
+<div class="line"><a name="l05103"></a><span class="lineno"> 5103</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l05104"></a><span class="lineno"> 5104</span>&#160;        <span class="keywordflow">return</span> data()[0];</div>
+<div class="line"><a name="l05105"></a><span class="lineno"> 5105</span>&#160;    }</div>
+<div class="line"><a name="l05106"></a><span class="lineno"> 5106</span>&#160;    <span class="keyword">const</span> T&amp; front()<span class="keyword"> const</span></div>
+<div class="line"><a name="l05107"></a><span class="lineno"> 5107</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l05108"></a><span class="lineno"> 5108</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l05109"></a><span class="lineno"> 5109</span>&#160;        <span class="keywordflow">return</span> data()[0];</div>
+<div class="line"><a name="l05110"></a><span class="lineno"> 5110</span>&#160;    }</div>
+<div class="line"><a name="l05111"></a><span class="lineno"> 5111</span>&#160;    T&amp; back()</div>
+<div class="line"><a name="l05112"></a><span class="lineno"> 5112</span>&#160;    {</div>
+<div class="line"><a name="l05113"></a><span class="lineno"> 5113</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l05114"></a><span class="lineno"> 5114</span>&#160;        <span class="keywordflow">return</span> data()[m_Count - 1];</div>
+<div class="line"><a name="l05115"></a><span class="lineno"> 5115</span>&#160;    }</div>
+<div class="line"><a name="l05116"></a><span class="lineno"> 5116</span>&#160;    <span class="keyword">const</span> T&amp; back()<span class="keyword"> const</span></div>
+<div class="line"><a name="l05117"></a><span class="lineno"> 5117</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l05118"></a><span class="lineno"> 5118</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l05119"></a><span class="lineno"> 5119</span>&#160;        <span class="keywordflow">return</span> data()[m_Count - 1];</div>
+<div class="line"><a name="l05120"></a><span class="lineno"> 5120</span>&#160;    }</div>
+<div class="line"><a name="l05121"></a><span class="lineno"> 5121</span>&#160; </div>
+<div class="line"><a name="l05122"></a><span class="lineno"> 5122</span>&#160;    <span class="keywordtype">void</span> resize(<span class="keywordtype">size_t</span> newCount, <span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
+<div class="line"><a name="l05123"></a><span class="lineno"> 5123</span>&#160;    {</div>
+<div class="line"><a name="l05124"></a><span class="lineno"> 5124</span>&#160;        <span class="keywordflow">if</span>(newCount &gt; N &amp;&amp; m_Count &gt; N)</div>
+<div class="line"><a name="l05125"></a><span class="lineno"> 5125</span>&#160;        {</div>
+<div class="line"><a name="l05126"></a><span class="lineno"> 5126</span>&#160;            <span class="comment">// Any direction, staying in m_DynamicArray</span></div>
+<div class="line"><a name="l05127"></a><span class="lineno"> 5127</span>&#160;            m_DynamicArray.resize(newCount, freeMemory);</div>
+<div class="line"><a name="l05128"></a><span class="lineno"> 5128</span>&#160;        }</div>
+<div class="line"><a name="l05129"></a><span class="lineno"> 5129</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span>(newCount &gt; N &amp;&amp; m_Count &lt;= N)</div>
+<div class="line"><a name="l05130"></a><span class="lineno"> 5130</span>&#160;        {</div>
+<div class="line"><a name="l05131"></a><span class="lineno"> 5131</span>&#160;            <span class="comment">// Growing, moving from m_StaticArray to m_DynamicArray</span></div>
+<div class="line"><a name="l05132"></a><span class="lineno"> 5132</span>&#160;            m_DynamicArray.resize(newCount, freeMemory);</div>
+<div class="line"><a name="l05133"></a><span class="lineno"> 5133</span>&#160;            <span class="keywordflow">if</span>(m_Count &gt; 0)</div>
+<div class="line"><a name="l05134"></a><span class="lineno"> 5134</span>&#160;            {</div>
+<div class="line"><a name="l05135"></a><span class="lineno"> 5135</span>&#160;                memcpy(m_DynamicArray.data(), m_StaticArray, m_Count * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l05136"></a><span class="lineno"> 5136</span>&#160;            }</div>
+<div class="line"><a name="l05137"></a><span class="lineno"> 5137</span>&#160;        }</div>
+<div class="line"><a name="l05138"></a><span class="lineno"> 5138</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span>(newCount &lt;= N &amp;&amp; m_Count &gt; N)</div>
+<div class="line"><a name="l05139"></a><span class="lineno"> 5139</span>&#160;        {</div>
+<div class="line"><a name="l05140"></a><span class="lineno"> 5140</span>&#160;            <span class="comment">// Shrinking, moving from m_DynamicArray to m_StaticArray</span></div>
+<div class="line"><a name="l05141"></a><span class="lineno"> 5141</span>&#160;            <span class="keywordflow">if</span>(newCount &gt; 0)</div>
+<div class="line"><a name="l05142"></a><span class="lineno"> 5142</span>&#160;            {</div>
+<div class="line"><a name="l05143"></a><span class="lineno"> 5143</span>&#160;                memcpy(m_StaticArray, m_DynamicArray.data(), newCount * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l05144"></a><span class="lineno"> 5144</span>&#160;            }</div>
+<div class="line"><a name="l05145"></a><span class="lineno"> 5145</span>&#160;            m_DynamicArray.resize(0, freeMemory);</div>
+<div class="line"><a name="l05146"></a><span class="lineno"> 5146</span>&#160;        }</div>
+<div class="line"><a name="l05147"></a><span class="lineno"> 5147</span>&#160;        <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05148"></a><span class="lineno"> 5148</span>&#160;        {</div>
+<div class="line"><a name="l05149"></a><span class="lineno"> 5149</span>&#160;            <span class="comment">// Any direction, staying in m_StaticArray - nothing to do here</span></div>
+<div class="line"><a name="l05150"></a><span class="lineno"> 5150</span>&#160;        }</div>
+<div class="line"><a name="l05151"></a><span class="lineno"> 5151</span>&#160;        m_Count = newCount;</div>
+<div class="line"><a name="l05152"></a><span class="lineno"> 5152</span>&#160;    }</div>
+<div class="line"><a name="l05153"></a><span class="lineno"> 5153</span>&#160; </div>
+<div class="line"><a name="l05154"></a><span class="lineno"> 5154</span>&#160;    <span class="keywordtype">void</span> clear(<span class="keywordtype">bool</span> freeMemory = <span class="keyword">false</span>)</div>
+<div class="line"><a name="l05155"></a><span class="lineno"> 5155</span>&#160;    {</div>
+<div class="line"><a name="l05156"></a><span class="lineno"> 5156</span>&#160;        m_DynamicArray.clear(freeMemory);</div>
+<div class="line"><a name="l05157"></a><span class="lineno"> 5157</span>&#160;        m_Count = 0;</div>
+<div class="line"><a name="l05158"></a><span class="lineno"> 5158</span>&#160;    }</div>
+<div class="line"><a name="l05159"></a><span class="lineno"> 5159</span>&#160; </div>
+<div class="line"><a name="l05160"></a><span class="lineno"> 5160</span>&#160;    <span class="keywordtype">void</span> insert(<span class="keywordtype">size_t</span> index, <span class="keyword">const</span> T&amp; src)</div>
+<div class="line"><a name="l05161"></a><span class="lineno"> 5161</span>&#160;    {</div>
+<div class="line"><a name="l05162"></a><span class="lineno"> 5162</span>&#160;        VMA_HEAVY_ASSERT(index &lt;= m_Count);</div>
+<div class="line"><a name="l05163"></a><span class="lineno"> 5163</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> oldCount = size();</div>
+<div class="line"><a name="l05164"></a><span class="lineno"> 5164</span>&#160;        resize(oldCount + 1);</div>
+<div class="line"><a name="l05165"></a><span class="lineno"> 5165</span>&#160;        T* <span class="keyword">const</span> dataPtr = data();</div>
+<div class="line"><a name="l05166"></a><span class="lineno"> 5166</span>&#160;        <span class="keywordflow">if</span>(index &lt; oldCount)</div>
+<div class="line"><a name="l05167"></a><span class="lineno"> 5167</span>&#160;        {</div>
+<div class="line"><a name="l05168"></a><span class="lineno"> 5168</span>&#160;            <span class="comment">//  I know, this could be more optimal for case where memmove can be memcpy directly from m_StaticArray to m_DynamicArray.</span></div>
+<div class="line"><a name="l05169"></a><span class="lineno"> 5169</span>&#160;            memmove(dataPtr + (index + 1), dataPtr + index, (oldCount - index) * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l05170"></a><span class="lineno"> 5170</span>&#160;        }</div>
+<div class="line"><a name="l05171"></a><span class="lineno"> 5171</span>&#160;        dataPtr[index] = src;</div>
+<div class="line"><a name="l05172"></a><span class="lineno"> 5172</span>&#160;    }</div>
+<div class="line"><a name="l05173"></a><span class="lineno"> 5173</span>&#160; </div>
+<div class="line"><a name="l05174"></a><span class="lineno"> 5174</span>&#160;    <span class="keywordtype">void</span> remove(<span class="keywordtype">size_t</span> index)</div>
+<div class="line"><a name="l05175"></a><span class="lineno"> 5175</span>&#160;    {</div>
+<div class="line"><a name="l05176"></a><span class="lineno"> 5176</span>&#160;        VMA_HEAVY_ASSERT(index &lt; m_Count);</div>
+<div class="line"><a name="l05177"></a><span class="lineno"> 5177</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> oldCount = size();</div>
+<div class="line"><a name="l05178"></a><span class="lineno"> 5178</span>&#160;        <span class="keywordflow">if</span>(index &lt; oldCount - 1)</div>
+<div class="line"><a name="l05179"></a><span class="lineno"> 5179</span>&#160;        {</div>
+<div class="line"><a name="l05180"></a><span class="lineno"> 5180</span>&#160;            <span class="comment">//  I know, this could be more optimal for case where memmove can be memcpy directly from m_DynamicArray to m_StaticArray.</span></div>
+<div class="line"><a name="l05181"></a><span class="lineno"> 5181</span>&#160;            T* <span class="keyword">const</span> dataPtr = data();</div>
+<div class="line"><a name="l05182"></a><span class="lineno"> 5182</span>&#160;            memmove(dataPtr + index, dataPtr + (index + 1), (oldCount - index - 1) * <span class="keyword">sizeof</span>(T));</div>
+<div class="line"><a name="l05183"></a><span class="lineno"> 5183</span>&#160;        }</div>
+<div class="line"><a name="l05184"></a><span class="lineno"> 5184</span>&#160;        resize(oldCount - 1);</div>
+<div class="line"><a name="l05185"></a><span class="lineno"> 5185</span>&#160;    }</div>
+<div class="line"><a name="l05186"></a><span class="lineno"> 5186</span>&#160; </div>
+<div class="line"><a name="l05187"></a><span class="lineno"> 5187</span>&#160;    <span class="keywordtype">void</span> push_back(<span class="keyword">const</span> T&amp; src)</div>
+<div class="line"><a name="l05188"></a><span class="lineno"> 5188</span>&#160;    {</div>
+<div class="line"><a name="l05189"></a><span class="lineno"> 5189</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> newIndex = size();</div>
+<div class="line"><a name="l05190"></a><span class="lineno"> 5190</span>&#160;        resize(newIndex + 1);</div>
+<div class="line"><a name="l05191"></a><span class="lineno"> 5191</span>&#160;        data()[newIndex] = src;</div>
+<div class="line"><a name="l05192"></a><span class="lineno"> 5192</span>&#160;    }</div>
+<div class="line"><a name="l05193"></a><span class="lineno"> 5193</span>&#160; </div>
+<div class="line"><a name="l05194"></a><span class="lineno"> 5194</span>&#160;    <span class="keywordtype">void</span> pop_back()</div>
+<div class="line"><a name="l05195"></a><span class="lineno"> 5195</span>&#160;    {</div>
+<div class="line"><a name="l05196"></a><span class="lineno"> 5196</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l05197"></a><span class="lineno"> 5197</span>&#160;        resize(size() - 1);</div>
+<div class="line"><a name="l05198"></a><span class="lineno"> 5198</span>&#160;    }</div>
 <div class="line"><a name="l05199"></a><span class="lineno"> 5199</span>&#160; </div>
-<div class="line"><a name="l05200"></a><span class="lineno"> 5200</span>&#160;<span class="comment">/*</span></div>
-<div class="line"><a name="l05201"></a><span class="lineno"> 5201</span>&#160;<span class="comment">Allocator for objects of type T using a list of arrays (pools) to speed up</span></div>
-<div class="line"><a name="l05202"></a><span class="lineno"> 5202</span>&#160;<span class="comment">allocation. Number of elements that can be allocated is not bounded because</span></div>
-<div class="line"><a name="l05203"></a><span class="lineno"> 5203</span>&#160;<span class="comment">allocator can create multiple blocks.</span></div>
-<div class="line"><a name="l05204"></a><span class="lineno"> 5204</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l05205"></a><span class="lineno"> 5205</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05206"></a><span class="lineno"> 5206</span>&#160;<span class="keyword">class </span>VmaPoolAllocator</div>
-<div class="line"><a name="l05207"></a><span class="lineno"> 5207</span>&#160;{</div>
-<div class="line"><a name="l05208"></a><span class="lineno"> 5208</span>&#160;    VMA_CLASS_NO_COPY(VmaPoolAllocator)</div>
-<div class="line"><a name="l05209"></a><span class="lineno"> 5209</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l05210"></a><span class="lineno"> 5210</span>&#160;    VmaPoolAllocator(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity);</div>
-<div class="line"><a name="l05211"></a><span class="lineno"> 5211</span>&#160;    ~VmaPoolAllocator();</div>
-<div class="line"><a name="l05212"></a><span class="lineno"> 5212</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span>... Types&gt; T* Alloc(Types... args);</div>
-<div class="line"><a name="l05213"></a><span class="lineno"> 5213</span>&#160;    <span class="keywordtype">void</span> Free(T* ptr);</div>
-<div class="line"><a name="l05214"></a><span class="lineno"> 5214</span>&#160; </div>
-<div class="line"><a name="l05215"></a><span class="lineno"> 5215</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l05216"></a><span class="lineno"> 5216</span>&#160;    <span class="keyword">union </span>Item</div>
-<div class="line"><a name="l05217"></a><span class="lineno"> 5217</span>&#160;    {</div>
-<div class="line"><a name="l05218"></a><span class="lineno"> 5218</span>&#160;        uint32_t NextFreeIndex;</div>
-<div class="line"><a name="l05219"></a><span class="lineno"> 5219</span>&#160;        <span class="keyword">alignas</span>(T) <span class="keywordtype">char</span> Value[<span class="keyword">sizeof</span>(T)];</div>
-<div class="line"><a name="l05220"></a><span class="lineno"> 5220</span>&#160;    };</div>
+<div class="line"><a name="l05200"></a><span class="lineno"> 5200</span>&#160;    <span class="keywordtype">void</span> push_front(<span class="keyword">const</span> T&amp; src)</div>
+<div class="line"><a name="l05201"></a><span class="lineno"> 5201</span>&#160;    {</div>
+<div class="line"><a name="l05202"></a><span class="lineno"> 5202</span>&#160;        insert(0, src);</div>
+<div class="line"><a name="l05203"></a><span class="lineno"> 5203</span>&#160;    }</div>
+<div class="line"><a name="l05204"></a><span class="lineno"> 5204</span>&#160; </div>
+<div class="line"><a name="l05205"></a><span class="lineno"> 5205</span>&#160;    <span class="keywordtype">void</span> pop_front()</div>
+<div class="line"><a name="l05206"></a><span class="lineno"> 5206</span>&#160;    {</div>
+<div class="line"><a name="l05207"></a><span class="lineno"> 5207</span>&#160;        VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l05208"></a><span class="lineno"> 5208</span>&#160;        remove(0);</div>
+<div class="line"><a name="l05209"></a><span class="lineno"> 5209</span>&#160;    }</div>
+<div class="line"><a name="l05210"></a><span class="lineno"> 5210</span>&#160; </div>
+<div class="line"><a name="l05211"></a><span class="lineno"> 5211</span>&#160;    <span class="keyword">typedef</span> T* iterator;</div>
+<div class="line"><a name="l05212"></a><span class="lineno"> 5212</span>&#160; </div>
+<div class="line"><a name="l05213"></a><span class="lineno"> 5213</span>&#160;    iterator begin() { <span class="keywordflow">return</span> data(); }</div>
+<div class="line"><a name="l05214"></a><span class="lineno"> 5214</span>&#160;    iterator end() { <span class="keywordflow">return</span> data() + m_Count; }</div>
+<div class="line"><a name="l05215"></a><span class="lineno"> 5215</span>&#160; </div>
+<div class="line"><a name="l05216"></a><span class="lineno"> 5216</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l05217"></a><span class="lineno"> 5217</span>&#160;    <span class="keywordtype">size_t</span> m_Count;</div>
+<div class="line"><a name="l05218"></a><span class="lineno"> 5218</span>&#160;    T m_StaticArray[N]; <span class="comment">// Used when m_Size &lt;= N</span></div>
+<div class="line"><a name="l05219"></a><span class="lineno"> 5219</span>&#160;    VmaVector&lt;T, AllocatorT&gt; m_DynamicArray; <span class="comment">// Used when m_Size &gt; N</span></div>
+<div class="line"><a name="l05220"></a><span class="lineno"> 5220</span>&#160;};</div>
 <div class="line"><a name="l05221"></a><span class="lineno"> 5221</span>&#160; </div>
-<div class="line"><a name="l05222"></a><span class="lineno"> 5222</span>&#160;    <span class="keyword">struct </span>ItemBlock</div>
-<div class="line"><a name="l05223"></a><span class="lineno"> 5223</span>&#160;    {</div>
-<div class="line"><a name="l05224"></a><span class="lineno"> 5224</span>&#160;        Item* pItems;</div>
-<div class="line"><a name="l05225"></a><span class="lineno"> 5225</span>&#160;        uint32_t Capacity;</div>
-<div class="line"><a name="l05226"></a><span class="lineno"> 5226</span>&#160;        uint32_t FirstFreeIndex;</div>
-<div class="line"><a name="l05227"></a><span class="lineno"> 5227</span>&#160;    };</div>
-<div class="line"><a name="l05228"></a><span class="lineno"> 5228</span>&#160;    </div>
-<div class="line"><a name="l05229"></a><span class="lineno"> 5229</span>&#160;    <span class="keyword">const</span> VkAllocationCallbacks* m_pAllocationCallbacks;</div>
-<div class="line"><a name="l05230"></a><span class="lineno"> 5230</span>&#160;    <span class="keyword">const</span> uint32_t m_FirstBlockCapacity;</div>
-<div class="line"><a name="l05231"></a><span class="lineno"> 5231</span>&#160;    VmaVector&lt; ItemBlock, VmaStlAllocator&lt;ItemBlock&gt; &gt; m_ItemBlocks;</div>
-<div class="line"><a name="l05232"></a><span class="lineno"> 5232</span>&#160; </div>
-<div class="line"><a name="l05233"></a><span class="lineno"> 5233</span>&#160;    ItemBlock&amp; CreateNewBlock();</div>
-<div class="line"><a name="l05234"></a><span class="lineno"> 5234</span>&#160;};</div>
-<div class="line"><a name="l05235"></a><span class="lineno"> 5235</span>&#160; </div>
-<div class="line"><a name="l05236"></a><span class="lineno"> 5236</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05237"></a><span class="lineno"> 5237</span>&#160;VmaPoolAllocator&lt;T&gt;::VmaPoolAllocator(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity) :</div>
-<div class="line"><a name="l05238"></a><span class="lineno"> 5238</span>&#160;    m_pAllocationCallbacks(pAllocationCallbacks),</div>
-<div class="line"><a name="l05239"></a><span class="lineno"> 5239</span>&#160;    m_FirstBlockCapacity(firstBlockCapacity),</div>
-<div class="line"><a name="l05240"></a><span class="lineno"> 5240</span>&#160;    m_ItemBlocks(VmaStlAllocator&lt;ItemBlock&gt;(pAllocationCallbacks))</div>
-<div class="line"><a name="l05241"></a><span class="lineno"> 5241</span>&#160;{</div>
-<div class="line"><a name="l05242"></a><span class="lineno"> 5242</span>&#160;    VMA_ASSERT(m_FirstBlockCapacity &gt; 1);</div>
-<div class="line"><a name="l05243"></a><span class="lineno"> 5243</span>&#160;}</div>
-<div class="line"><a name="l05244"></a><span class="lineno"> 5244</span>&#160; </div>
-<div class="line"><a name="l05245"></a><span class="lineno"> 5245</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05246"></a><span class="lineno"> 5246</span>&#160;VmaPoolAllocator&lt;T&gt;::~VmaPoolAllocator()</div>
-<div class="line"><a name="l05247"></a><span class="lineno"> 5247</span>&#160;{</div>
-<div class="line"><a name="l05248"></a><span class="lineno"> 5248</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = m_ItemBlocks.size(); i--; )</div>
-<div class="line"><a name="l05249"></a><span class="lineno"> 5249</span>&#160;        vma_delete_array(m_pAllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemBlocks[i].Capacity);</div>
-<div class="line"><a name="l05250"></a><span class="lineno"> 5250</span>&#160;    m_ItemBlocks.clear();</div>
-<div class="line"><a name="l05251"></a><span class="lineno"> 5251</span>&#160;}</div>
-<div class="line"><a name="l05252"></a><span class="lineno"> 5252</span>&#160; </div>
-<div class="line"><a name="l05253"></a><span class="lineno"> 5253</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05254"></a><span class="lineno"> 5254</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span>... Types&gt; T* VmaPoolAllocator&lt;T&gt;::Alloc(Types... args)</div>
-<div class="line"><a name="l05255"></a><span class="lineno"> 5255</span>&#160;{</div>
-<div class="line"><a name="l05256"></a><span class="lineno"> 5256</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = m_ItemBlocks.size(); i--; )</div>
-<div class="line"><a name="l05257"></a><span class="lineno"> 5257</span>&#160;    {</div>
-<div class="line"><a name="l05258"></a><span class="lineno"> 5258</span>&#160;        ItemBlock&amp; block = m_ItemBlocks[i];</div>
-<div class="line"><a name="l05259"></a><span class="lineno"> 5259</span>&#160;        <span class="comment">// This block has some free items: Use first one.</span></div>
-<div class="line"><a name="l05260"></a><span class="lineno"> 5260</span>&#160;        <span class="keywordflow">if</span>(block.FirstFreeIndex != UINT32_MAX)</div>
-<div class="line"><a name="l05261"></a><span class="lineno"> 5261</span>&#160;        {</div>
-<div class="line"><a name="l05262"></a><span class="lineno"> 5262</span>&#160;            Item* <span class="keyword">const</span> pItem = &amp;block.pItems[block.FirstFreeIndex];</div>
-<div class="line"><a name="l05263"></a><span class="lineno"> 5263</span>&#160;            block.FirstFreeIndex = pItem-&gt;NextFreeIndex;</div>
-<div class="line"><a name="l05264"></a><span class="lineno"> 5264</span>&#160;            T* result = (T*)&amp;pItem-&gt;Value;</div>
-<div class="line"><a name="l05265"></a><span class="lineno"> 5265</span>&#160;            <span class="keyword">new</span>(result)T(std::forward&lt;Types&gt;(args)...); <span class="comment">// Explicit constructor call.</span></div>
-<div class="line"><a name="l05266"></a><span class="lineno"> 5266</span>&#160;            <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l05267"></a><span class="lineno"> 5267</span>&#160;        }</div>
-<div class="line"><a name="l05268"></a><span class="lineno"> 5268</span>&#160;    }</div>
+<div class="line"><a name="l05223"></a><span class="lineno"> 5223</span>&#160;<span class="comment">// class VmaPoolAllocator</span></div>
+<div class="line"><a name="l05224"></a><span class="lineno"> 5224</span>&#160; </div>
+<div class="line"><a name="l05225"></a><span class="lineno"> 5225</span>&#160;<span class="comment">/*</span></div>
+<div class="line"><a name="l05226"></a><span class="lineno"> 5226</span>&#160;<span class="comment">Allocator for objects of type T using a list of arrays (pools) to speed up</span></div>
+<div class="line"><a name="l05227"></a><span class="lineno"> 5227</span>&#160;<span class="comment">allocation. Number of elements that can be allocated is not bounded because</span></div>
+<div class="line"><a name="l05228"></a><span class="lineno"> 5228</span>&#160;<span class="comment">allocator can create multiple blocks.</span></div>
+<div class="line"><a name="l05229"></a><span class="lineno"> 5229</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l05230"></a><span class="lineno"> 5230</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05231"></a><span class="lineno"> 5231</span>&#160;<span class="keyword">class </span>VmaPoolAllocator</div>
+<div class="line"><a name="l05232"></a><span class="lineno"> 5232</span>&#160;{</div>
+<div class="line"><a name="l05233"></a><span class="lineno"> 5233</span>&#160;    VMA_CLASS_NO_COPY(VmaPoolAllocator)</div>
+<div class="line"><a name="l05234"></a><span class="lineno"> 5234</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l05235"></a><span class="lineno"> 5235</span>&#160;    VmaPoolAllocator(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity);</div>
+<div class="line"><a name="l05236"></a><span class="lineno"> 5236</span>&#160;    ~VmaPoolAllocator();</div>
+<div class="line"><a name="l05237"></a><span class="lineno"> 5237</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span>... Types&gt; T* Alloc(Types... args);</div>
+<div class="line"><a name="l05238"></a><span class="lineno"> 5238</span>&#160;    <span class="keywordtype">void</span> Free(T* ptr);</div>
+<div class="line"><a name="l05239"></a><span class="lineno"> 5239</span>&#160; </div>
+<div class="line"><a name="l05240"></a><span class="lineno"> 5240</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l05241"></a><span class="lineno"> 5241</span>&#160;    <span class="keyword">union </span>Item</div>
+<div class="line"><a name="l05242"></a><span class="lineno"> 5242</span>&#160;    {</div>
+<div class="line"><a name="l05243"></a><span class="lineno"> 5243</span>&#160;        uint32_t NextFreeIndex;</div>
+<div class="line"><a name="l05244"></a><span class="lineno"> 5244</span>&#160;        <span class="keyword">alignas</span>(T) <span class="keywordtype">char</span> Value[<span class="keyword">sizeof</span>(T)];</div>
+<div class="line"><a name="l05245"></a><span class="lineno"> 5245</span>&#160;    };</div>
+<div class="line"><a name="l05246"></a><span class="lineno"> 5246</span>&#160; </div>
+<div class="line"><a name="l05247"></a><span class="lineno"> 5247</span>&#160;    <span class="keyword">struct </span>ItemBlock</div>
+<div class="line"><a name="l05248"></a><span class="lineno"> 5248</span>&#160;    {</div>
+<div class="line"><a name="l05249"></a><span class="lineno"> 5249</span>&#160;        Item* pItems;</div>
+<div class="line"><a name="l05250"></a><span class="lineno"> 5250</span>&#160;        uint32_t Capacity;</div>
+<div class="line"><a name="l05251"></a><span class="lineno"> 5251</span>&#160;        uint32_t FirstFreeIndex;</div>
+<div class="line"><a name="l05252"></a><span class="lineno"> 5252</span>&#160;    };</div>
+<div class="line"><a name="l05253"></a><span class="lineno"> 5253</span>&#160;    </div>
+<div class="line"><a name="l05254"></a><span class="lineno"> 5254</span>&#160;    <span class="keyword">const</span> VkAllocationCallbacks* m_pAllocationCallbacks;</div>
+<div class="line"><a name="l05255"></a><span class="lineno"> 5255</span>&#160;    <span class="keyword">const</span> uint32_t m_FirstBlockCapacity;</div>
+<div class="line"><a name="l05256"></a><span class="lineno"> 5256</span>&#160;    VmaVector&lt; ItemBlock, VmaStlAllocator&lt;ItemBlock&gt; &gt; m_ItemBlocks;</div>
+<div class="line"><a name="l05257"></a><span class="lineno"> 5257</span>&#160; </div>
+<div class="line"><a name="l05258"></a><span class="lineno"> 5258</span>&#160;    ItemBlock&amp; CreateNewBlock();</div>
+<div class="line"><a name="l05259"></a><span class="lineno"> 5259</span>&#160;};</div>
+<div class="line"><a name="l05260"></a><span class="lineno"> 5260</span>&#160; </div>
+<div class="line"><a name="l05261"></a><span class="lineno"> 5261</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05262"></a><span class="lineno"> 5262</span>&#160;VmaPoolAllocator&lt;T&gt;::VmaPoolAllocator(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity) :</div>
+<div class="line"><a name="l05263"></a><span class="lineno"> 5263</span>&#160;    m_pAllocationCallbacks(pAllocationCallbacks),</div>
+<div class="line"><a name="l05264"></a><span class="lineno"> 5264</span>&#160;    m_FirstBlockCapacity(firstBlockCapacity),</div>
+<div class="line"><a name="l05265"></a><span class="lineno"> 5265</span>&#160;    m_ItemBlocks(VmaStlAllocator&lt;ItemBlock&gt;(pAllocationCallbacks))</div>
+<div class="line"><a name="l05266"></a><span class="lineno"> 5266</span>&#160;{</div>
+<div class="line"><a name="l05267"></a><span class="lineno"> 5267</span>&#160;    VMA_ASSERT(m_FirstBlockCapacity &gt; 1);</div>
+<div class="line"><a name="l05268"></a><span class="lineno"> 5268</span>&#160;}</div>
 <div class="line"><a name="l05269"></a><span class="lineno"> 5269</span>&#160; </div>
-<div class="line"><a name="l05270"></a><span class="lineno"> 5270</span>&#160;    <span class="comment">// No block has free item: Create new one and use it.</span></div>
-<div class="line"><a name="l05271"></a><span class="lineno"> 5271</span>&#160;    ItemBlock&amp; newBlock = CreateNewBlock();</div>
-<div class="line"><a name="l05272"></a><span class="lineno"> 5272</span>&#160;    Item* <span class="keyword">const</span> pItem = &amp;newBlock.pItems[0];</div>
-<div class="line"><a name="l05273"></a><span class="lineno"> 5273</span>&#160;    newBlock.FirstFreeIndex = pItem-&gt;NextFreeIndex;</div>
-<div class="line"><a name="l05274"></a><span class="lineno"> 5274</span>&#160;    T* result = (T*)&amp;pItem-&gt;Value;</div>
-<div class="line"><a name="l05275"></a><span class="lineno"> 5275</span>&#160;    <span class="keyword">new</span>(result)T(std::forward&lt;Types&gt;(args)...); <span class="comment">// Explicit constructor call.</span></div>
-<div class="line"><a name="l05276"></a><span class="lineno"> 5276</span>&#160;    <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l05277"></a><span class="lineno"> 5277</span>&#160;}</div>
-<div class="line"><a name="l05278"></a><span class="lineno"> 5278</span>&#160; </div>
-<div class="line"><a name="l05279"></a><span class="lineno"> 5279</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05280"></a><span class="lineno"> 5280</span>&#160;<span class="keywordtype">void</span> VmaPoolAllocator&lt;T&gt;::Free(T* ptr)</div>
-<div class="line"><a name="l05281"></a><span class="lineno"> 5281</span>&#160;{</div>
-<div class="line"><a name="l05282"></a><span class="lineno"> 5282</span>&#160;    <span class="comment">// Search all memory blocks to find ptr.</span></div>
-<div class="line"><a name="l05283"></a><span class="lineno"> 5283</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = m_ItemBlocks.size(); i--; )</div>
-<div class="line"><a name="l05284"></a><span class="lineno"> 5284</span>&#160;    {</div>
-<div class="line"><a name="l05285"></a><span class="lineno"> 5285</span>&#160;        ItemBlock&amp; block = m_ItemBlocks[i];</div>
-<div class="line"><a name="l05286"></a><span class="lineno"> 5286</span>&#160;        </div>
-<div class="line"><a name="l05287"></a><span class="lineno"> 5287</span>&#160;        <span class="comment">// Casting to union.</span></div>
-<div class="line"><a name="l05288"></a><span class="lineno"> 5288</span>&#160;        Item* pItemPtr;</div>
-<div class="line"><a name="l05289"></a><span class="lineno"> 5289</span>&#160;        memcpy(&amp;pItemPtr, &amp;ptr, <span class="keyword">sizeof</span>(pItemPtr));</div>
-<div class="line"><a name="l05290"></a><span class="lineno"> 5290</span>&#160;        </div>
-<div class="line"><a name="l05291"></a><span class="lineno"> 5291</span>&#160;        <span class="comment">// Check if pItemPtr is in address range of this block.</span></div>
-<div class="line"><a name="l05292"></a><span class="lineno"> 5292</span>&#160;        <span class="keywordflow">if</span>((pItemPtr &gt;= block.pItems) &amp;&amp; (pItemPtr &lt; block.pItems + block.Capacity))</div>
-<div class="line"><a name="l05293"></a><span class="lineno"> 5293</span>&#160;        {</div>
-<div class="line"><a name="l05294"></a><span class="lineno"> 5294</span>&#160;            ptr-&gt;~T(); <span class="comment">// Explicit destructor call.</span></div>
-<div class="line"><a name="l05295"></a><span class="lineno"> 5295</span>&#160;            <span class="keyword">const</span> uint32_t index = <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(pItemPtr - block.pItems);</div>
-<div class="line"><a name="l05296"></a><span class="lineno"> 5296</span>&#160;            pItemPtr-&gt;NextFreeIndex = block.FirstFreeIndex;</div>
-<div class="line"><a name="l05297"></a><span class="lineno"> 5297</span>&#160;            block.FirstFreeIndex = index;</div>
-<div class="line"><a name="l05298"></a><span class="lineno"> 5298</span>&#160;            <span class="keywordflow">return</span>;</div>
-<div class="line"><a name="l05299"></a><span class="lineno"> 5299</span>&#160;        }</div>
-<div class="line"><a name="l05300"></a><span class="lineno"> 5300</span>&#160;    }</div>
-<div class="line"><a name="l05301"></a><span class="lineno"> 5301</span>&#160;    VMA_ASSERT(0 &amp;&amp; <span class="stringliteral">&quot;Pointer doesn&#39;t belong to this memory pool.&quot;</span>);</div>
+<div class="line"><a name="l05270"></a><span class="lineno"> 5270</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05271"></a><span class="lineno"> 5271</span>&#160;VmaPoolAllocator&lt;T&gt;::~VmaPoolAllocator()</div>
+<div class="line"><a name="l05272"></a><span class="lineno"> 5272</span>&#160;{</div>
+<div class="line"><a name="l05273"></a><span class="lineno"> 5273</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = m_ItemBlocks.size(); i--; )</div>
+<div class="line"><a name="l05274"></a><span class="lineno"> 5274</span>&#160;        vma_delete_array(m_pAllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemBlocks[i].Capacity);</div>
+<div class="line"><a name="l05275"></a><span class="lineno"> 5275</span>&#160;    m_ItemBlocks.clear();</div>
+<div class="line"><a name="l05276"></a><span class="lineno"> 5276</span>&#160;}</div>
+<div class="line"><a name="l05277"></a><span class="lineno"> 5277</span>&#160; </div>
+<div class="line"><a name="l05278"></a><span class="lineno"> 5278</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05279"></a><span class="lineno"> 5279</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span>... Types&gt; T* VmaPoolAllocator&lt;T&gt;::Alloc(Types... args)</div>
+<div class="line"><a name="l05280"></a><span class="lineno"> 5280</span>&#160;{</div>
+<div class="line"><a name="l05281"></a><span class="lineno"> 5281</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = m_ItemBlocks.size(); i--; )</div>
+<div class="line"><a name="l05282"></a><span class="lineno"> 5282</span>&#160;    {</div>
+<div class="line"><a name="l05283"></a><span class="lineno"> 5283</span>&#160;        ItemBlock&amp; block = m_ItemBlocks[i];</div>
+<div class="line"><a name="l05284"></a><span class="lineno"> 5284</span>&#160;        <span class="comment">// This block has some free items: Use first one.</span></div>
+<div class="line"><a name="l05285"></a><span class="lineno"> 5285</span>&#160;        <span class="keywordflow">if</span>(block.FirstFreeIndex != UINT32_MAX)</div>
+<div class="line"><a name="l05286"></a><span class="lineno"> 5286</span>&#160;        {</div>
+<div class="line"><a name="l05287"></a><span class="lineno"> 5287</span>&#160;            Item* <span class="keyword">const</span> pItem = &amp;block.pItems[block.FirstFreeIndex];</div>
+<div class="line"><a name="l05288"></a><span class="lineno"> 5288</span>&#160;            block.FirstFreeIndex = pItem-&gt;NextFreeIndex;</div>
+<div class="line"><a name="l05289"></a><span class="lineno"> 5289</span>&#160;            T* result = (T*)&amp;pItem-&gt;Value;</div>
+<div class="line"><a name="l05290"></a><span class="lineno"> 5290</span>&#160;            <span class="keyword">new</span>(result)T(std::forward&lt;Types&gt;(args)...); <span class="comment">// Explicit constructor call.</span></div>
+<div class="line"><a name="l05291"></a><span class="lineno"> 5291</span>&#160;            <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l05292"></a><span class="lineno"> 5292</span>&#160;        }</div>
+<div class="line"><a name="l05293"></a><span class="lineno"> 5293</span>&#160;    }</div>
+<div class="line"><a name="l05294"></a><span class="lineno"> 5294</span>&#160; </div>
+<div class="line"><a name="l05295"></a><span class="lineno"> 5295</span>&#160;    <span class="comment">// No block has free item: Create new one and use it.</span></div>
+<div class="line"><a name="l05296"></a><span class="lineno"> 5296</span>&#160;    ItemBlock&amp; newBlock = CreateNewBlock();</div>
+<div class="line"><a name="l05297"></a><span class="lineno"> 5297</span>&#160;    Item* <span class="keyword">const</span> pItem = &amp;newBlock.pItems[0];</div>
+<div class="line"><a name="l05298"></a><span class="lineno"> 5298</span>&#160;    newBlock.FirstFreeIndex = pItem-&gt;NextFreeIndex;</div>
+<div class="line"><a name="l05299"></a><span class="lineno"> 5299</span>&#160;    T* result = (T*)&amp;pItem-&gt;Value;</div>
+<div class="line"><a name="l05300"></a><span class="lineno"> 5300</span>&#160;    <span class="keyword">new</span>(result)T(std::forward&lt;Types&gt;(args)...); <span class="comment">// Explicit constructor call.</span></div>
+<div class="line"><a name="l05301"></a><span class="lineno"> 5301</span>&#160;    <span class="keywordflow">return</span> result;</div>
 <div class="line"><a name="l05302"></a><span class="lineno"> 5302</span>&#160;}</div>
 <div class="line"><a name="l05303"></a><span class="lineno"> 5303</span>&#160; </div>
 <div class="line"><a name="l05304"></a><span class="lineno"> 5304</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05305"></a><span class="lineno"> 5305</span>&#160;<span class="keyword">typename</span> VmaPoolAllocator&lt;T&gt;::ItemBlock&amp; VmaPoolAllocator&lt;T&gt;::CreateNewBlock()</div>
+<div class="line"><a name="l05305"></a><span class="lineno"> 5305</span>&#160;<span class="keywordtype">void</span> VmaPoolAllocator&lt;T&gt;::Free(T* ptr)</div>
 <div class="line"><a name="l05306"></a><span class="lineno"> 5306</span>&#160;{</div>
-<div class="line"><a name="l05307"></a><span class="lineno"> 5307</span>&#160;    <span class="keyword">const</span> uint32_t newBlockCapacity = m_ItemBlocks.empty() ?</div>
-<div class="line"><a name="l05308"></a><span class="lineno"> 5308</span>&#160;        m_FirstBlockCapacity : m_ItemBlocks.back().Capacity * 3 / 2;</div>
-<div class="line"><a name="l05309"></a><span class="lineno"> 5309</span>&#160; </div>
-<div class="line"><a name="l05310"></a><span class="lineno"> 5310</span>&#160;    <span class="keyword">const</span> ItemBlock newBlock = {</div>
-<div class="line"><a name="l05311"></a><span class="lineno"> 5311</span>&#160;        vma_new_array(m_pAllocationCallbacks, Item, newBlockCapacity),</div>
-<div class="line"><a name="l05312"></a><span class="lineno"> 5312</span>&#160;        newBlockCapacity,</div>
-<div class="line"><a name="l05313"></a><span class="lineno"> 5313</span>&#160;        0 };</div>
-<div class="line"><a name="l05314"></a><span class="lineno"> 5314</span>&#160; </div>
-<div class="line"><a name="l05315"></a><span class="lineno"> 5315</span>&#160;    m_ItemBlocks.push_back(newBlock);</div>
-<div class="line"><a name="l05316"></a><span class="lineno"> 5316</span>&#160; </div>
-<div class="line"><a name="l05317"></a><span class="lineno"> 5317</span>&#160;    <span class="comment">// Setup singly-linked list of all free items in this block.</span></div>
-<div class="line"><a name="l05318"></a><span class="lineno"> 5318</span>&#160;    <span class="keywordflow">for</span>(uint32_t i = 0; i &lt; newBlockCapacity - 1; ++i)</div>
-<div class="line"><a name="l05319"></a><span class="lineno"> 5319</span>&#160;        newBlock.pItems[i].NextFreeIndex = i + 1;</div>
-<div class="line"><a name="l05320"></a><span class="lineno"> 5320</span>&#160;    newBlock.pItems[newBlockCapacity - 1].NextFreeIndex = UINT32_MAX;</div>
-<div class="line"><a name="l05321"></a><span class="lineno"> 5321</span>&#160;    <span class="keywordflow">return</span> m_ItemBlocks.back();</div>
-<div class="line"><a name="l05322"></a><span class="lineno"> 5322</span>&#160;}</div>
-<div class="line"><a name="l05323"></a><span class="lineno"> 5323</span>&#160; </div>
-<div class="line"><a name="l05325"></a><span class="lineno"> 5325</span>&#160;<span class="comment">// class VmaRawList, VmaList</span></div>
-<div class="line"><a name="l05326"></a><span class="lineno"> 5326</span>&#160; </div>
-<div class="line"><a name="l05327"></a><span class="lineno"> 5327</span>&#160;<span class="preprocessor">#if VMA_USE_STL_LIST</span></div>
+<div class="line"><a name="l05307"></a><span class="lineno"> 5307</span>&#160;    <span class="comment">// Search all memory blocks to find ptr.</span></div>
+<div class="line"><a name="l05308"></a><span class="lineno"> 5308</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = m_ItemBlocks.size(); i--; )</div>
+<div class="line"><a name="l05309"></a><span class="lineno"> 5309</span>&#160;    {</div>
+<div class="line"><a name="l05310"></a><span class="lineno"> 5310</span>&#160;        ItemBlock&amp; block = m_ItemBlocks[i];</div>
+<div class="line"><a name="l05311"></a><span class="lineno"> 5311</span>&#160;        </div>
+<div class="line"><a name="l05312"></a><span class="lineno"> 5312</span>&#160;        <span class="comment">// Casting to union.</span></div>
+<div class="line"><a name="l05313"></a><span class="lineno"> 5313</span>&#160;        Item* pItemPtr;</div>
+<div class="line"><a name="l05314"></a><span class="lineno"> 5314</span>&#160;        memcpy(&amp;pItemPtr, &amp;ptr, <span class="keyword">sizeof</span>(pItemPtr));</div>
+<div class="line"><a name="l05315"></a><span class="lineno"> 5315</span>&#160;        </div>
+<div class="line"><a name="l05316"></a><span class="lineno"> 5316</span>&#160;        <span class="comment">// Check if pItemPtr is in address range of this block.</span></div>
+<div class="line"><a name="l05317"></a><span class="lineno"> 5317</span>&#160;        <span class="keywordflow">if</span>((pItemPtr &gt;= block.pItems) &amp;&amp; (pItemPtr &lt; block.pItems + block.Capacity))</div>
+<div class="line"><a name="l05318"></a><span class="lineno"> 5318</span>&#160;        {</div>
+<div class="line"><a name="l05319"></a><span class="lineno"> 5319</span>&#160;            ptr-&gt;~T(); <span class="comment">// Explicit destructor call.</span></div>
+<div class="line"><a name="l05320"></a><span class="lineno"> 5320</span>&#160;            <span class="keyword">const</span> uint32_t index = <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(pItemPtr - block.pItems);</div>
+<div class="line"><a name="l05321"></a><span class="lineno"> 5321</span>&#160;            pItemPtr-&gt;NextFreeIndex = block.FirstFreeIndex;</div>
+<div class="line"><a name="l05322"></a><span class="lineno"> 5322</span>&#160;            block.FirstFreeIndex = index;</div>
+<div class="line"><a name="l05323"></a><span class="lineno"> 5323</span>&#160;            <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l05324"></a><span class="lineno"> 5324</span>&#160;        }</div>
+<div class="line"><a name="l05325"></a><span class="lineno"> 5325</span>&#160;    }</div>
+<div class="line"><a name="l05326"></a><span class="lineno"> 5326</span>&#160;    VMA_ASSERT(0 &amp;&amp; <span class="stringliteral">&quot;Pointer doesn&#39;t belong to this memory pool.&quot;</span>);</div>
+<div class="line"><a name="l05327"></a><span class="lineno"> 5327</span>&#160;}</div>
 <div class="line"><a name="l05328"></a><span class="lineno"> 5328</span>&#160; </div>
-<div class="line"><a name="l05329"></a><span class="lineno"> 5329</span>&#160;<span class="preprocessor">#define VmaList std::list</span></div>
-<div class="line"><a name="l05330"></a><span class="lineno"> 5330</span>&#160; </div>
-<div class="line"><a name="l05331"></a><span class="lineno"> 5331</span>&#160;<span class="preprocessor">#else // #if VMA_USE_STL_LIST</span></div>
-<div class="line"><a name="l05332"></a><span class="lineno"> 5332</span>&#160; </div>
-<div class="line"><a name="l05333"></a><span class="lineno"> 5333</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05334"></a><span class="lineno"> 5334</span>&#160;<span class="keyword">struct </span>VmaListItem</div>
-<div class="line"><a name="l05335"></a><span class="lineno"> 5335</span>&#160;{</div>
-<div class="line"><a name="l05336"></a><span class="lineno"> 5336</span>&#160;    VmaListItem* pPrev;</div>
-<div class="line"><a name="l05337"></a><span class="lineno"> 5337</span>&#160;    VmaListItem* pNext;</div>
-<div class="line"><a name="l05338"></a><span class="lineno"> 5338</span>&#160;    T Value;</div>
-<div class="line"><a name="l05339"></a><span class="lineno"> 5339</span>&#160;};</div>
-<div class="line"><a name="l05340"></a><span class="lineno"> 5340</span>&#160; </div>
-<div class="line"><a name="l05341"></a><span class="lineno"> 5341</span>&#160;<span class="comment">// Doubly linked list.</span></div>
-<div class="line"><a name="l05342"></a><span class="lineno"> 5342</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05343"></a><span class="lineno"> 5343</span>&#160;<span class="keyword">class </span>VmaRawList</div>
-<div class="line"><a name="l05344"></a><span class="lineno"> 5344</span>&#160;{</div>
-<div class="line"><a name="l05345"></a><span class="lineno"> 5345</span>&#160;    VMA_CLASS_NO_COPY(VmaRawList)</div>
-<div class="line"><a name="l05346"></a><span class="lineno"> 5346</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l05347"></a><span class="lineno"> 5347</span>&#160;    <span class="keyword">typedef</span> VmaListItem&lt;T&gt; ItemType;</div>
+<div class="line"><a name="l05329"></a><span class="lineno"> 5329</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05330"></a><span class="lineno"> 5330</span>&#160;<span class="keyword">typename</span> VmaPoolAllocator&lt;T&gt;::ItemBlock&amp; VmaPoolAllocator&lt;T&gt;::CreateNewBlock()</div>
+<div class="line"><a name="l05331"></a><span class="lineno"> 5331</span>&#160;{</div>
+<div class="line"><a name="l05332"></a><span class="lineno"> 5332</span>&#160;    <span class="keyword">const</span> uint32_t newBlockCapacity = m_ItemBlocks.empty() ?</div>
+<div class="line"><a name="l05333"></a><span class="lineno"> 5333</span>&#160;        m_FirstBlockCapacity : m_ItemBlocks.back().Capacity * 3 / 2;</div>
+<div class="line"><a name="l05334"></a><span class="lineno"> 5334</span>&#160; </div>
+<div class="line"><a name="l05335"></a><span class="lineno"> 5335</span>&#160;    <span class="keyword">const</span> ItemBlock newBlock = {</div>
+<div class="line"><a name="l05336"></a><span class="lineno"> 5336</span>&#160;        vma_new_array(m_pAllocationCallbacks, Item, newBlockCapacity),</div>
+<div class="line"><a name="l05337"></a><span class="lineno"> 5337</span>&#160;        newBlockCapacity,</div>
+<div class="line"><a name="l05338"></a><span class="lineno"> 5338</span>&#160;        0 };</div>
+<div class="line"><a name="l05339"></a><span class="lineno"> 5339</span>&#160; </div>
+<div class="line"><a name="l05340"></a><span class="lineno"> 5340</span>&#160;    m_ItemBlocks.push_back(newBlock);</div>
+<div class="line"><a name="l05341"></a><span class="lineno"> 5341</span>&#160; </div>
+<div class="line"><a name="l05342"></a><span class="lineno"> 5342</span>&#160;    <span class="comment">// Setup singly-linked list of all free items in this block.</span></div>
+<div class="line"><a name="l05343"></a><span class="lineno"> 5343</span>&#160;    <span class="keywordflow">for</span>(uint32_t i = 0; i &lt; newBlockCapacity - 1; ++i)</div>
+<div class="line"><a name="l05344"></a><span class="lineno"> 5344</span>&#160;        newBlock.pItems[i].NextFreeIndex = i + 1;</div>
+<div class="line"><a name="l05345"></a><span class="lineno"> 5345</span>&#160;    newBlock.pItems[newBlockCapacity - 1].NextFreeIndex = UINT32_MAX;</div>
+<div class="line"><a name="l05346"></a><span class="lineno"> 5346</span>&#160;    <span class="keywordflow">return</span> m_ItemBlocks.back();</div>
+<div class="line"><a name="l05347"></a><span class="lineno"> 5347</span>&#160;}</div>
 <div class="line"><a name="l05348"></a><span class="lineno"> 5348</span>&#160; </div>
-<div class="line"><a name="l05349"></a><span class="lineno"> 5349</span>&#160;    VmaRawList(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks);</div>
-<div class="line"><a name="l05350"></a><span class="lineno"> 5350</span>&#160;    ~VmaRawList();</div>
-<div class="line"><a name="l05351"></a><span class="lineno"> 5351</span>&#160;    <span class="keywordtype">void</span> Clear();</div>
-<div class="line"><a name="l05352"></a><span class="lineno"> 5352</span>&#160; </div>
-<div class="line"><a name="l05353"></a><span class="lineno"> 5353</span>&#160;    <span class="keywordtype">size_t</span> GetCount()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count; }</div>
-<div class="line"><a name="l05354"></a><span class="lineno"> 5354</span>&#160;    <span class="keywordtype">bool</span> IsEmpty()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count == 0; }</div>
+<div class="line"><a name="l05350"></a><span class="lineno"> 5350</span>&#160;<span class="comment">// class VmaRawList, VmaList</span></div>
+<div class="line"><a name="l05351"></a><span class="lineno"> 5351</span>&#160; </div>
+<div class="line"><a name="l05352"></a><span class="lineno"> 5352</span>&#160;<span class="preprocessor">#if VMA_USE_STL_LIST</span></div>
+<div class="line"><a name="l05353"></a><span class="lineno"> 5353</span>&#160; </div>
+<div class="line"><a name="l05354"></a><span class="lineno"> 5354</span>&#160;<span class="preprocessor">#define VmaList std::list</span></div>
 <div class="line"><a name="l05355"></a><span class="lineno"> 5355</span>&#160; </div>
-<div class="line"><a name="l05356"></a><span class="lineno"> 5356</span>&#160;    ItemType* Front() { <span class="keywordflow">return</span> m_pFront; }</div>
-<div class="line"><a name="l05357"></a><span class="lineno"> 5357</span>&#160;    <span class="keyword">const</span> ItemType* Front()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_pFront; }</div>
-<div class="line"><a name="l05358"></a><span class="lineno"> 5358</span>&#160;    ItemType* Back() { <span class="keywordflow">return</span> m_pBack; }</div>
-<div class="line"><a name="l05359"></a><span class="lineno"> 5359</span>&#160;    <span class="keyword">const</span> ItemType* Back()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_pBack; }</div>
-<div class="line"><a name="l05360"></a><span class="lineno"> 5360</span>&#160; </div>
-<div class="line"><a name="l05361"></a><span class="lineno"> 5361</span>&#160;    ItemType* PushBack();</div>
-<div class="line"><a name="l05362"></a><span class="lineno"> 5362</span>&#160;    ItemType* PushFront();</div>
-<div class="line"><a name="l05363"></a><span class="lineno"> 5363</span>&#160;    ItemType* PushBack(<span class="keyword">const</span> T&amp; value);</div>
-<div class="line"><a name="l05364"></a><span class="lineno"> 5364</span>&#160;    ItemType* PushFront(<span class="keyword">const</span> T&amp; value);</div>
-<div class="line"><a name="l05365"></a><span class="lineno"> 5365</span>&#160;    <span class="keywordtype">void</span> PopBack();</div>
-<div class="line"><a name="l05366"></a><span class="lineno"> 5366</span>&#160;    <span class="keywordtype">void</span> PopFront();</div>
-<div class="line"><a name="l05367"></a><span class="lineno"> 5367</span>&#160;    </div>
-<div class="line"><a name="l05368"></a><span class="lineno"> 5368</span>&#160;    <span class="comment">// Item can be null - it means PushBack.</span></div>
-<div class="line"><a name="l05369"></a><span class="lineno"> 5369</span>&#160;    ItemType* InsertBefore(ItemType* pItem);</div>
-<div class="line"><a name="l05370"></a><span class="lineno"> 5370</span>&#160;    <span class="comment">// Item can be null - it means PushFront.</span></div>
-<div class="line"><a name="l05371"></a><span class="lineno"> 5371</span>&#160;    ItemType* InsertAfter(ItemType* pItem);</div>
-<div class="line"><a name="l05372"></a><span class="lineno"> 5372</span>&#160; </div>
-<div class="line"><a name="l05373"></a><span class="lineno"> 5373</span>&#160;    ItemType* InsertBefore(ItemType* pItem, <span class="keyword">const</span> T&amp; value);</div>
-<div class="line"><a name="l05374"></a><span class="lineno"> 5374</span>&#160;    ItemType* InsertAfter(ItemType* pItem, <span class="keyword">const</span> T&amp; value);</div>
-<div class="line"><a name="l05375"></a><span class="lineno"> 5375</span>&#160; </div>
-<div class="line"><a name="l05376"></a><span class="lineno"> 5376</span>&#160;    <span class="keywordtype">void</span> Remove(ItemType* pItem);</div>
+<div class="line"><a name="l05356"></a><span class="lineno"> 5356</span>&#160;<span class="preprocessor">#else // #if VMA_USE_STL_LIST</span></div>
+<div class="line"><a name="l05357"></a><span class="lineno"> 5357</span>&#160; </div>
+<div class="line"><a name="l05358"></a><span class="lineno"> 5358</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05359"></a><span class="lineno"> 5359</span>&#160;<span class="keyword">struct </span>VmaListItem</div>
+<div class="line"><a name="l05360"></a><span class="lineno"> 5360</span>&#160;{</div>
+<div class="line"><a name="l05361"></a><span class="lineno"> 5361</span>&#160;    VmaListItem* pPrev;</div>
+<div class="line"><a name="l05362"></a><span class="lineno"> 5362</span>&#160;    VmaListItem* pNext;</div>
+<div class="line"><a name="l05363"></a><span class="lineno"> 5363</span>&#160;    T Value;</div>
+<div class="line"><a name="l05364"></a><span class="lineno"> 5364</span>&#160;};</div>
+<div class="line"><a name="l05365"></a><span class="lineno"> 5365</span>&#160; </div>
+<div class="line"><a name="l05366"></a><span class="lineno"> 5366</span>&#160;<span class="comment">// Doubly linked list.</span></div>
+<div class="line"><a name="l05367"></a><span class="lineno"> 5367</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05368"></a><span class="lineno"> 5368</span>&#160;<span class="keyword">class </span>VmaRawList</div>
+<div class="line"><a name="l05369"></a><span class="lineno"> 5369</span>&#160;{</div>
+<div class="line"><a name="l05370"></a><span class="lineno"> 5370</span>&#160;    VMA_CLASS_NO_COPY(VmaRawList)</div>
+<div class="line"><a name="l05371"></a><span class="lineno"> 5371</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l05372"></a><span class="lineno"> 5372</span>&#160;    <span class="keyword">typedef</span> VmaListItem&lt;T&gt; ItemType;</div>
+<div class="line"><a name="l05373"></a><span class="lineno"> 5373</span>&#160; </div>
+<div class="line"><a name="l05374"></a><span class="lineno"> 5374</span>&#160;    VmaRawList(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks);</div>
+<div class="line"><a name="l05375"></a><span class="lineno"> 5375</span>&#160;    ~VmaRawList();</div>
+<div class="line"><a name="l05376"></a><span class="lineno"> 5376</span>&#160;    <span class="keywordtype">void</span> Clear();</div>
 <div class="line"><a name="l05377"></a><span class="lineno"> 5377</span>&#160; </div>
-<div class="line"><a name="l05378"></a><span class="lineno"> 5378</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l05379"></a><span class="lineno"> 5379</span>&#160;    <span class="keyword">const</span> VkAllocationCallbacks* <span class="keyword">const</span> m_pAllocationCallbacks;</div>
-<div class="line"><a name="l05380"></a><span class="lineno"> 5380</span>&#160;    VmaPoolAllocator&lt;ItemType&gt; m_ItemAllocator;</div>
-<div class="line"><a name="l05381"></a><span class="lineno"> 5381</span>&#160;    ItemType* m_pFront;</div>
-<div class="line"><a name="l05382"></a><span class="lineno"> 5382</span>&#160;    ItemType* m_pBack;</div>
-<div class="line"><a name="l05383"></a><span class="lineno"> 5383</span>&#160;    <span class="keywordtype">size_t</span> m_Count;</div>
-<div class="line"><a name="l05384"></a><span class="lineno"> 5384</span>&#160;};</div>
+<div class="line"><a name="l05378"></a><span class="lineno"> 5378</span>&#160;    <span class="keywordtype">size_t</span> GetCount()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count; }</div>
+<div class="line"><a name="l05379"></a><span class="lineno"> 5379</span>&#160;    <span class="keywordtype">bool</span> IsEmpty()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Count == 0; }</div>
+<div class="line"><a name="l05380"></a><span class="lineno"> 5380</span>&#160; </div>
+<div class="line"><a name="l05381"></a><span class="lineno"> 5381</span>&#160;    ItemType* Front() { <span class="keywordflow">return</span> m_pFront; }</div>
+<div class="line"><a name="l05382"></a><span class="lineno"> 5382</span>&#160;    <span class="keyword">const</span> ItemType* Front()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_pFront; }</div>
+<div class="line"><a name="l05383"></a><span class="lineno"> 5383</span>&#160;    ItemType* Back() { <span class="keywordflow">return</span> m_pBack; }</div>
+<div class="line"><a name="l05384"></a><span class="lineno"> 5384</span>&#160;    <span class="keyword">const</span> ItemType* Back()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_pBack; }</div>
 <div class="line"><a name="l05385"></a><span class="lineno"> 5385</span>&#160; </div>
-<div class="line"><a name="l05386"></a><span class="lineno"> 5386</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05387"></a><span class="lineno"> 5387</span>&#160;VmaRawList&lt;T&gt;::VmaRawList(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks) :</div>
-<div class="line"><a name="l05388"></a><span class="lineno"> 5388</span>&#160;    m_pAllocationCallbacks(pAllocationCallbacks),</div>
-<div class="line"><a name="l05389"></a><span class="lineno"> 5389</span>&#160;    m_ItemAllocator(pAllocationCallbacks, 128),</div>
-<div class="line"><a name="l05390"></a><span class="lineno"> 5390</span>&#160;    m_pFront(VMA_NULL),</div>
-<div class="line"><a name="l05391"></a><span class="lineno"> 5391</span>&#160;    m_pBack(VMA_NULL),</div>
-<div class="line"><a name="l05392"></a><span class="lineno"> 5392</span>&#160;    m_Count(0)</div>
-<div class="line"><a name="l05393"></a><span class="lineno"> 5393</span>&#160;{</div>
-<div class="line"><a name="l05394"></a><span class="lineno"> 5394</span>&#160;}</div>
-<div class="line"><a name="l05395"></a><span class="lineno"> 5395</span>&#160; </div>
-<div class="line"><a name="l05396"></a><span class="lineno"> 5396</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05397"></a><span class="lineno"> 5397</span>&#160;VmaRawList&lt;T&gt;::~VmaRawList()</div>
-<div class="line"><a name="l05398"></a><span class="lineno"> 5398</span>&#160;{</div>
-<div class="line"><a name="l05399"></a><span class="lineno"> 5399</span>&#160;    <span class="comment">// Intentionally not calling Clear, because that would be unnecessary</span></div>
-<div class="line"><a name="l05400"></a><span class="lineno"> 5400</span>&#160;    <span class="comment">// computations to return all items to m_ItemAllocator as free.</span></div>
-<div class="line"><a name="l05401"></a><span class="lineno"> 5401</span>&#160;}</div>
+<div class="line"><a name="l05386"></a><span class="lineno"> 5386</span>&#160;    ItemType* PushBack();</div>
+<div class="line"><a name="l05387"></a><span class="lineno"> 5387</span>&#160;    ItemType* PushFront();</div>
+<div class="line"><a name="l05388"></a><span class="lineno"> 5388</span>&#160;    ItemType* PushBack(<span class="keyword">const</span> T&amp; value);</div>
+<div class="line"><a name="l05389"></a><span class="lineno"> 5389</span>&#160;    ItemType* PushFront(<span class="keyword">const</span> T&amp; value);</div>
+<div class="line"><a name="l05390"></a><span class="lineno"> 5390</span>&#160;    <span class="keywordtype">void</span> PopBack();</div>
+<div class="line"><a name="l05391"></a><span class="lineno"> 5391</span>&#160;    <span class="keywordtype">void</span> PopFront();</div>
+<div class="line"><a name="l05392"></a><span class="lineno"> 5392</span>&#160;    </div>
+<div class="line"><a name="l05393"></a><span class="lineno"> 5393</span>&#160;    <span class="comment">// Item can be null - it means PushBack.</span></div>
+<div class="line"><a name="l05394"></a><span class="lineno"> 5394</span>&#160;    ItemType* InsertBefore(ItemType* pItem);</div>
+<div class="line"><a name="l05395"></a><span class="lineno"> 5395</span>&#160;    <span class="comment">// Item can be null - it means PushFront.</span></div>
+<div class="line"><a name="l05396"></a><span class="lineno"> 5396</span>&#160;    ItemType* InsertAfter(ItemType* pItem);</div>
+<div class="line"><a name="l05397"></a><span class="lineno"> 5397</span>&#160; </div>
+<div class="line"><a name="l05398"></a><span class="lineno"> 5398</span>&#160;    ItemType* InsertBefore(ItemType* pItem, <span class="keyword">const</span> T&amp; value);</div>
+<div class="line"><a name="l05399"></a><span class="lineno"> 5399</span>&#160;    ItemType* InsertAfter(ItemType* pItem, <span class="keyword">const</span> T&amp; value);</div>
+<div class="line"><a name="l05400"></a><span class="lineno"> 5400</span>&#160; </div>
+<div class="line"><a name="l05401"></a><span class="lineno"> 5401</span>&#160;    <span class="keywordtype">void</span> Remove(ItemType* pItem);</div>
 <div class="line"><a name="l05402"></a><span class="lineno"> 5402</span>&#160; </div>
-<div class="line"><a name="l05403"></a><span class="lineno"> 5403</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05404"></a><span class="lineno"> 5404</span>&#160;<span class="keywordtype">void</span> VmaRawList&lt;T&gt;::Clear()</div>
-<div class="line"><a name="l05405"></a><span class="lineno"> 5405</span>&#160;{</div>
-<div class="line"><a name="l05406"></a><span class="lineno"> 5406</span>&#160;    <span class="keywordflow">if</span>(IsEmpty() == <span class="keyword">false</span>)</div>
-<div class="line"><a name="l05407"></a><span class="lineno"> 5407</span>&#160;    {</div>
-<div class="line"><a name="l05408"></a><span class="lineno"> 5408</span>&#160;        ItemType* pItem = m_pBack;</div>
-<div class="line"><a name="l05409"></a><span class="lineno"> 5409</span>&#160;        <span class="keywordflow">while</span>(pItem != VMA_NULL)</div>
-<div class="line"><a name="l05410"></a><span class="lineno"> 5410</span>&#160;        {</div>
-<div class="line"><a name="l05411"></a><span class="lineno"> 5411</span>&#160;            ItemType* <span class="keyword">const</span> pPrevItem = pItem-&gt;pPrev;</div>
-<div class="line"><a name="l05412"></a><span class="lineno"> 5412</span>&#160;            m_ItemAllocator.Free(pItem);</div>
-<div class="line"><a name="l05413"></a><span class="lineno"> 5413</span>&#160;            pItem = pPrevItem;</div>
-<div class="line"><a name="l05414"></a><span class="lineno"> 5414</span>&#160;        }</div>
-<div class="line"><a name="l05415"></a><span class="lineno"> 5415</span>&#160;        m_pFront = VMA_NULL;</div>
-<div class="line"><a name="l05416"></a><span class="lineno"> 5416</span>&#160;        m_pBack = VMA_NULL;</div>
-<div class="line"><a name="l05417"></a><span class="lineno"> 5417</span>&#160;        m_Count = 0;</div>
-<div class="line"><a name="l05418"></a><span class="lineno"> 5418</span>&#160;    }</div>
+<div class="line"><a name="l05403"></a><span class="lineno"> 5403</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l05404"></a><span class="lineno"> 5404</span>&#160;    <span class="keyword">const</span> VkAllocationCallbacks* <span class="keyword">const</span> m_pAllocationCallbacks;</div>
+<div class="line"><a name="l05405"></a><span class="lineno"> 5405</span>&#160;    VmaPoolAllocator&lt;ItemType&gt; m_ItemAllocator;</div>
+<div class="line"><a name="l05406"></a><span class="lineno"> 5406</span>&#160;    ItemType* m_pFront;</div>
+<div class="line"><a name="l05407"></a><span class="lineno"> 5407</span>&#160;    ItemType* m_pBack;</div>
+<div class="line"><a name="l05408"></a><span class="lineno"> 5408</span>&#160;    <span class="keywordtype">size_t</span> m_Count;</div>
+<div class="line"><a name="l05409"></a><span class="lineno"> 5409</span>&#160;};</div>
+<div class="line"><a name="l05410"></a><span class="lineno"> 5410</span>&#160; </div>
+<div class="line"><a name="l05411"></a><span class="lineno"> 5411</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05412"></a><span class="lineno"> 5412</span>&#160;VmaRawList&lt;T&gt;::VmaRawList(<span class="keyword">const</span> VkAllocationCallbacks* pAllocationCallbacks) :</div>
+<div class="line"><a name="l05413"></a><span class="lineno"> 5413</span>&#160;    m_pAllocationCallbacks(pAllocationCallbacks),</div>
+<div class="line"><a name="l05414"></a><span class="lineno"> 5414</span>&#160;    m_ItemAllocator(pAllocationCallbacks, 128),</div>
+<div class="line"><a name="l05415"></a><span class="lineno"> 5415</span>&#160;    m_pFront(VMA_NULL),</div>
+<div class="line"><a name="l05416"></a><span class="lineno"> 5416</span>&#160;    m_pBack(VMA_NULL),</div>
+<div class="line"><a name="l05417"></a><span class="lineno"> 5417</span>&#160;    m_Count(0)</div>
+<div class="line"><a name="l05418"></a><span class="lineno"> 5418</span>&#160;{</div>
 <div class="line"><a name="l05419"></a><span class="lineno"> 5419</span>&#160;}</div>
 <div class="line"><a name="l05420"></a><span class="lineno"> 5420</span>&#160; </div>
 <div class="line"><a name="l05421"></a><span class="lineno"> 5421</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05422"></a><span class="lineno"> 5422</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::PushBack()</div>
+<div class="line"><a name="l05422"></a><span class="lineno"> 5422</span>&#160;VmaRawList&lt;T&gt;::~VmaRawList()</div>
 <div class="line"><a name="l05423"></a><span class="lineno"> 5423</span>&#160;{</div>
-<div class="line"><a name="l05424"></a><span class="lineno"> 5424</span>&#160;    ItemType* <span class="keyword">const</span> pNewItem = m_ItemAllocator.Alloc();</div>
-<div class="line"><a name="l05425"></a><span class="lineno"> 5425</span>&#160;    pNewItem-&gt;pNext = VMA_NULL;</div>
-<div class="line"><a name="l05426"></a><span class="lineno"> 5426</span>&#160;    <span class="keywordflow">if</span>(IsEmpty())</div>
-<div class="line"><a name="l05427"></a><span class="lineno"> 5427</span>&#160;    {</div>
-<div class="line"><a name="l05428"></a><span class="lineno"> 5428</span>&#160;        pNewItem-&gt;pPrev = VMA_NULL;</div>
-<div class="line"><a name="l05429"></a><span class="lineno"> 5429</span>&#160;        m_pFront = pNewItem;</div>
-<div class="line"><a name="l05430"></a><span class="lineno"> 5430</span>&#160;        m_pBack = pNewItem;</div>
-<div class="line"><a name="l05431"></a><span class="lineno"> 5431</span>&#160;        m_Count = 1;</div>
-<div class="line"><a name="l05432"></a><span class="lineno"> 5432</span>&#160;    }</div>
-<div class="line"><a name="l05433"></a><span class="lineno"> 5433</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05434"></a><span class="lineno"> 5434</span>&#160;    {</div>
-<div class="line"><a name="l05435"></a><span class="lineno"> 5435</span>&#160;        pNewItem-&gt;pPrev = m_pBack;</div>
-<div class="line"><a name="l05436"></a><span class="lineno"> 5436</span>&#160;        m_pBack-&gt;pNext = pNewItem;</div>
-<div class="line"><a name="l05437"></a><span class="lineno"> 5437</span>&#160;        m_pBack = pNewItem;</div>
-<div class="line"><a name="l05438"></a><span class="lineno"> 5438</span>&#160;        ++m_Count;</div>
-<div class="line"><a name="l05439"></a><span class="lineno"> 5439</span>&#160;    }</div>
-<div class="line"><a name="l05440"></a><span class="lineno"> 5440</span>&#160;    <span class="keywordflow">return</span> pNewItem;</div>
-<div class="line"><a name="l05441"></a><span class="lineno"> 5441</span>&#160;}</div>
-<div class="line"><a name="l05442"></a><span class="lineno"> 5442</span>&#160; </div>
-<div class="line"><a name="l05443"></a><span class="lineno"> 5443</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05444"></a><span class="lineno"> 5444</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::PushFront()</div>
-<div class="line"><a name="l05445"></a><span class="lineno"> 5445</span>&#160;{</div>
-<div class="line"><a name="l05446"></a><span class="lineno"> 5446</span>&#160;    ItemType* <span class="keyword">const</span> pNewItem = m_ItemAllocator.Alloc();</div>
-<div class="line"><a name="l05447"></a><span class="lineno"> 5447</span>&#160;    pNewItem-&gt;pPrev = VMA_NULL;</div>
-<div class="line"><a name="l05448"></a><span class="lineno"> 5448</span>&#160;    <span class="keywordflow">if</span>(IsEmpty())</div>
-<div class="line"><a name="l05449"></a><span class="lineno"> 5449</span>&#160;    {</div>
-<div class="line"><a name="l05450"></a><span class="lineno"> 5450</span>&#160;        pNewItem-&gt;pNext = VMA_NULL;</div>
-<div class="line"><a name="l05451"></a><span class="lineno"> 5451</span>&#160;        m_pFront = pNewItem;</div>
-<div class="line"><a name="l05452"></a><span class="lineno"> 5452</span>&#160;        m_pBack = pNewItem;</div>
-<div class="line"><a name="l05453"></a><span class="lineno"> 5453</span>&#160;        m_Count = 1;</div>
-<div class="line"><a name="l05454"></a><span class="lineno"> 5454</span>&#160;    }</div>
-<div class="line"><a name="l05455"></a><span class="lineno"> 5455</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05456"></a><span class="lineno"> 5456</span>&#160;    {</div>
-<div class="line"><a name="l05457"></a><span class="lineno"> 5457</span>&#160;        pNewItem-&gt;pNext = m_pFront;</div>
-<div class="line"><a name="l05458"></a><span class="lineno"> 5458</span>&#160;        m_pFront-&gt;pPrev = pNewItem;</div>
-<div class="line"><a name="l05459"></a><span class="lineno"> 5459</span>&#160;        m_pFront = pNewItem;</div>
-<div class="line"><a name="l05460"></a><span class="lineno"> 5460</span>&#160;        ++m_Count;</div>
-<div class="line"><a name="l05461"></a><span class="lineno"> 5461</span>&#160;    }</div>
-<div class="line"><a name="l05462"></a><span class="lineno"> 5462</span>&#160;    <span class="keywordflow">return</span> pNewItem;</div>
-<div class="line"><a name="l05463"></a><span class="lineno"> 5463</span>&#160;}</div>
-<div class="line"><a name="l05464"></a><span class="lineno"> 5464</span>&#160; </div>
-<div class="line"><a name="l05465"></a><span class="lineno"> 5465</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05466"></a><span class="lineno"> 5466</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::PushBack(<span class="keyword">const</span> T&amp; value)</div>
-<div class="line"><a name="l05467"></a><span class="lineno"> 5467</span>&#160;{</div>
-<div class="line"><a name="l05468"></a><span class="lineno"> 5468</span>&#160;    ItemType* <span class="keyword">const</span> pNewItem = PushBack();</div>
-<div class="line"><a name="l05469"></a><span class="lineno"> 5469</span>&#160;    pNewItem-&gt;Value = value;</div>
-<div class="line"><a name="l05470"></a><span class="lineno"> 5470</span>&#160;    <span class="keywordflow">return</span> pNewItem;</div>
-<div class="line"><a name="l05471"></a><span class="lineno"> 5471</span>&#160;}</div>
-<div class="line"><a name="l05472"></a><span class="lineno"> 5472</span>&#160; </div>
-<div class="line"><a name="l05473"></a><span class="lineno"> 5473</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05474"></a><span class="lineno"> 5474</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::PushFront(<span class="keyword">const</span> T&amp; value)</div>
-<div class="line"><a name="l05475"></a><span class="lineno"> 5475</span>&#160;{</div>
-<div class="line"><a name="l05476"></a><span class="lineno"> 5476</span>&#160;    ItemType* <span class="keyword">const</span> pNewItem = PushFront();</div>
-<div class="line"><a name="l05477"></a><span class="lineno"> 5477</span>&#160;    pNewItem-&gt;Value = value;</div>
-<div class="line"><a name="l05478"></a><span class="lineno"> 5478</span>&#160;    <span class="keywordflow">return</span> pNewItem;</div>
-<div class="line"><a name="l05479"></a><span class="lineno"> 5479</span>&#160;}</div>
-<div class="line"><a name="l05480"></a><span class="lineno"> 5480</span>&#160; </div>
-<div class="line"><a name="l05481"></a><span class="lineno"> 5481</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05482"></a><span class="lineno"> 5482</span>&#160;<span class="keywordtype">void</span> VmaRawList&lt;T&gt;::PopBack()</div>
-<div class="line"><a name="l05483"></a><span class="lineno"> 5483</span>&#160;{</div>
-<div class="line"><a name="l05484"></a><span class="lineno"> 5484</span>&#160;    VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l05485"></a><span class="lineno"> 5485</span>&#160;    ItemType* <span class="keyword">const</span> pBackItem = m_pBack;</div>
-<div class="line"><a name="l05486"></a><span class="lineno"> 5486</span>&#160;    ItemType* <span class="keyword">const</span> pPrevItem = pBackItem-&gt;pPrev;</div>
-<div class="line"><a name="l05487"></a><span class="lineno"> 5487</span>&#160;    <span class="keywordflow">if</span>(pPrevItem != VMA_NULL)</div>
-<div class="line"><a name="l05488"></a><span class="lineno"> 5488</span>&#160;    {</div>
-<div class="line"><a name="l05489"></a><span class="lineno"> 5489</span>&#160;        pPrevItem-&gt;pNext = VMA_NULL;</div>
-<div class="line"><a name="l05490"></a><span class="lineno"> 5490</span>&#160;    }</div>
-<div class="line"><a name="l05491"></a><span class="lineno"> 5491</span>&#160;    m_pBack = pPrevItem;</div>
-<div class="line"><a name="l05492"></a><span class="lineno"> 5492</span>&#160;    m_ItemAllocator.Free(pBackItem);</div>
-<div class="line"><a name="l05493"></a><span class="lineno"> 5493</span>&#160;    --m_Count;</div>
-<div class="line"><a name="l05494"></a><span class="lineno"> 5494</span>&#160;}</div>
-<div class="line"><a name="l05495"></a><span class="lineno"> 5495</span>&#160; </div>
-<div class="line"><a name="l05496"></a><span class="lineno"> 5496</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05497"></a><span class="lineno"> 5497</span>&#160;<span class="keywordtype">void</span> VmaRawList&lt;T&gt;::PopFront()</div>
-<div class="line"><a name="l05498"></a><span class="lineno"> 5498</span>&#160;{</div>
-<div class="line"><a name="l05499"></a><span class="lineno"> 5499</span>&#160;    VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l05500"></a><span class="lineno"> 5500</span>&#160;    ItemType* <span class="keyword">const</span> pFrontItem = m_pFront;</div>
-<div class="line"><a name="l05501"></a><span class="lineno"> 5501</span>&#160;    ItemType* <span class="keyword">const</span> pNextItem = pFrontItem-&gt;pNext;</div>
-<div class="line"><a name="l05502"></a><span class="lineno"> 5502</span>&#160;    <span class="keywordflow">if</span>(pNextItem != VMA_NULL)</div>
-<div class="line"><a name="l05503"></a><span class="lineno"> 5503</span>&#160;    {</div>
-<div class="line"><a name="l05504"></a><span class="lineno"> 5504</span>&#160;        pNextItem-&gt;pPrev = VMA_NULL;</div>
-<div class="line"><a name="l05505"></a><span class="lineno"> 5505</span>&#160;    }</div>
-<div class="line"><a name="l05506"></a><span class="lineno"> 5506</span>&#160;    m_pFront = pNextItem;</div>
-<div class="line"><a name="l05507"></a><span class="lineno"> 5507</span>&#160;    m_ItemAllocator.Free(pFrontItem);</div>
-<div class="line"><a name="l05508"></a><span class="lineno"> 5508</span>&#160;    --m_Count;</div>
-<div class="line"><a name="l05509"></a><span class="lineno"> 5509</span>&#160;}</div>
-<div class="line"><a name="l05510"></a><span class="lineno"> 5510</span>&#160; </div>
-<div class="line"><a name="l05511"></a><span class="lineno"> 5511</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05512"></a><span class="lineno"> 5512</span>&#160;<span class="keywordtype">void</span> VmaRawList&lt;T&gt;::Remove(ItemType* pItem)</div>
-<div class="line"><a name="l05513"></a><span class="lineno"> 5513</span>&#160;{</div>
-<div class="line"><a name="l05514"></a><span class="lineno"> 5514</span>&#160;    VMA_HEAVY_ASSERT(pItem != VMA_NULL);</div>
-<div class="line"><a name="l05515"></a><span class="lineno"> 5515</span>&#160;    VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
-<div class="line"><a name="l05516"></a><span class="lineno"> 5516</span>&#160; </div>
-<div class="line"><a name="l05517"></a><span class="lineno"> 5517</span>&#160;    <span class="keywordflow">if</span>(pItem-&gt;pPrev != VMA_NULL)</div>
-<div class="line"><a name="l05518"></a><span class="lineno"> 5518</span>&#160;    {</div>
-<div class="line"><a name="l05519"></a><span class="lineno"> 5519</span>&#160;        pItem-&gt;pPrev-&gt;pNext = pItem-&gt;pNext;</div>
-<div class="line"><a name="l05520"></a><span class="lineno"> 5520</span>&#160;    }</div>
-<div class="line"><a name="l05521"></a><span class="lineno"> 5521</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05522"></a><span class="lineno"> 5522</span>&#160;    {</div>
-<div class="line"><a name="l05523"></a><span class="lineno"> 5523</span>&#160;        VMA_HEAVY_ASSERT(m_pFront == pItem);</div>
-<div class="line"><a name="l05524"></a><span class="lineno"> 5524</span>&#160;        m_pFront = pItem-&gt;pNext;</div>
-<div class="line"><a name="l05525"></a><span class="lineno"> 5525</span>&#160;    }</div>
-<div class="line"><a name="l05526"></a><span class="lineno"> 5526</span>&#160; </div>
-<div class="line"><a name="l05527"></a><span class="lineno"> 5527</span>&#160;    <span class="keywordflow">if</span>(pItem-&gt;pNext != VMA_NULL)</div>
+<div class="line"><a name="l05424"></a><span class="lineno"> 5424</span>&#160;    <span class="comment">// Intentionally not calling Clear, because that would be unnecessary</span></div>
+<div class="line"><a name="l05425"></a><span class="lineno"> 5425</span>&#160;    <span class="comment">// computations to return all items to m_ItemAllocator as free.</span></div>
+<div class="line"><a name="l05426"></a><span class="lineno"> 5426</span>&#160;}</div>
+<div class="line"><a name="l05427"></a><span class="lineno"> 5427</span>&#160; </div>
+<div class="line"><a name="l05428"></a><span class="lineno"> 5428</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05429"></a><span class="lineno"> 5429</span>&#160;<span class="keywordtype">void</span> VmaRawList&lt;T&gt;::Clear()</div>
+<div class="line"><a name="l05430"></a><span class="lineno"> 5430</span>&#160;{</div>
+<div class="line"><a name="l05431"></a><span class="lineno"> 5431</span>&#160;    <span class="keywordflow">if</span>(IsEmpty() == <span class="keyword">false</span>)</div>
+<div class="line"><a name="l05432"></a><span class="lineno"> 5432</span>&#160;    {</div>
+<div class="line"><a name="l05433"></a><span class="lineno"> 5433</span>&#160;        ItemType* pItem = m_pBack;</div>
+<div class="line"><a name="l05434"></a><span class="lineno"> 5434</span>&#160;        <span class="keywordflow">while</span>(pItem != VMA_NULL)</div>
+<div class="line"><a name="l05435"></a><span class="lineno"> 5435</span>&#160;        {</div>
+<div class="line"><a name="l05436"></a><span class="lineno"> 5436</span>&#160;            ItemType* <span class="keyword">const</span> pPrevItem = pItem-&gt;pPrev;</div>
+<div class="line"><a name="l05437"></a><span class="lineno"> 5437</span>&#160;            m_ItemAllocator.Free(pItem);</div>
+<div class="line"><a name="l05438"></a><span class="lineno"> 5438</span>&#160;            pItem = pPrevItem;</div>
+<div class="line"><a name="l05439"></a><span class="lineno"> 5439</span>&#160;        }</div>
+<div class="line"><a name="l05440"></a><span class="lineno"> 5440</span>&#160;        m_pFront = VMA_NULL;</div>
+<div class="line"><a name="l05441"></a><span class="lineno"> 5441</span>&#160;        m_pBack = VMA_NULL;</div>
+<div class="line"><a name="l05442"></a><span class="lineno"> 5442</span>&#160;        m_Count = 0;</div>
+<div class="line"><a name="l05443"></a><span class="lineno"> 5443</span>&#160;    }</div>
+<div class="line"><a name="l05444"></a><span class="lineno"> 5444</span>&#160;}</div>
+<div class="line"><a name="l05445"></a><span class="lineno"> 5445</span>&#160; </div>
+<div class="line"><a name="l05446"></a><span class="lineno"> 5446</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05447"></a><span class="lineno"> 5447</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::PushBack()</div>
+<div class="line"><a name="l05448"></a><span class="lineno"> 5448</span>&#160;{</div>
+<div class="line"><a name="l05449"></a><span class="lineno"> 5449</span>&#160;    ItemType* <span class="keyword">const</span> pNewItem = m_ItemAllocator.Alloc();</div>
+<div class="line"><a name="l05450"></a><span class="lineno"> 5450</span>&#160;    pNewItem-&gt;pNext = VMA_NULL;</div>
+<div class="line"><a name="l05451"></a><span class="lineno"> 5451</span>&#160;    <span class="keywordflow">if</span>(IsEmpty())</div>
+<div class="line"><a name="l05452"></a><span class="lineno"> 5452</span>&#160;    {</div>
+<div class="line"><a name="l05453"></a><span class="lineno"> 5453</span>&#160;        pNewItem-&gt;pPrev = VMA_NULL;</div>
+<div class="line"><a name="l05454"></a><span class="lineno"> 5454</span>&#160;        m_pFront = pNewItem;</div>
+<div class="line"><a name="l05455"></a><span class="lineno"> 5455</span>&#160;        m_pBack = pNewItem;</div>
+<div class="line"><a name="l05456"></a><span class="lineno"> 5456</span>&#160;        m_Count = 1;</div>
+<div class="line"><a name="l05457"></a><span class="lineno"> 5457</span>&#160;    }</div>
+<div class="line"><a name="l05458"></a><span class="lineno"> 5458</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05459"></a><span class="lineno"> 5459</span>&#160;    {</div>
+<div class="line"><a name="l05460"></a><span class="lineno"> 5460</span>&#160;        pNewItem-&gt;pPrev = m_pBack;</div>
+<div class="line"><a name="l05461"></a><span class="lineno"> 5461</span>&#160;        m_pBack-&gt;pNext = pNewItem;</div>
+<div class="line"><a name="l05462"></a><span class="lineno"> 5462</span>&#160;        m_pBack = pNewItem;</div>
+<div class="line"><a name="l05463"></a><span class="lineno"> 5463</span>&#160;        ++m_Count;</div>
+<div class="line"><a name="l05464"></a><span class="lineno"> 5464</span>&#160;    }</div>
+<div class="line"><a name="l05465"></a><span class="lineno"> 5465</span>&#160;    <span class="keywordflow">return</span> pNewItem;</div>
+<div class="line"><a name="l05466"></a><span class="lineno"> 5466</span>&#160;}</div>
+<div class="line"><a name="l05467"></a><span class="lineno"> 5467</span>&#160; </div>
+<div class="line"><a name="l05468"></a><span class="lineno"> 5468</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05469"></a><span class="lineno"> 5469</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::PushFront()</div>
+<div class="line"><a name="l05470"></a><span class="lineno"> 5470</span>&#160;{</div>
+<div class="line"><a name="l05471"></a><span class="lineno"> 5471</span>&#160;    ItemType* <span class="keyword">const</span> pNewItem = m_ItemAllocator.Alloc();</div>
+<div class="line"><a name="l05472"></a><span class="lineno"> 5472</span>&#160;    pNewItem-&gt;pPrev = VMA_NULL;</div>
+<div class="line"><a name="l05473"></a><span class="lineno"> 5473</span>&#160;    <span class="keywordflow">if</span>(IsEmpty())</div>
+<div class="line"><a name="l05474"></a><span class="lineno"> 5474</span>&#160;    {</div>
+<div class="line"><a name="l05475"></a><span class="lineno"> 5475</span>&#160;        pNewItem-&gt;pNext = VMA_NULL;</div>
+<div class="line"><a name="l05476"></a><span class="lineno"> 5476</span>&#160;        m_pFront = pNewItem;</div>
+<div class="line"><a name="l05477"></a><span class="lineno"> 5477</span>&#160;        m_pBack = pNewItem;</div>
+<div class="line"><a name="l05478"></a><span class="lineno"> 5478</span>&#160;        m_Count = 1;</div>
+<div class="line"><a name="l05479"></a><span class="lineno"> 5479</span>&#160;    }</div>
+<div class="line"><a name="l05480"></a><span class="lineno"> 5480</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05481"></a><span class="lineno"> 5481</span>&#160;    {</div>
+<div class="line"><a name="l05482"></a><span class="lineno"> 5482</span>&#160;        pNewItem-&gt;pNext = m_pFront;</div>
+<div class="line"><a name="l05483"></a><span class="lineno"> 5483</span>&#160;        m_pFront-&gt;pPrev = pNewItem;</div>
+<div class="line"><a name="l05484"></a><span class="lineno"> 5484</span>&#160;        m_pFront = pNewItem;</div>
+<div class="line"><a name="l05485"></a><span class="lineno"> 5485</span>&#160;        ++m_Count;</div>
+<div class="line"><a name="l05486"></a><span class="lineno"> 5486</span>&#160;    }</div>
+<div class="line"><a name="l05487"></a><span class="lineno"> 5487</span>&#160;    <span class="keywordflow">return</span> pNewItem;</div>
+<div class="line"><a name="l05488"></a><span class="lineno"> 5488</span>&#160;}</div>
+<div class="line"><a name="l05489"></a><span class="lineno"> 5489</span>&#160; </div>
+<div class="line"><a name="l05490"></a><span class="lineno"> 5490</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05491"></a><span class="lineno"> 5491</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::PushBack(<span class="keyword">const</span> T&amp; value)</div>
+<div class="line"><a name="l05492"></a><span class="lineno"> 5492</span>&#160;{</div>
+<div class="line"><a name="l05493"></a><span class="lineno"> 5493</span>&#160;    ItemType* <span class="keyword">const</span> pNewItem = PushBack();</div>
+<div class="line"><a name="l05494"></a><span class="lineno"> 5494</span>&#160;    pNewItem-&gt;Value = value;</div>
+<div class="line"><a name="l05495"></a><span class="lineno"> 5495</span>&#160;    <span class="keywordflow">return</span> pNewItem;</div>
+<div class="line"><a name="l05496"></a><span class="lineno"> 5496</span>&#160;}</div>
+<div class="line"><a name="l05497"></a><span class="lineno"> 5497</span>&#160; </div>
+<div class="line"><a name="l05498"></a><span class="lineno"> 5498</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05499"></a><span class="lineno"> 5499</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::PushFront(<span class="keyword">const</span> T&amp; value)</div>
+<div class="line"><a name="l05500"></a><span class="lineno"> 5500</span>&#160;{</div>
+<div class="line"><a name="l05501"></a><span class="lineno"> 5501</span>&#160;    ItemType* <span class="keyword">const</span> pNewItem = PushFront();</div>
+<div class="line"><a name="l05502"></a><span class="lineno"> 5502</span>&#160;    pNewItem-&gt;Value = value;</div>
+<div class="line"><a name="l05503"></a><span class="lineno"> 5503</span>&#160;    <span class="keywordflow">return</span> pNewItem;</div>
+<div class="line"><a name="l05504"></a><span class="lineno"> 5504</span>&#160;}</div>
+<div class="line"><a name="l05505"></a><span class="lineno"> 5505</span>&#160; </div>
+<div class="line"><a name="l05506"></a><span class="lineno"> 5506</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05507"></a><span class="lineno"> 5507</span>&#160;<span class="keywordtype">void</span> VmaRawList&lt;T&gt;::PopBack()</div>
+<div class="line"><a name="l05508"></a><span class="lineno"> 5508</span>&#160;{</div>
+<div class="line"><a name="l05509"></a><span class="lineno"> 5509</span>&#160;    VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l05510"></a><span class="lineno"> 5510</span>&#160;    ItemType* <span class="keyword">const</span> pBackItem = m_pBack;</div>
+<div class="line"><a name="l05511"></a><span class="lineno"> 5511</span>&#160;    ItemType* <span class="keyword">const</span> pPrevItem = pBackItem-&gt;pPrev;</div>
+<div class="line"><a name="l05512"></a><span class="lineno"> 5512</span>&#160;    <span class="keywordflow">if</span>(pPrevItem != VMA_NULL)</div>
+<div class="line"><a name="l05513"></a><span class="lineno"> 5513</span>&#160;    {</div>
+<div class="line"><a name="l05514"></a><span class="lineno"> 5514</span>&#160;        pPrevItem-&gt;pNext = VMA_NULL;</div>
+<div class="line"><a name="l05515"></a><span class="lineno"> 5515</span>&#160;    }</div>
+<div class="line"><a name="l05516"></a><span class="lineno"> 5516</span>&#160;    m_pBack = pPrevItem;</div>
+<div class="line"><a name="l05517"></a><span class="lineno"> 5517</span>&#160;    m_ItemAllocator.Free(pBackItem);</div>
+<div class="line"><a name="l05518"></a><span class="lineno"> 5518</span>&#160;    --m_Count;</div>
+<div class="line"><a name="l05519"></a><span class="lineno"> 5519</span>&#160;}</div>
+<div class="line"><a name="l05520"></a><span class="lineno"> 5520</span>&#160; </div>
+<div class="line"><a name="l05521"></a><span class="lineno"> 5521</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05522"></a><span class="lineno"> 5522</span>&#160;<span class="keywordtype">void</span> VmaRawList&lt;T&gt;::PopFront()</div>
+<div class="line"><a name="l05523"></a><span class="lineno"> 5523</span>&#160;{</div>
+<div class="line"><a name="l05524"></a><span class="lineno"> 5524</span>&#160;    VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l05525"></a><span class="lineno"> 5525</span>&#160;    ItemType* <span class="keyword">const</span> pFrontItem = m_pFront;</div>
+<div class="line"><a name="l05526"></a><span class="lineno"> 5526</span>&#160;    ItemType* <span class="keyword">const</span> pNextItem = pFrontItem-&gt;pNext;</div>
+<div class="line"><a name="l05527"></a><span class="lineno"> 5527</span>&#160;    <span class="keywordflow">if</span>(pNextItem != VMA_NULL)</div>
 <div class="line"><a name="l05528"></a><span class="lineno"> 5528</span>&#160;    {</div>
-<div class="line"><a name="l05529"></a><span class="lineno"> 5529</span>&#160;        pItem-&gt;pNext-&gt;pPrev = pItem-&gt;pPrev;</div>
+<div class="line"><a name="l05529"></a><span class="lineno"> 5529</span>&#160;        pNextItem-&gt;pPrev = VMA_NULL;</div>
 <div class="line"><a name="l05530"></a><span class="lineno"> 5530</span>&#160;    }</div>
-<div class="line"><a name="l05531"></a><span class="lineno"> 5531</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05532"></a><span class="lineno"> 5532</span>&#160;    {</div>
-<div class="line"><a name="l05533"></a><span class="lineno"> 5533</span>&#160;        VMA_HEAVY_ASSERT(m_pBack == pItem);</div>
-<div class="line"><a name="l05534"></a><span class="lineno"> 5534</span>&#160;        m_pBack = pItem-&gt;pPrev;</div>
-<div class="line"><a name="l05535"></a><span class="lineno"> 5535</span>&#160;    }</div>
-<div class="line"><a name="l05536"></a><span class="lineno"> 5536</span>&#160; </div>
-<div class="line"><a name="l05537"></a><span class="lineno"> 5537</span>&#160;    m_ItemAllocator.Free(pItem);</div>
-<div class="line"><a name="l05538"></a><span class="lineno"> 5538</span>&#160;    --m_Count;</div>
-<div class="line"><a name="l05539"></a><span class="lineno"> 5539</span>&#160;}</div>
-<div class="line"><a name="l05540"></a><span class="lineno"> 5540</span>&#160; </div>
-<div class="line"><a name="l05541"></a><span class="lineno"> 5541</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05542"></a><span class="lineno"> 5542</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::InsertBefore(ItemType* pItem)</div>
-<div class="line"><a name="l05543"></a><span class="lineno"> 5543</span>&#160;{</div>
-<div class="line"><a name="l05544"></a><span class="lineno"> 5544</span>&#160;    <span class="keywordflow">if</span>(pItem != VMA_NULL)</div>
-<div class="line"><a name="l05545"></a><span class="lineno"> 5545</span>&#160;    {</div>
-<div class="line"><a name="l05546"></a><span class="lineno"> 5546</span>&#160;        ItemType* <span class="keyword">const</span> prevItem = pItem-&gt;pPrev;</div>
-<div class="line"><a name="l05547"></a><span class="lineno"> 5547</span>&#160;        ItemType* <span class="keyword">const</span> newItem = m_ItemAllocator.Alloc();</div>
-<div class="line"><a name="l05548"></a><span class="lineno"> 5548</span>&#160;        newItem-&gt;pPrev = prevItem;</div>
-<div class="line"><a name="l05549"></a><span class="lineno"> 5549</span>&#160;        newItem-&gt;pNext = pItem;</div>
-<div class="line"><a name="l05550"></a><span class="lineno"> 5550</span>&#160;        pItem-&gt;pPrev = newItem;</div>
-<div class="line"><a name="l05551"></a><span class="lineno"> 5551</span>&#160;        <span class="keywordflow">if</span>(prevItem != VMA_NULL)</div>
-<div class="line"><a name="l05552"></a><span class="lineno"> 5552</span>&#160;        {</div>
-<div class="line"><a name="l05553"></a><span class="lineno"> 5553</span>&#160;            prevItem-&gt;pNext = newItem;</div>
-<div class="line"><a name="l05554"></a><span class="lineno"> 5554</span>&#160;        }</div>
-<div class="line"><a name="l05555"></a><span class="lineno"> 5555</span>&#160;        <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05556"></a><span class="lineno"> 5556</span>&#160;        {</div>
-<div class="line"><a name="l05557"></a><span class="lineno"> 5557</span>&#160;            VMA_HEAVY_ASSERT(m_pFront == pItem);</div>
-<div class="line"><a name="l05558"></a><span class="lineno"> 5558</span>&#160;            m_pFront = newItem;</div>
-<div class="line"><a name="l05559"></a><span class="lineno"> 5559</span>&#160;        }</div>
-<div class="line"><a name="l05560"></a><span class="lineno"> 5560</span>&#160;        ++m_Count;</div>
-<div class="line"><a name="l05561"></a><span class="lineno"> 5561</span>&#160;        <span class="keywordflow">return</span> newItem;</div>
-<div class="line"><a name="l05562"></a><span class="lineno"> 5562</span>&#160;    }</div>
-<div class="line"><a name="l05563"></a><span class="lineno"> 5563</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05564"></a><span class="lineno"> 5564</span>&#160;        <span class="keywordflow">return</span> PushBack();</div>
-<div class="line"><a name="l05565"></a><span class="lineno"> 5565</span>&#160;}</div>
-<div class="line"><a name="l05566"></a><span class="lineno"> 5566</span>&#160; </div>
-<div class="line"><a name="l05567"></a><span class="lineno"> 5567</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05568"></a><span class="lineno"> 5568</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::InsertAfter(ItemType* pItem)</div>
-<div class="line"><a name="l05569"></a><span class="lineno"> 5569</span>&#160;{</div>
-<div class="line"><a name="l05570"></a><span class="lineno"> 5570</span>&#160;    <span class="keywordflow">if</span>(pItem != VMA_NULL)</div>
-<div class="line"><a name="l05571"></a><span class="lineno"> 5571</span>&#160;    {</div>
-<div class="line"><a name="l05572"></a><span class="lineno"> 5572</span>&#160;        ItemType* <span class="keyword">const</span> nextItem = pItem-&gt;pNext;</div>
-<div class="line"><a name="l05573"></a><span class="lineno"> 5573</span>&#160;        ItemType* <span class="keyword">const</span> newItem = m_ItemAllocator.Alloc();</div>
-<div class="line"><a name="l05574"></a><span class="lineno"> 5574</span>&#160;        newItem-&gt;pNext = nextItem;</div>
-<div class="line"><a name="l05575"></a><span class="lineno"> 5575</span>&#160;        newItem-&gt;pPrev = pItem;</div>
-<div class="line"><a name="l05576"></a><span class="lineno"> 5576</span>&#160;        pItem-&gt;pNext = newItem;</div>
-<div class="line"><a name="l05577"></a><span class="lineno"> 5577</span>&#160;        <span class="keywordflow">if</span>(nextItem != VMA_NULL)</div>
-<div class="line"><a name="l05578"></a><span class="lineno"> 5578</span>&#160;        {</div>
-<div class="line"><a name="l05579"></a><span class="lineno"> 5579</span>&#160;            nextItem-&gt;pPrev = newItem;</div>
-<div class="line"><a name="l05580"></a><span class="lineno"> 5580</span>&#160;        }</div>
-<div class="line"><a name="l05581"></a><span class="lineno"> 5581</span>&#160;        <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05582"></a><span class="lineno"> 5582</span>&#160;        {</div>
-<div class="line"><a name="l05583"></a><span class="lineno"> 5583</span>&#160;            VMA_HEAVY_ASSERT(m_pBack == pItem);</div>
-<div class="line"><a name="l05584"></a><span class="lineno"> 5584</span>&#160;            m_pBack = newItem;</div>
-<div class="line"><a name="l05585"></a><span class="lineno"> 5585</span>&#160;        }</div>
-<div class="line"><a name="l05586"></a><span class="lineno"> 5586</span>&#160;        ++m_Count;</div>
-<div class="line"><a name="l05587"></a><span class="lineno"> 5587</span>&#160;        <span class="keywordflow">return</span> newItem;</div>
-<div class="line"><a name="l05588"></a><span class="lineno"> 5588</span>&#160;    }</div>
-<div class="line"><a name="l05589"></a><span class="lineno"> 5589</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05590"></a><span class="lineno"> 5590</span>&#160;        <span class="keywordflow">return</span> PushFront();</div>
-<div class="line"><a name="l05591"></a><span class="lineno"> 5591</span>&#160;}</div>
-<div class="line"><a name="l05592"></a><span class="lineno"> 5592</span>&#160; </div>
-<div class="line"><a name="l05593"></a><span class="lineno"> 5593</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05594"></a><span class="lineno"> 5594</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::InsertBefore(ItemType* pItem, <span class="keyword">const</span> T&amp; value)</div>
-<div class="line"><a name="l05595"></a><span class="lineno"> 5595</span>&#160;{</div>
-<div class="line"><a name="l05596"></a><span class="lineno"> 5596</span>&#160;    ItemType* <span class="keyword">const</span> newItem = InsertBefore(pItem);</div>
-<div class="line"><a name="l05597"></a><span class="lineno"> 5597</span>&#160;    newItem-&gt;Value = value;</div>
-<div class="line"><a name="l05598"></a><span class="lineno"> 5598</span>&#160;    <span class="keywordflow">return</span> newItem;</div>
-<div class="line"><a name="l05599"></a><span class="lineno"> 5599</span>&#160;}</div>
-<div class="line"><a name="l05600"></a><span class="lineno"> 5600</span>&#160; </div>
-<div class="line"><a name="l05601"></a><span class="lineno"> 5601</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
-<div class="line"><a name="l05602"></a><span class="lineno"> 5602</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::InsertAfter(ItemType* pItem, <span class="keyword">const</span> T&amp; value)</div>
-<div class="line"><a name="l05603"></a><span class="lineno"> 5603</span>&#160;{</div>
-<div class="line"><a name="l05604"></a><span class="lineno"> 5604</span>&#160;    ItemType* <span class="keyword">const</span> newItem = InsertAfter(pItem);</div>
-<div class="line"><a name="l05605"></a><span class="lineno"> 5605</span>&#160;    newItem-&gt;Value = value;</div>
-<div class="line"><a name="l05606"></a><span class="lineno"> 5606</span>&#160;    <span class="keywordflow">return</span> newItem;</div>
-<div class="line"><a name="l05607"></a><span class="lineno"> 5607</span>&#160;}</div>
-<div class="line"><a name="l05608"></a><span class="lineno"> 5608</span>&#160; </div>
-<div class="line"><a name="l05609"></a><span class="lineno"> 5609</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> AllocatorT&gt;</div>
-<div class="line"><a name="l05610"></a><span class="lineno"> 5610</span>&#160;<span class="keyword">class </span>VmaList</div>
-<div class="line"><a name="l05611"></a><span class="lineno"> 5611</span>&#160;{</div>
-<div class="line"><a name="l05612"></a><span class="lineno"> 5612</span>&#160;    VMA_CLASS_NO_COPY(VmaList)</div>
-<div class="line"><a name="l05613"></a><span class="lineno"> 5613</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l05614"></a><span class="lineno"> 5614</span>&#160;    <span class="keyword">class </span>iterator</div>
-<div class="line"><a name="l05615"></a><span class="lineno"> 5615</span>&#160;    {</div>
-<div class="line"><a name="l05616"></a><span class="lineno"> 5616</span>&#160;    <span class="keyword">public</span>:</div>
-<div class="line"><a name="l05617"></a><span class="lineno"> 5617</span>&#160;        iterator() :</div>
-<div class="line"><a name="l05618"></a><span class="lineno"> 5618</span>&#160;            m_pList(VMA_NULL),</div>
-<div class="line"><a name="l05619"></a><span class="lineno"> 5619</span>&#160;            m_pItem(VMA_NULL)</div>
-<div class="line"><a name="l05620"></a><span class="lineno"> 5620</span>&#160;        {</div>
-<div class="line"><a name="l05621"></a><span class="lineno"> 5621</span>&#160;        }</div>
-<div class="line"><a name="l05622"></a><span class="lineno"> 5622</span>&#160; </div>
-<div class="line"><a name="l05623"></a><span class="lineno"> 5623</span>&#160;        T&amp; operator*()<span class="keyword"> const</span></div>
-<div class="line"><a name="l05624"></a><span class="lineno"> 5624</span>&#160;<span class="keyword">        </span>{</div>
-<div class="line"><a name="l05625"></a><span class="lineno"> 5625</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
-<div class="line"><a name="l05626"></a><span class="lineno"> 5626</span>&#160;            <span class="keywordflow">return</span> m_pItem-&gt;Value;</div>
-<div class="line"><a name="l05627"></a><span class="lineno"> 5627</span>&#160;        }</div>
-<div class="line"><a name="l05628"></a><span class="lineno"> 5628</span>&#160;        T* operator-&gt;()<span class="keyword"> const</span></div>
-<div class="line"><a name="l05629"></a><span class="lineno"> 5629</span>&#160;<span class="keyword">        </span>{</div>
-<div class="line"><a name="l05630"></a><span class="lineno"> 5630</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
-<div class="line"><a name="l05631"></a><span class="lineno"> 5631</span>&#160;            <span class="keywordflow">return</span> &amp;m_pItem-&gt;Value;</div>
-<div class="line"><a name="l05632"></a><span class="lineno"> 5632</span>&#160;        }</div>
+<div class="line"><a name="l05531"></a><span class="lineno"> 5531</span>&#160;    m_pFront = pNextItem;</div>
+<div class="line"><a name="l05532"></a><span class="lineno"> 5532</span>&#160;    m_ItemAllocator.Free(pFrontItem);</div>
+<div class="line"><a name="l05533"></a><span class="lineno"> 5533</span>&#160;    --m_Count;</div>
+<div class="line"><a name="l05534"></a><span class="lineno"> 5534</span>&#160;}</div>
+<div class="line"><a name="l05535"></a><span class="lineno"> 5535</span>&#160; </div>
+<div class="line"><a name="l05536"></a><span class="lineno"> 5536</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05537"></a><span class="lineno"> 5537</span>&#160;<span class="keywordtype">void</span> VmaRawList&lt;T&gt;::Remove(ItemType* pItem)</div>
+<div class="line"><a name="l05538"></a><span class="lineno"> 5538</span>&#160;{</div>
+<div class="line"><a name="l05539"></a><span class="lineno"> 5539</span>&#160;    VMA_HEAVY_ASSERT(pItem != VMA_NULL);</div>
+<div class="line"><a name="l05540"></a><span class="lineno"> 5540</span>&#160;    VMA_HEAVY_ASSERT(m_Count &gt; 0);</div>
+<div class="line"><a name="l05541"></a><span class="lineno"> 5541</span>&#160; </div>
+<div class="line"><a name="l05542"></a><span class="lineno"> 5542</span>&#160;    <span class="keywordflow">if</span>(pItem-&gt;pPrev != VMA_NULL)</div>
+<div class="line"><a name="l05543"></a><span class="lineno"> 5543</span>&#160;    {</div>
+<div class="line"><a name="l05544"></a><span class="lineno"> 5544</span>&#160;        pItem-&gt;pPrev-&gt;pNext = pItem-&gt;pNext;</div>
+<div class="line"><a name="l05545"></a><span class="lineno"> 5545</span>&#160;    }</div>
+<div class="line"><a name="l05546"></a><span class="lineno"> 5546</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05547"></a><span class="lineno"> 5547</span>&#160;    {</div>
+<div class="line"><a name="l05548"></a><span class="lineno"> 5548</span>&#160;        VMA_HEAVY_ASSERT(m_pFront == pItem);</div>
+<div class="line"><a name="l05549"></a><span class="lineno"> 5549</span>&#160;        m_pFront = pItem-&gt;pNext;</div>
+<div class="line"><a name="l05550"></a><span class="lineno"> 5550</span>&#160;    }</div>
+<div class="line"><a name="l05551"></a><span class="lineno"> 5551</span>&#160; </div>
+<div class="line"><a name="l05552"></a><span class="lineno"> 5552</span>&#160;    <span class="keywordflow">if</span>(pItem-&gt;pNext != VMA_NULL)</div>
+<div class="line"><a name="l05553"></a><span class="lineno"> 5553</span>&#160;    {</div>
+<div class="line"><a name="l05554"></a><span class="lineno"> 5554</span>&#160;        pItem-&gt;pNext-&gt;pPrev = pItem-&gt;pPrev;</div>
+<div class="line"><a name="l05555"></a><span class="lineno"> 5555</span>&#160;    }</div>
+<div class="line"><a name="l05556"></a><span class="lineno"> 5556</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05557"></a><span class="lineno"> 5557</span>&#160;    {</div>
+<div class="line"><a name="l05558"></a><span class="lineno"> 5558</span>&#160;        VMA_HEAVY_ASSERT(m_pBack == pItem);</div>
+<div class="line"><a name="l05559"></a><span class="lineno"> 5559</span>&#160;        m_pBack = pItem-&gt;pPrev;</div>
+<div class="line"><a name="l05560"></a><span class="lineno"> 5560</span>&#160;    }</div>
+<div class="line"><a name="l05561"></a><span class="lineno"> 5561</span>&#160; </div>
+<div class="line"><a name="l05562"></a><span class="lineno"> 5562</span>&#160;    m_ItemAllocator.Free(pItem);</div>
+<div class="line"><a name="l05563"></a><span class="lineno"> 5563</span>&#160;    --m_Count;</div>
+<div class="line"><a name="l05564"></a><span class="lineno"> 5564</span>&#160;}</div>
+<div class="line"><a name="l05565"></a><span class="lineno"> 5565</span>&#160; </div>
+<div class="line"><a name="l05566"></a><span class="lineno"> 5566</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05567"></a><span class="lineno"> 5567</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::InsertBefore(ItemType* pItem)</div>
+<div class="line"><a name="l05568"></a><span class="lineno"> 5568</span>&#160;{</div>
+<div class="line"><a name="l05569"></a><span class="lineno"> 5569</span>&#160;    <span class="keywordflow">if</span>(pItem != VMA_NULL)</div>
+<div class="line"><a name="l05570"></a><span class="lineno"> 5570</span>&#160;    {</div>
+<div class="line"><a name="l05571"></a><span class="lineno"> 5571</span>&#160;        ItemType* <span class="keyword">const</span> prevItem = pItem-&gt;pPrev;</div>
+<div class="line"><a name="l05572"></a><span class="lineno"> 5572</span>&#160;        ItemType* <span class="keyword">const</span> newItem = m_ItemAllocator.Alloc();</div>
+<div class="line"><a name="l05573"></a><span class="lineno"> 5573</span>&#160;        newItem-&gt;pPrev = prevItem;</div>
+<div class="line"><a name="l05574"></a><span class="lineno"> 5574</span>&#160;        newItem-&gt;pNext = pItem;</div>
+<div class="line"><a name="l05575"></a><span class="lineno"> 5575</span>&#160;        pItem-&gt;pPrev = newItem;</div>
+<div class="line"><a name="l05576"></a><span class="lineno"> 5576</span>&#160;        <span class="keywordflow">if</span>(prevItem != VMA_NULL)</div>
+<div class="line"><a name="l05577"></a><span class="lineno"> 5577</span>&#160;        {</div>
+<div class="line"><a name="l05578"></a><span class="lineno"> 5578</span>&#160;            prevItem-&gt;pNext = newItem;</div>
+<div class="line"><a name="l05579"></a><span class="lineno"> 5579</span>&#160;        }</div>
+<div class="line"><a name="l05580"></a><span class="lineno"> 5580</span>&#160;        <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05581"></a><span class="lineno"> 5581</span>&#160;        {</div>
+<div class="line"><a name="l05582"></a><span class="lineno"> 5582</span>&#160;            VMA_HEAVY_ASSERT(m_pFront == pItem);</div>
+<div class="line"><a name="l05583"></a><span class="lineno"> 5583</span>&#160;            m_pFront = newItem;</div>
+<div class="line"><a name="l05584"></a><span class="lineno"> 5584</span>&#160;        }</div>
+<div class="line"><a name="l05585"></a><span class="lineno"> 5585</span>&#160;        ++m_Count;</div>
+<div class="line"><a name="l05586"></a><span class="lineno"> 5586</span>&#160;        <span class="keywordflow">return</span> newItem;</div>
+<div class="line"><a name="l05587"></a><span class="lineno"> 5587</span>&#160;    }</div>
+<div class="line"><a name="l05588"></a><span class="lineno"> 5588</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05589"></a><span class="lineno"> 5589</span>&#160;        <span class="keywordflow">return</span> PushBack();</div>
+<div class="line"><a name="l05590"></a><span class="lineno"> 5590</span>&#160;}</div>
+<div class="line"><a name="l05591"></a><span class="lineno"> 5591</span>&#160; </div>
+<div class="line"><a name="l05592"></a><span class="lineno"> 5592</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05593"></a><span class="lineno"> 5593</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::InsertAfter(ItemType* pItem)</div>
+<div class="line"><a name="l05594"></a><span class="lineno"> 5594</span>&#160;{</div>
+<div class="line"><a name="l05595"></a><span class="lineno"> 5595</span>&#160;    <span class="keywordflow">if</span>(pItem != VMA_NULL)</div>
+<div class="line"><a name="l05596"></a><span class="lineno"> 5596</span>&#160;    {</div>
+<div class="line"><a name="l05597"></a><span class="lineno"> 5597</span>&#160;        ItemType* <span class="keyword">const</span> nextItem = pItem-&gt;pNext;</div>
+<div class="line"><a name="l05598"></a><span class="lineno"> 5598</span>&#160;        ItemType* <span class="keyword">const</span> newItem = m_ItemAllocator.Alloc();</div>
+<div class="line"><a name="l05599"></a><span class="lineno"> 5599</span>&#160;        newItem-&gt;pNext = nextItem;</div>
+<div class="line"><a name="l05600"></a><span class="lineno"> 5600</span>&#160;        newItem-&gt;pPrev = pItem;</div>
+<div class="line"><a name="l05601"></a><span class="lineno"> 5601</span>&#160;        pItem-&gt;pNext = newItem;</div>
+<div class="line"><a name="l05602"></a><span class="lineno"> 5602</span>&#160;        <span class="keywordflow">if</span>(nextItem != VMA_NULL)</div>
+<div class="line"><a name="l05603"></a><span class="lineno"> 5603</span>&#160;        {</div>
+<div class="line"><a name="l05604"></a><span class="lineno"> 5604</span>&#160;            nextItem-&gt;pPrev = newItem;</div>
+<div class="line"><a name="l05605"></a><span class="lineno"> 5605</span>&#160;        }</div>
+<div class="line"><a name="l05606"></a><span class="lineno"> 5606</span>&#160;        <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05607"></a><span class="lineno"> 5607</span>&#160;        {</div>
+<div class="line"><a name="l05608"></a><span class="lineno"> 5608</span>&#160;            VMA_HEAVY_ASSERT(m_pBack == pItem);</div>
+<div class="line"><a name="l05609"></a><span class="lineno"> 5609</span>&#160;            m_pBack = newItem;</div>
+<div class="line"><a name="l05610"></a><span class="lineno"> 5610</span>&#160;        }</div>
+<div class="line"><a name="l05611"></a><span class="lineno"> 5611</span>&#160;        ++m_Count;</div>
+<div class="line"><a name="l05612"></a><span class="lineno"> 5612</span>&#160;        <span class="keywordflow">return</span> newItem;</div>
+<div class="line"><a name="l05613"></a><span class="lineno"> 5613</span>&#160;    }</div>
+<div class="line"><a name="l05614"></a><span class="lineno"> 5614</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05615"></a><span class="lineno"> 5615</span>&#160;        <span class="keywordflow">return</span> PushFront();</div>
+<div class="line"><a name="l05616"></a><span class="lineno"> 5616</span>&#160;}</div>
+<div class="line"><a name="l05617"></a><span class="lineno"> 5617</span>&#160; </div>
+<div class="line"><a name="l05618"></a><span class="lineno"> 5618</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05619"></a><span class="lineno"> 5619</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::InsertBefore(ItemType* pItem, <span class="keyword">const</span> T&amp; value)</div>
+<div class="line"><a name="l05620"></a><span class="lineno"> 5620</span>&#160;{</div>
+<div class="line"><a name="l05621"></a><span class="lineno"> 5621</span>&#160;    ItemType* <span class="keyword">const</span> newItem = InsertBefore(pItem);</div>
+<div class="line"><a name="l05622"></a><span class="lineno"> 5622</span>&#160;    newItem-&gt;Value = value;</div>
+<div class="line"><a name="l05623"></a><span class="lineno"> 5623</span>&#160;    <span class="keywordflow">return</span> newItem;</div>
+<div class="line"><a name="l05624"></a><span class="lineno"> 5624</span>&#160;}</div>
+<div class="line"><a name="l05625"></a><span class="lineno"> 5625</span>&#160; </div>
+<div class="line"><a name="l05626"></a><span class="lineno"> 5626</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
+<div class="line"><a name="l05627"></a><span class="lineno"> 5627</span>&#160;VmaListItem&lt;T&gt;* VmaRawList&lt;T&gt;::InsertAfter(ItemType* pItem, <span class="keyword">const</span> T&amp; value)</div>
+<div class="line"><a name="l05628"></a><span class="lineno"> 5628</span>&#160;{</div>
+<div class="line"><a name="l05629"></a><span class="lineno"> 5629</span>&#160;    ItemType* <span class="keyword">const</span> newItem = InsertAfter(pItem);</div>
+<div class="line"><a name="l05630"></a><span class="lineno"> 5630</span>&#160;    newItem-&gt;Value = value;</div>
+<div class="line"><a name="l05631"></a><span class="lineno"> 5631</span>&#160;    <span class="keywordflow">return</span> newItem;</div>
+<div class="line"><a name="l05632"></a><span class="lineno"> 5632</span>&#160;}</div>
 <div class="line"><a name="l05633"></a><span class="lineno"> 5633</span>&#160; </div>
-<div class="line"><a name="l05634"></a><span class="lineno"> 5634</span>&#160;        iterator&amp; operator++()</div>
-<div class="line"><a name="l05635"></a><span class="lineno"> 5635</span>&#160;        {</div>
-<div class="line"><a name="l05636"></a><span class="lineno"> 5636</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
-<div class="line"><a name="l05637"></a><span class="lineno"> 5637</span>&#160;            m_pItem = m_pItem-&gt;pNext;</div>
-<div class="line"><a name="l05638"></a><span class="lineno"> 5638</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05639"></a><span class="lineno"> 5639</span>&#160;        }</div>
-<div class="line"><a name="l05640"></a><span class="lineno"> 5640</span>&#160;        iterator&amp; operator--()</div>
-<div class="line"><a name="l05641"></a><span class="lineno"> 5641</span>&#160;        {</div>
-<div class="line"><a name="l05642"></a><span class="lineno"> 5642</span>&#160;            <span class="keywordflow">if</span>(m_pItem != VMA_NULL)</div>
-<div class="line"><a name="l05643"></a><span class="lineno"> 5643</span>&#160;            {</div>
-<div class="line"><a name="l05644"></a><span class="lineno"> 5644</span>&#160;                m_pItem = m_pItem-&gt;pPrev;</div>
-<div class="line"><a name="l05645"></a><span class="lineno"> 5645</span>&#160;            }</div>
-<div class="line"><a name="l05646"></a><span class="lineno"> 5646</span>&#160;            <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05647"></a><span class="lineno"> 5647</span>&#160;            {</div>
-<div class="line"><a name="l05648"></a><span class="lineno"> 5648</span>&#160;                VMA_HEAVY_ASSERT(!m_pList-&gt;IsEmpty());</div>
-<div class="line"><a name="l05649"></a><span class="lineno"> 5649</span>&#160;                m_pItem = m_pList-&gt;Back();</div>
-<div class="line"><a name="l05650"></a><span class="lineno"> 5650</span>&#160;            }</div>
-<div class="line"><a name="l05651"></a><span class="lineno"> 5651</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05634"></a><span class="lineno"> 5634</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> AllocatorT&gt;</div>
+<div class="line"><a name="l05635"></a><span class="lineno"> 5635</span>&#160;<span class="keyword">class </span>VmaList</div>
+<div class="line"><a name="l05636"></a><span class="lineno"> 5636</span>&#160;{</div>
+<div class="line"><a name="l05637"></a><span class="lineno"> 5637</span>&#160;    VMA_CLASS_NO_COPY(VmaList)</div>
+<div class="line"><a name="l05638"></a><span class="lineno"> 5638</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l05639"></a><span class="lineno"> 5639</span>&#160;    <span class="keyword">class </span>iterator</div>
+<div class="line"><a name="l05640"></a><span class="lineno"> 5640</span>&#160;    {</div>
+<div class="line"><a name="l05641"></a><span class="lineno"> 5641</span>&#160;    <span class="keyword">public</span>:</div>
+<div class="line"><a name="l05642"></a><span class="lineno"> 5642</span>&#160;        iterator() :</div>
+<div class="line"><a name="l05643"></a><span class="lineno"> 5643</span>&#160;            m_pList(VMA_NULL),</div>
+<div class="line"><a name="l05644"></a><span class="lineno"> 5644</span>&#160;            m_pItem(VMA_NULL)</div>
+<div class="line"><a name="l05645"></a><span class="lineno"> 5645</span>&#160;        {</div>
+<div class="line"><a name="l05646"></a><span class="lineno"> 5646</span>&#160;        }</div>
+<div class="line"><a name="l05647"></a><span class="lineno"> 5647</span>&#160; </div>
+<div class="line"><a name="l05648"></a><span class="lineno"> 5648</span>&#160;        T&amp; operator*()<span class="keyword"> const</span></div>
+<div class="line"><a name="l05649"></a><span class="lineno"> 5649</span>&#160;<span class="keyword">        </span>{</div>
+<div class="line"><a name="l05650"></a><span class="lineno"> 5650</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
+<div class="line"><a name="l05651"></a><span class="lineno"> 5651</span>&#160;            <span class="keywordflow">return</span> m_pItem-&gt;Value;</div>
 <div class="line"><a name="l05652"></a><span class="lineno"> 5652</span>&#160;        }</div>
-<div class="line"><a name="l05653"></a><span class="lineno"> 5653</span>&#160; </div>
-<div class="line"><a name="l05654"></a><span class="lineno"> 5654</span>&#160;        iterator operator++(<span class="keywordtype">int</span>)</div>
-<div class="line"><a name="l05655"></a><span class="lineno"> 5655</span>&#160;        {</div>
-<div class="line"><a name="l05656"></a><span class="lineno"> 5656</span>&#160;            iterator result = *<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05657"></a><span class="lineno"> 5657</span>&#160;            ++*<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05658"></a><span class="lineno"> 5658</span>&#160;            <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l05659"></a><span class="lineno"> 5659</span>&#160;        }</div>
-<div class="line"><a name="l05660"></a><span class="lineno"> 5660</span>&#160;        iterator operator--(<span class="keywordtype">int</span>)</div>
-<div class="line"><a name="l05661"></a><span class="lineno"> 5661</span>&#160;        {</div>
-<div class="line"><a name="l05662"></a><span class="lineno"> 5662</span>&#160;            iterator result = *<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05663"></a><span class="lineno"> 5663</span>&#160;            --*<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05664"></a><span class="lineno"> 5664</span>&#160;            <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l05665"></a><span class="lineno"> 5665</span>&#160;        }</div>
-<div class="line"><a name="l05666"></a><span class="lineno"> 5666</span>&#160; </div>
-<div class="line"><a name="l05667"></a><span class="lineno"> 5667</span>&#160;        <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> iterator&amp; rhs)<span class="keyword"> const</span></div>
-<div class="line"><a name="l05668"></a><span class="lineno"> 5668</span>&#160;<span class="keyword">        </span>{</div>
-<div class="line"><a name="l05669"></a><span class="lineno"> 5669</span>&#160;            VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);</div>
-<div class="line"><a name="l05670"></a><span class="lineno"> 5670</span>&#160;            <span class="keywordflow">return</span> m_pItem == rhs.m_pItem;</div>
-<div class="line"><a name="l05671"></a><span class="lineno"> 5671</span>&#160;        }</div>
-<div class="line"><a name="l05672"></a><span class="lineno"> 5672</span>&#160;        <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> iterator&amp; rhs)<span class="keyword"> const</span></div>
-<div class="line"><a name="l05673"></a><span class="lineno"> 5673</span>&#160;<span class="keyword">        </span>{</div>
-<div class="line"><a name="l05674"></a><span class="lineno"> 5674</span>&#160;            VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);</div>
-<div class="line"><a name="l05675"></a><span class="lineno"> 5675</span>&#160;            <span class="keywordflow">return</span> m_pItem != rhs.m_pItem;</div>
-<div class="line"><a name="l05676"></a><span class="lineno"> 5676</span>&#160;        }</div>
-<div class="line"><a name="l05677"></a><span class="lineno"> 5677</span>&#160;        </div>
-<div class="line"><a name="l05678"></a><span class="lineno"> 5678</span>&#160;    <span class="keyword">private</span>:</div>
-<div class="line"><a name="l05679"></a><span class="lineno"> 5679</span>&#160;        VmaRawList&lt;T&gt;* m_pList;</div>
-<div class="line"><a name="l05680"></a><span class="lineno"> 5680</span>&#160;        VmaListItem&lt;T&gt;* m_pItem;</div>
-<div class="line"><a name="l05681"></a><span class="lineno"> 5681</span>&#160; </div>
-<div class="line"><a name="l05682"></a><span class="lineno"> 5682</span>&#160;        iterator(VmaRawList&lt;T&gt;* pList, VmaListItem&lt;T&gt;* pItem) :</div>
-<div class="line"><a name="l05683"></a><span class="lineno"> 5683</span>&#160;            m_pList(pList),</div>
-<div class="line"><a name="l05684"></a><span class="lineno"> 5684</span>&#160;            m_pItem(pItem)</div>
-<div class="line"><a name="l05685"></a><span class="lineno"> 5685</span>&#160;        {</div>
-<div class="line"><a name="l05686"></a><span class="lineno"> 5686</span>&#160;        }</div>
-<div class="line"><a name="l05687"></a><span class="lineno"> 5687</span>&#160; </div>
-<div class="line"><a name="l05688"></a><span class="lineno"> 5688</span>&#160;        <span class="keyword">friend</span> <span class="keyword">class </span>VmaList&lt;T, AllocatorT&gt;;</div>
-<div class="line"><a name="l05689"></a><span class="lineno"> 5689</span>&#160;    };</div>
-<div class="line"><a name="l05690"></a><span class="lineno"> 5690</span>&#160; </div>
-<div class="line"><a name="l05691"></a><span class="lineno"> 5691</span>&#160;    <span class="keyword">class </span>const_iterator</div>
-<div class="line"><a name="l05692"></a><span class="lineno"> 5692</span>&#160;    {</div>
-<div class="line"><a name="l05693"></a><span class="lineno"> 5693</span>&#160;    <span class="keyword">public</span>:</div>
-<div class="line"><a name="l05694"></a><span class="lineno"> 5694</span>&#160;        const_iterator() :</div>
-<div class="line"><a name="l05695"></a><span class="lineno"> 5695</span>&#160;            m_pList(VMA_NULL),</div>
-<div class="line"><a name="l05696"></a><span class="lineno"> 5696</span>&#160;            m_pItem(VMA_NULL)</div>
-<div class="line"><a name="l05697"></a><span class="lineno"> 5697</span>&#160;        {</div>
-<div class="line"><a name="l05698"></a><span class="lineno"> 5698</span>&#160;        }</div>
-<div class="line"><a name="l05699"></a><span class="lineno"> 5699</span>&#160; </div>
-<div class="line"><a name="l05700"></a><span class="lineno"> 5700</span>&#160;        const_iterator(<span class="keyword">const</span> iterator&amp; src) :</div>
-<div class="line"><a name="l05701"></a><span class="lineno"> 5701</span>&#160;            m_pList(src.m_pList),</div>
-<div class="line"><a name="l05702"></a><span class="lineno"> 5702</span>&#160;            m_pItem(src.m_pItem)</div>
-<div class="line"><a name="l05703"></a><span class="lineno"> 5703</span>&#160;        {</div>
-<div class="line"><a name="l05704"></a><span class="lineno"> 5704</span>&#160;        }</div>
-<div class="line"><a name="l05705"></a><span class="lineno"> 5705</span>&#160;        </div>
-<div class="line"><a name="l05706"></a><span class="lineno"> 5706</span>&#160;        <span class="keyword">const</span> T&amp; operator*()<span class="keyword"> const</span></div>
-<div class="line"><a name="l05707"></a><span class="lineno"> 5707</span>&#160;<span class="keyword">        </span>{</div>
-<div class="line"><a name="l05708"></a><span class="lineno"> 5708</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
-<div class="line"><a name="l05709"></a><span class="lineno"> 5709</span>&#160;            <span class="keywordflow">return</span> m_pItem-&gt;Value;</div>
-<div class="line"><a name="l05710"></a><span class="lineno"> 5710</span>&#160;        }</div>
-<div class="line"><a name="l05711"></a><span class="lineno"> 5711</span>&#160;        <span class="keyword">const</span> T* operator-&gt;()<span class="keyword"> const</span></div>
-<div class="line"><a name="l05712"></a><span class="lineno"> 5712</span>&#160;<span class="keyword">        </span>{</div>
-<div class="line"><a name="l05713"></a><span class="lineno"> 5713</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
-<div class="line"><a name="l05714"></a><span class="lineno"> 5714</span>&#160;            <span class="keywordflow">return</span> &amp;m_pItem-&gt;Value;</div>
-<div class="line"><a name="l05715"></a><span class="lineno"> 5715</span>&#160;        }</div>
-<div class="line"><a name="l05716"></a><span class="lineno"> 5716</span>&#160; </div>
-<div class="line"><a name="l05717"></a><span class="lineno"> 5717</span>&#160;        const_iterator&amp; operator++()</div>
-<div class="line"><a name="l05718"></a><span class="lineno"> 5718</span>&#160;        {</div>
-<div class="line"><a name="l05719"></a><span class="lineno"> 5719</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
-<div class="line"><a name="l05720"></a><span class="lineno"> 5720</span>&#160;            m_pItem = m_pItem-&gt;pNext;</div>
-<div class="line"><a name="l05721"></a><span class="lineno"> 5721</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05722"></a><span class="lineno"> 5722</span>&#160;        }</div>
-<div class="line"><a name="l05723"></a><span class="lineno"> 5723</span>&#160;        const_iterator&amp; operator--()</div>
-<div class="line"><a name="l05724"></a><span class="lineno"> 5724</span>&#160;        {</div>
-<div class="line"><a name="l05725"></a><span class="lineno"> 5725</span>&#160;            <span class="keywordflow">if</span>(m_pItem != VMA_NULL)</div>
-<div class="line"><a name="l05726"></a><span class="lineno"> 5726</span>&#160;            {</div>
-<div class="line"><a name="l05727"></a><span class="lineno"> 5727</span>&#160;                m_pItem = m_pItem-&gt;pPrev;</div>
-<div class="line"><a name="l05728"></a><span class="lineno"> 5728</span>&#160;            }</div>
-<div class="line"><a name="l05729"></a><span class="lineno"> 5729</span>&#160;            <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05730"></a><span class="lineno"> 5730</span>&#160;            {</div>
-<div class="line"><a name="l05731"></a><span class="lineno"> 5731</span>&#160;                VMA_HEAVY_ASSERT(!m_pList-&gt;IsEmpty());</div>
-<div class="line"><a name="l05732"></a><span class="lineno"> 5732</span>&#160;                m_pItem = m_pList-&gt;Back();</div>
-<div class="line"><a name="l05733"></a><span class="lineno"> 5733</span>&#160;            }</div>
-<div class="line"><a name="l05734"></a><span class="lineno"> 5734</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05653"></a><span class="lineno"> 5653</span>&#160;        T* operator-&gt;()<span class="keyword"> const</span></div>
+<div class="line"><a name="l05654"></a><span class="lineno"> 5654</span>&#160;<span class="keyword">        </span>{</div>
+<div class="line"><a name="l05655"></a><span class="lineno"> 5655</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
+<div class="line"><a name="l05656"></a><span class="lineno"> 5656</span>&#160;            <span class="keywordflow">return</span> &amp;m_pItem-&gt;Value;</div>
+<div class="line"><a name="l05657"></a><span class="lineno"> 5657</span>&#160;        }</div>
+<div class="line"><a name="l05658"></a><span class="lineno"> 5658</span>&#160; </div>
+<div class="line"><a name="l05659"></a><span class="lineno"> 5659</span>&#160;        iterator&amp; operator++()</div>
+<div class="line"><a name="l05660"></a><span class="lineno"> 5660</span>&#160;        {</div>
+<div class="line"><a name="l05661"></a><span class="lineno"> 5661</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
+<div class="line"><a name="l05662"></a><span class="lineno"> 5662</span>&#160;            m_pItem = m_pItem-&gt;pNext;</div>
+<div class="line"><a name="l05663"></a><span class="lineno"> 5663</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05664"></a><span class="lineno"> 5664</span>&#160;        }</div>
+<div class="line"><a name="l05665"></a><span class="lineno"> 5665</span>&#160;        iterator&amp; operator--()</div>
+<div class="line"><a name="l05666"></a><span class="lineno"> 5666</span>&#160;        {</div>
+<div class="line"><a name="l05667"></a><span class="lineno"> 5667</span>&#160;            <span class="keywordflow">if</span>(m_pItem != VMA_NULL)</div>
+<div class="line"><a name="l05668"></a><span class="lineno"> 5668</span>&#160;            {</div>
+<div class="line"><a name="l05669"></a><span class="lineno"> 5669</span>&#160;                m_pItem = m_pItem-&gt;pPrev;</div>
+<div class="line"><a name="l05670"></a><span class="lineno"> 5670</span>&#160;            }</div>
+<div class="line"><a name="l05671"></a><span class="lineno"> 5671</span>&#160;            <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05672"></a><span class="lineno"> 5672</span>&#160;            {</div>
+<div class="line"><a name="l05673"></a><span class="lineno"> 5673</span>&#160;                VMA_HEAVY_ASSERT(!m_pList-&gt;IsEmpty());</div>
+<div class="line"><a name="l05674"></a><span class="lineno"> 5674</span>&#160;                m_pItem = m_pList-&gt;Back();</div>
+<div class="line"><a name="l05675"></a><span class="lineno"> 5675</span>&#160;            }</div>
+<div class="line"><a name="l05676"></a><span class="lineno"> 5676</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05677"></a><span class="lineno"> 5677</span>&#160;        }</div>
+<div class="line"><a name="l05678"></a><span class="lineno"> 5678</span>&#160; </div>
+<div class="line"><a name="l05679"></a><span class="lineno"> 5679</span>&#160;        iterator operator++(<span class="keywordtype">int</span>)</div>
+<div class="line"><a name="l05680"></a><span class="lineno"> 5680</span>&#160;        {</div>
+<div class="line"><a name="l05681"></a><span class="lineno"> 5681</span>&#160;            iterator result = *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05682"></a><span class="lineno"> 5682</span>&#160;            ++*<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05683"></a><span class="lineno"> 5683</span>&#160;            <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l05684"></a><span class="lineno"> 5684</span>&#160;        }</div>
+<div class="line"><a name="l05685"></a><span class="lineno"> 5685</span>&#160;        iterator operator--(<span class="keywordtype">int</span>)</div>
+<div class="line"><a name="l05686"></a><span class="lineno"> 5686</span>&#160;        {</div>
+<div class="line"><a name="l05687"></a><span class="lineno"> 5687</span>&#160;            iterator result = *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05688"></a><span class="lineno"> 5688</span>&#160;            --*<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05689"></a><span class="lineno"> 5689</span>&#160;            <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l05690"></a><span class="lineno"> 5690</span>&#160;        }</div>
+<div class="line"><a name="l05691"></a><span class="lineno"> 5691</span>&#160; </div>
+<div class="line"><a name="l05692"></a><span class="lineno"> 5692</span>&#160;        <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> iterator&amp; rhs)<span class="keyword"> const</span></div>
+<div class="line"><a name="l05693"></a><span class="lineno"> 5693</span>&#160;<span class="keyword">        </span>{</div>
+<div class="line"><a name="l05694"></a><span class="lineno"> 5694</span>&#160;            VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);</div>
+<div class="line"><a name="l05695"></a><span class="lineno"> 5695</span>&#160;            <span class="keywordflow">return</span> m_pItem == rhs.m_pItem;</div>
+<div class="line"><a name="l05696"></a><span class="lineno"> 5696</span>&#160;        }</div>
+<div class="line"><a name="l05697"></a><span class="lineno"> 5697</span>&#160;        <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> iterator&amp; rhs)<span class="keyword"> const</span></div>
+<div class="line"><a name="l05698"></a><span class="lineno"> 5698</span>&#160;<span class="keyword">        </span>{</div>
+<div class="line"><a name="l05699"></a><span class="lineno"> 5699</span>&#160;            VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);</div>
+<div class="line"><a name="l05700"></a><span class="lineno"> 5700</span>&#160;            <span class="keywordflow">return</span> m_pItem != rhs.m_pItem;</div>
+<div class="line"><a name="l05701"></a><span class="lineno"> 5701</span>&#160;        }</div>
+<div class="line"><a name="l05702"></a><span class="lineno"> 5702</span>&#160;        </div>
+<div class="line"><a name="l05703"></a><span class="lineno"> 5703</span>&#160;    <span class="keyword">private</span>:</div>
+<div class="line"><a name="l05704"></a><span class="lineno"> 5704</span>&#160;        VmaRawList&lt;T&gt;* m_pList;</div>
+<div class="line"><a name="l05705"></a><span class="lineno"> 5705</span>&#160;        VmaListItem&lt;T&gt;* m_pItem;</div>
+<div class="line"><a name="l05706"></a><span class="lineno"> 5706</span>&#160; </div>
+<div class="line"><a name="l05707"></a><span class="lineno"> 5707</span>&#160;        iterator(VmaRawList&lt;T&gt;* pList, VmaListItem&lt;T&gt;* pItem) :</div>
+<div class="line"><a name="l05708"></a><span class="lineno"> 5708</span>&#160;            m_pList(pList),</div>
+<div class="line"><a name="l05709"></a><span class="lineno"> 5709</span>&#160;            m_pItem(pItem)</div>
+<div class="line"><a name="l05710"></a><span class="lineno"> 5710</span>&#160;        {</div>
+<div class="line"><a name="l05711"></a><span class="lineno"> 5711</span>&#160;        }</div>
+<div class="line"><a name="l05712"></a><span class="lineno"> 5712</span>&#160; </div>
+<div class="line"><a name="l05713"></a><span class="lineno"> 5713</span>&#160;        <span class="keyword">friend</span> <span class="keyword">class </span>VmaList&lt;T, AllocatorT&gt;;</div>
+<div class="line"><a name="l05714"></a><span class="lineno"> 5714</span>&#160;    };</div>
+<div class="line"><a name="l05715"></a><span class="lineno"> 5715</span>&#160; </div>
+<div class="line"><a name="l05716"></a><span class="lineno"> 5716</span>&#160;    <span class="keyword">class </span>const_iterator</div>
+<div class="line"><a name="l05717"></a><span class="lineno"> 5717</span>&#160;    {</div>
+<div class="line"><a name="l05718"></a><span class="lineno"> 5718</span>&#160;    <span class="keyword">public</span>:</div>
+<div class="line"><a name="l05719"></a><span class="lineno"> 5719</span>&#160;        const_iterator() :</div>
+<div class="line"><a name="l05720"></a><span class="lineno"> 5720</span>&#160;            m_pList(VMA_NULL),</div>
+<div class="line"><a name="l05721"></a><span class="lineno"> 5721</span>&#160;            m_pItem(VMA_NULL)</div>
+<div class="line"><a name="l05722"></a><span class="lineno"> 5722</span>&#160;        {</div>
+<div class="line"><a name="l05723"></a><span class="lineno"> 5723</span>&#160;        }</div>
+<div class="line"><a name="l05724"></a><span class="lineno"> 5724</span>&#160; </div>
+<div class="line"><a name="l05725"></a><span class="lineno"> 5725</span>&#160;        const_iterator(<span class="keyword">const</span> iterator&amp; src) :</div>
+<div class="line"><a name="l05726"></a><span class="lineno"> 5726</span>&#160;            m_pList(src.m_pList),</div>
+<div class="line"><a name="l05727"></a><span class="lineno"> 5727</span>&#160;            m_pItem(src.m_pItem)</div>
+<div class="line"><a name="l05728"></a><span class="lineno"> 5728</span>&#160;        {</div>
+<div class="line"><a name="l05729"></a><span class="lineno"> 5729</span>&#160;        }</div>
+<div class="line"><a name="l05730"></a><span class="lineno"> 5730</span>&#160;        </div>
+<div class="line"><a name="l05731"></a><span class="lineno"> 5731</span>&#160;        <span class="keyword">const</span> T&amp; operator*()<span class="keyword"> const</span></div>
+<div class="line"><a name="l05732"></a><span class="lineno"> 5732</span>&#160;<span class="keyword">        </span>{</div>
+<div class="line"><a name="l05733"></a><span class="lineno"> 5733</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
+<div class="line"><a name="l05734"></a><span class="lineno"> 5734</span>&#160;            <span class="keywordflow">return</span> m_pItem-&gt;Value;</div>
 <div class="line"><a name="l05735"></a><span class="lineno"> 5735</span>&#160;        }</div>
-<div class="line"><a name="l05736"></a><span class="lineno"> 5736</span>&#160; </div>
-<div class="line"><a name="l05737"></a><span class="lineno"> 5737</span>&#160;        const_iterator operator++(<span class="keywordtype">int</span>)</div>
-<div class="line"><a name="l05738"></a><span class="lineno"> 5738</span>&#160;        {</div>
-<div class="line"><a name="l05739"></a><span class="lineno"> 5739</span>&#160;            const_iterator result = *<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05740"></a><span class="lineno"> 5740</span>&#160;            ++*<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05741"></a><span class="lineno"> 5741</span>&#160;            <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l05742"></a><span class="lineno"> 5742</span>&#160;        }</div>
-<div class="line"><a name="l05743"></a><span class="lineno"> 5743</span>&#160;        const_iterator operator--(<span class="keywordtype">int</span>)</div>
-<div class="line"><a name="l05744"></a><span class="lineno"> 5744</span>&#160;        {</div>
-<div class="line"><a name="l05745"></a><span class="lineno"> 5745</span>&#160;            const_iterator result = *<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05746"></a><span class="lineno"> 5746</span>&#160;            --*<span class="keyword">this</span>;</div>
-<div class="line"><a name="l05747"></a><span class="lineno"> 5747</span>&#160;            <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l05748"></a><span class="lineno"> 5748</span>&#160;        }</div>
-<div class="line"><a name="l05749"></a><span class="lineno"> 5749</span>&#160; </div>
-<div class="line"><a name="l05750"></a><span class="lineno"> 5750</span>&#160;        <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> const_iterator&amp; rhs)<span class="keyword"> const</span></div>
-<div class="line"><a name="l05751"></a><span class="lineno"> 5751</span>&#160;<span class="keyword">        </span>{</div>
-<div class="line"><a name="l05752"></a><span class="lineno"> 5752</span>&#160;            VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);</div>
-<div class="line"><a name="l05753"></a><span class="lineno"> 5753</span>&#160;            <span class="keywordflow">return</span> m_pItem == rhs.m_pItem;</div>
-<div class="line"><a name="l05754"></a><span class="lineno"> 5754</span>&#160;        }</div>
-<div class="line"><a name="l05755"></a><span class="lineno"> 5755</span>&#160;        <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> const_iterator&amp; rhs)<span class="keyword"> const</span></div>
-<div class="line"><a name="l05756"></a><span class="lineno"> 5756</span>&#160;<span class="keyword">        </span>{</div>
-<div class="line"><a name="l05757"></a><span class="lineno"> 5757</span>&#160;            VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);</div>
-<div class="line"><a name="l05758"></a><span class="lineno"> 5758</span>&#160;            <span class="keywordflow">return</span> m_pItem != rhs.m_pItem;</div>
-<div class="line"><a name="l05759"></a><span class="lineno"> 5759</span>&#160;        }</div>
-<div class="line"><a name="l05760"></a><span class="lineno"> 5760</span>&#160;        </div>
-<div class="line"><a name="l05761"></a><span class="lineno"> 5761</span>&#160;    <span class="keyword">private</span>:</div>
-<div class="line"><a name="l05762"></a><span class="lineno"> 5762</span>&#160;        const_iterator(<span class="keyword">const</span> VmaRawList&lt;T&gt;* pList, <span class="keyword">const</span> VmaListItem&lt;T&gt;* pItem) :</div>
-<div class="line"><a name="l05763"></a><span class="lineno"> 5763</span>&#160;            m_pList(pList),</div>
-<div class="line"><a name="l05764"></a><span class="lineno"> 5764</span>&#160;            m_pItem(pItem)</div>
-<div class="line"><a name="l05765"></a><span class="lineno"> 5765</span>&#160;        {</div>
-<div class="line"><a name="l05766"></a><span class="lineno"> 5766</span>&#160;        }</div>
-<div class="line"><a name="l05767"></a><span class="lineno"> 5767</span>&#160; </div>
-<div class="line"><a name="l05768"></a><span class="lineno"> 5768</span>&#160;        <span class="keyword">const</span> VmaRawList&lt;T&gt;* m_pList;</div>
-<div class="line"><a name="l05769"></a><span class="lineno"> 5769</span>&#160;        <span class="keyword">const</span> VmaListItem&lt;T&gt;* m_pItem;</div>
-<div class="line"><a name="l05770"></a><span class="lineno"> 5770</span>&#160; </div>
-<div class="line"><a name="l05771"></a><span class="lineno"> 5771</span>&#160;        <span class="keyword">friend</span> <span class="keyword">class </span>VmaList&lt;T, AllocatorT&gt;;</div>
-<div class="line"><a name="l05772"></a><span class="lineno"> 5772</span>&#160;    };</div>
-<div class="line"><a name="l05773"></a><span class="lineno"> 5773</span>&#160; </div>
-<div class="line"><a name="l05774"></a><span class="lineno"> 5774</span>&#160;    VmaList(<span class="keyword">const</span> AllocatorT&amp; allocator) : m_RawList(allocator.m_pCallbacks) { }</div>
-<div class="line"><a name="l05775"></a><span class="lineno"> 5775</span>&#160; </div>
-<div class="line"><a name="l05776"></a><span class="lineno"> 5776</span>&#160;    <span class="keywordtype">bool</span> empty()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_RawList.IsEmpty(); }</div>
-<div class="line"><a name="l05777"></a><span class="lineno"> 5777</span>&#160;    <span class="keywordtype">size_t</span> size()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_RawList.GetCount(); }</div>
-<div class="line"><a name="l05778"></a><span class="lineno"> 5778</span>&#160; </div>
-<div class="line"><a name="l05779"></a><span class="lineno"> 5779</span>&#160;    iterator begin() { <span class="keywordflow">return</span> iterator(&amp;m_RawList, m_RawList.Front()); }</div>
-<div class="line"><a name="l05780"></a><span class="lineno"> 5780</span>&#160;    iterator end() { <span class="keywordflow">return</span> iterator(&amp;m_RawList, VMA_NULL); }</div>
-<div class="line"><a name="l05781"></a><span class="lineno"> 5781</span>&#160; </div>
-<div class="line"><a name="l05782"></a><span class="lineno"> 5782</span>&#160;    const_iterator cbegin()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> const_iterator(&amp;m_RawList, m_RawList.Front()); }</div>
-<div class="line"><a name="l05783"></a><span class="lineno"> 5783</span>&#160;    const_iterator cend()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> const_iterator(&amp;m_RawList, VMA_NULL); }</div>
-<div class="line"><a name="l05784"></a><span class="lineno"> 5784</span>&#160; </div>
-<div class="line"><a name="l05785"></a><span class="lineno"> 5785</span>&#160;    <span class="keywordtype">void</span> clear() { m_RawList.Clear(); }</div>
-<div class="line"><a name="l05786"></a><span class="lineno"> 5786</span>&#160;    <span class="keywordtype">void</span> push_back(<span class="keyword">const</span> T&amp; value) { m_RawList.PushBack(value); }</div>
-<div class="line"><a name="l05787"></a><span class="lineno"> 5787</span>&#160;    <span class="keywordtype">void</span> erase(iterator it) { m_RawList.Remove(it.m_pItem); }</div>
-<div class="line"><a name="l05788"></a><span class="lineno"> 5788</span>&#160;    iterator insert(iterator it, <span class="keyword">const</span> T&amp; value) { <span class="keywordflow">return</span> iterator(&amp;m_RawList, m_RawList.InsertBefore(it.m_pItem, value)); }</div>
-<div class="line"><a name="l05789"></a><span class="lineno"> 5789</span>&#160; </div>
-<div class="line"><a name="l05790"></a><span class="lineno"> 5790</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l05791"></a><span class="lineno"> 5791</span>&#160;    VmaRawList&lt;T&gt; m_RawList;</div>
-<div class="line"><a name="l05792"></a><span class="lineno"> 5792</span>&#160;};</div>
-<div class="line"><a name="l05793"></a><span class="lineno"> 5793</span>&#160; </div>
-<div class="line"><a name="l05794"></a><span class="lineno"> 5794</span>&#160;<span class="preprocessor">#endif // #if VMA_USE_STL_LIST</span></div>
+<div class="line"><a name="l05736"></a><span class="lineno"> 5736</span>&#160;        <span class="keyword">const</span> T* operator-&gt;()<span class="keyword"> const</span></div>
+<div class="line"><a name="l05737"></a><span class="lineno"> 5737</span>&#160;<span class="keyword">        </span>{</div>
+<div class="line"><a name="l05738"></a><span class="lineno"> 5738</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
+<div class="line"><a name="l05739"></a><span class="lineno"> 5739</span>&#160;            <span class="keywordflow">return</span> &amp;m_pItem-&gt;Value;</div>
+<div class="line"><a name="l05740"></a><span class="lineno"> 5740</span>&#160;        }</div>
+<div class="line"><a name="l05741"></a><span class="lineno"> 5741</span>&#160; </div>
+<div class="line"><a name="l05742"></a><span class="lineno"> 5742</span>&#160;        const_iterator&amp; operator++()</div>
+<div class="line"><a name="l05743"></a><span class="lineno"> 5743</span>&#160;        {</div>
+<div class="line"><a name="l05744"></a><span class="lineno"> 5744</span>&#160;            VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);</div>
+<div class="line"><a name="l05745"></a><span class="lineno"> 5745</span>&#160;            m_pItem = m_pItem-&gt;pNext;</div>
+<div class="line"><a name="l05746"></a><span class="lineno"> 5746</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05747"></a><span class="lineno"> 5747</span>&#160;        }</div>
+<div class="line"><a name="l05748"></a><span class="lineno"> 5748</span>&#160;        const_iterator&amp; operator--()</div>
+<div class="line"><a name="l05749"></a><span class="lineno"> 5749</span>&#160;        {</div>
+<div class="line"><a name="l05750"></a><span class="lineno"> 5750</span>&#160;            <span class="keywordflow">if</span>(m_pItem != VMA_NULL)</div>
+<div class="line"><a name="l05751"></a><span class="lineno"> 5751</span>&#160;            {</div>
+<div class="line"><a name="l05752"></a><span class="lineno"> 5752</span>&#160;                m_pItem = m_pItem-&gt;pPrev;</div>
+<div class="line"><a name="l05753"></a><span class="lineno"> 5753</span>&#160;            }</div>
+<div class="line"><a name="l05754"></a><span class="lineno"> 5754</span>&#160;            <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05755"></a><span class="lineno"> 5755</span>&#160;            {</div>
+<div class="line"><a name="l05756"></a><span class="lineno"> 5756</span>&#160;                VMA_HEAVY_ASSERT(!m_pList-&gt;IsEmpty());</div>
+<div class="line"><a name="l05757"></a><span class="lineno"> 5757</span>&#160;                m_pItem = m_pList-&gt;Back();</div>
+<div class="line"><a name="l05758"></a><span class="lineno"> 5758</span>&#160;            }</div>
+<div class="line"><a name="l05759"></a><span class="lineno"> 5759</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05760"></a><span class="lineno"> 5760</span>&#160;        }</div>
+<div class="line"><a name="l05761"></a><span class="lineno"> 5761</span>&#160; </div>
+<div class="line"><a name="l05762"></a><span class="lineno"> 5762</span>&#160;        const_iterator operator++(<span class="keywordtype">int</span>)</div>
+<div class="line"><a name="l05763"></a><span class="lineno"> 5763</span>&#160;        {</div>
+<div class="line"><a name="l05764"></a><span class="lineno"> 5764</span>&#160;            const_iterator result = *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05765"></a><span class="lineno"> 5765</span>&#160;            ++*<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05766"></a><span class="lineno"> 5766</span>&#160;            <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l05767"></a><span class="lineno"> 5767</span>&#160;        }</div>
+<div class="line"><a name="l05768"></a><span class="lineno"> 5768</span>&#160;        const_iterator operator--(<span class="keywordtype">int</span>)</div>
+<div class="line"><a name="l05769"></a><span class="lineno"> 5769</span>&#160;        {</div>
+<div class="line"><a name="l05770"></a><span class="lineno"> 5770</span>&#160;            const_iterator result = *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05771"></a><span class="lineno"> 5771</span>&#160;            --*<span class="keyword">this</span>;</div>
+<div class="line"><a name="l05772"></a><span class="lineno"> 5772</span>&#160;            <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l05773"></a><span class="lineno"> 5773</span>&#160;        }</div>
+<div class="line"><a name="l05774"></a><span class="lineno"> 5774</span>&#160; </div>
+<div class="line"><a name="l05775"></a><span class="lineno"> 5775</span>&#160;        <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> const_iterator&amp; rhs)<span class="keyword"> const</span></div>
+<div class="line"><a name="l05776"></a><span class="lineno"> 5776</span>&#160;<span class="keyword">        </span>{</div>
+<div class="line"><a name="l05777"></a><span class="lineno"> 5777</span>&#160;            VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);</div>
+<div class="line"><a name="l05778"></a><span class="lineno"> 5778</span>&#160;            <span class="keywordflow">return</span> m_pItem == rhs.m_pItem;</div>
+<div class="line"><a name="l05779"></a><span class="lineno"> 5779</span>&#160;        }</div>
+<div class="line"><a name="l05780"></a><span class="lineno"> 5780</span>&#160;        <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> const_iterator&amp; rhs)<span class="keyword"> const</span></div>
+<div class="line"><a name="l05781"></a><span class="lineno"> 5781</span>&#160;<span class="keyword">        </span>{</div>
+<div class="line"><a name="l05782"></a><span class="lineno"> 5782</span>&#160;            VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);</div>
+<div class="line"><a name="l05783"></a><span class="lineno"> 5783</span>&#160;            <span class="keywordflow">return</span> m_pItem != rhs.m_pItem;</div>
+<div class="line"><a name="l05784"></a><span class="lineno"> 5784</span>&#160;        }</div>
+<div class="line"><a name="l05785"></a><span class="lineno"> 5785</span>&#160;        </div>
+<div class="line"><a name="l05786"></a><span class="lineno"> 5786</span>&#160;    <span class="keyword">private</span>:</div>
+<div class="line"><a name="l05787"></a><span class="lineno"> 5787</span>&#160;        const_iterator(<span class="keyword">const</span> VmaRawList&lt;T&gt;* pList, <span class="keyword">const</span> VmaListItem&lt;T&gt;* pItem) :</div>
+<div class="line"><a name="l05788"></a><span class="lineno"> 5788</span>&#160;            m_pList(pList),</div>
+<div class="line"><a name="l05789"></a><span class="lineno"> 5789</span>&#160;            m_pItem(pItem)</div>
+<div class="line"><a name="l05790"></a><span class="lineno"> 5790</span>&#160;        {</div>
+<div class="line"><a name="l05791"></a><span class="lineno"> 5791</span>&#160;        }</div>
+<div class="line"><a name="l05792"></a><span class="lineno"> 5792</span>&#160; </div>
+<div class="line"><a name="l05793"></a><span class="lineno"> 5793</span>&#160;        <span class="keyword">const</span> VmaRawList&lt;T&gt;* m_pList;</div>
+<div class="line"><a name="l05794"></a><span class="lineno"> 5794</span>&#160;        <span class="keyword">const</span> VmaListItem&lt;T&gt;* m_pItem;</div>
 <div class="line"><a name="l05795"></a><span class="lineno"> 5795</span>&#160; </div>
-<div class="line"><a name="l05797"></a><span class="lineno"> 5797</span>&#160;<span class="comment">// class VmaMap</span></div>
+<div class="line"><a name="l05796"></a><span class="lineno"> 5796</span>&#160;        <span class="keyword">friend</span> <span class="keyword">class </span>VmaList&lt;T, AllocatorT&gt;;</div>
+<div class="line"><a name="l05797"></a><span class="lineno"> 5797</span>&#160;    };</div>
 <div class="line"><a name="l05798"></a><span class="lineno"> 5798</span>&#160; </div>
-<div class="line"><a name="l05799"></a><span class="lineno"> 5799</span>&#160;<span class="comment">// Unused in this version.</span></div>
-<div class="line"><a name="l05800"></a><span class="lineno"> 5800</span>&#160;<span class="preprocessor">#if 0</span></div>
-<div class="line"><a name="l05801"></a><span class="lineno"> 5801</span>&#160; </div>
-<div class="line"><a name="l05802"></a><span class="lineno"> 5802</span>&#160;<span class="preprocessor">#if VMA_USE_STL_UNORDERED_MAP</span></div>
+<div class="line"><a name="l05799"></a><span class="lineno"> 5799</span>&#160;    VmaList(<span class="keyword">const</span> AllocatorT&amp; allocator) : m_RawList(allocator.m_pCallbacks) { }</div>
+<div class="line"><a name="l05800"></a><span class="lineno"> 5800</span>&#160; </div>
+<div class="line"><a name="l05801"></a><span class="lineno"> 5801</span>&#160;    <span class="keywordtype">bool</span> empty()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_RawList.IsEmpty(); }</div>
+<div class="line"><a name="l05802"></a><span class="lineno"> 5802</span>&#160;    <span class="keywordtype">size_t</span> size()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_RawList.GetCount(); }</div>
 <div class="line"><a name="l05803"></a><span class="lineno"> 5803</span>&#160; </div>
-<div class="line"><a name="l05804"></a><span class="lineno"> 5804</span>&#160;<span class="preprocessor">#define VmaPair std::pair</span></div>
-<div class="line"><a name="l05805"></a><span class="lineno"> 5805</span>&#160; </div>
-<div class="line"><a name="l05806"></a><span class="lineno"> 5806</span>&#160;<span class="preprocessor">#define VMA_MAP_TYPE(KeyT, ValueT) \</span></div>
-<div class="line"><a name="l05807"></a><span class="lineno"> 5807</span>&#160;<span class="preprocessor">    std::unordered_map&lt; KeyT, ValueT, std::hash&lt;KeyT&gt;, std::equal_to&lt;KeyT&gt;, VmaStlAllocator&lt; std::pair&lt;KeyT, ValueT&gt; &gt; &gt;</span></div>
-<div class="line"><a name="l05808"></a><span class="lineno"> 5808</span>&#160; </div>
-<div class="line"><a name="l05809"></a><span class="lineno"> 5809</span>&#160;<span class="preprocessor">#else // #if VMA_USE_STL_UNORDERED_MAP</span></div>
-<div class="line"><a name="l05810"></a><span class="lineno"> 5810</span>&#160; </div>
-<div class="line"><a name="l05811"></a><span class="lineno"> 5811</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T1, <span class="keyword">typename</span> T2&gt;</div>
-<div class="line"><a name="l05812"></a><span class="lineno"> 5812</span>&#160;<span class="keyword">struct </span>VmaPair</div>
-<div class="line"><a name="l05813"></a><span class="lineno"> 5813</span>&#160;{</div>
-<div class="line"><a name="l05814"></a><span class="lineno"> 5814</span>&#160;    T1 first;</div>
-<div class="line"><a name="l05815"></a><span class="lineno"> 5815</span>&#160;    T2 second;</div>
-<div class="line"><a name="l05816"></a><span class="lineno"> 5816</span>&#160; </div>
-<div class="line"><a name="l05817"></a><span class="lineno"> 5817</span>&#160;    VmaPair() : first(), second() { }</div>
-<div class="line"><a name="l05818"></a><span class="lineno"> 5818</span>&#160;    VmaPair(<span class="keyword">const</span> T1&amp; firstSrc, <span class="keyword">const</span> T2&amp; secondSrc) : first(firstSrc), second(secondSrc) { }</div>
-<div class="line"><a name="l05819"></a><span class="lineno"> 5819</span>&#160;};</div>
+<div class="line"><a name="l05804"></a><span class="lineno"> 5804</span>&#160;    iterator begin() { <span class="keywordflow">return</span> iterator(&amp;m_RawList, m_RawList.Front()); }</div>
+<div class="line"><a name="l05805"></a><span class="lineno"> 5805</span>&#160;    iterator end() { <span class="keywordflow">return</span> iterator(&amp;m_RawList, VMA_NULL); }</div>
+<div class="line"><a name="l05806"></a><span class="lineno"> 5806</span>&#160; </div>
+<div class="line"><a name="l05807"></a><span class="lineno"> 5807</span>&#160;    const_iterator cbegin()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> const_iterator(&amp;m_RawList, m_RawList.Front()); }</div>
+<div class="line"><a name="l05808"></a><span class="lineno"> 5808</span>&#160;    const_iterator cend()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> const_iterator(&amp;m_RawList, VMA_NULL); }</div>
+<div class="line"><a name="l05809"></a><span class="lineno"> 5809</span>&#160; </div>
+<div class="line"><a name="l05810"></a><span class="lineno"> 5810</span>&#160;    <span class="keywordtype">void</span> clear() { m_RawList.Clear(); }</div>
+<div class="line"><a name="l05811"></a><span class="lineno"> 5811</span>&#160;    <span class="keywordtype">void</span> push_back(<span class="keyword">const</span> T&amp; value) { m_RawList.PushBack(value); }</div>
+<div class="line"><a name="l05812"></a><span class="lineno"> 5812</span>&#160;    <span class="keywordtype">void</span> erase(iterator it) { m_RawList.Remove(it.m_pItem); }</div>
+<div class="line"><a name="l05813"></a><span class="lineno"> 5813</span>&#160;    iterator insert(iterator it, <span class="keyword">const</span> T&amp; value) { <span class="keywordflow">return</span> iterator(&amp;m_RawList, m_RawList.InsertBefore(it.m_pItem, value)); }</div>
+<div class="line"><a name="l05814"></a><span class="lineno"> 5814</span>&#160; </div>
+<div class="line"><a name="l05815"></a><span class="lineno"> 5815</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l05816"></a><span class="lineno"> 5816</span>&#160;    VmaRawList&lt;T&gt; m_RawList;</div>
+<div class="line"><a name="l05817"></a><span class="lineno"> 5817</span>&#160;};</div>
+<div class="line"><a name="l05818"></a><span class="lineno"> 5818</span>&#160; </div>
+<div class="line"><a name="l05819"></a><span class="lineno"> 5819</span>&#160;<span class="preprocessor">#endif // #if VMA_USE_STL_LIST</span></div>
 <div class="line"><a name="l05820"></a><span class="lineno"> 5820</span>&#160; </div>
-<div class="line"><a name="l05821"></a><span class="lineno"> 5821</span>&#160;<span class="comment">/* Class compatible with subset of interface of std::unordered_map.</span></div>
-<div class="line"><a name="l05822"></a><span class="lineno"> 5822</span>&#160;<span class="comment">KeyT, ValueT must be POD because they will be stored in VmaVector.</span></div>
-<div class="line"><a name="l05823"></a><span class="lineno"> 5823</span>&#160;<span class="comment">*/</span></div>
-<div class="line"><a name="l05824"></a><span class="lineno"> 5824</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> KeyT, <span class="keyword">typename</span> ValueT&gt;</div>
-<div class="line"><a name="l05825"></a><span class="lineno"> 5825</span>&#160;<span class="keyword">class </span>VmaMap</div>
-<div class="line"><a name="l05826"></a><span class="lineno"> 5826</span>&#160;{</div>
-<div class="line"><a name="l05827"></a><span class="lineno"> 5827</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l05828"></a><span class="lineno"> 5828</span>&#160;    <span class="keyword">typedef</span> VmaPair&lt;KeyT, ValueT&gt; PairType;</div>
-<div class="line"><a name="l05829"></a><span class="lineno"> 5829</span>&#160;    <span class="keyword">typedef</span> PairType* iterator;</div>
+<div class="line"><a name="l05822"></a><span class="lineno"> 5822</span>&#160;<span class="comment">// class VmaMap</span></div>
+<div class="line"><a name="l05823"></a><span class="lineno"> 5823</span>&#160; </div>
+<div class="line"><a name="l05824"></a><span class="lineno"> 5824</span>&#160;<span class="comment">// Unused in this version.</span></div>
+<div class="line"><a name="l05825"></a><span class="lineno"> 5825</span>&#160;<span class="preprocessor">#if 0</span></div>
+<div class="line"><a name="l05826"></a><span class="lineno"> 5826</span>&#160; </div>
+<div class="line"><a name="l05827"></a><span class="lineno"> 5827</span>&#160;<span class="preprocessor">#if VMA_USE_STL_UNORDERED_MAP</span></div>
+<div class="line"><a name="l05828"></a><span class="lineno"> 5828</span>&#160; </div>
+<div class="line"><a name="l05829"></a><span class="lineno"> 5829</span>&#160;<span class="preprocessor">#define VmaPair std::pair</span></div>
 <div class="line"><a name="l05830"></a><span class="lineno"> 5830</span>&#160; </div>
-<div class="line"><a name="l05831"></a><span class="lineno"> 5831</span>&#160;    VmaMap(<span class="keyword">const</span> VmaStlAllocator&lt;PairType&gt;&amp; allocator) : m_Vector(allocator) { }</div>
-<div class="line"><a name="l05832"></a><span class="lineno"> 5832</span>&#160; </div>
-<div class="line"><a name="l05833"></a><span class="lineno"> 5833</span>&#160;    iterator begin() { <span class="keywordflow">return</span> m_Vector.begin(); }</div>
-<div class="line"><a name="l05834"></a><span class="lineno"> 5834</span>&#160;    iterator end() { <span class="keywordflow">return</span> m_Vector.end(); }</div>
+<div class="line"><a name="l05831"></a><span class="lineno"> 5831</span>&#160;<span class="preprocessor">#define VMA_MAP_TYPE(KeyT, ValueT) \</span></div>
+<div class="line"><a name="l05832"></a><span class="lineno"> 5832</span>&#160;<span class="preprocessor">    std::unordered_map&lt; KeyT, ValueT, std::hash&lt;KeyT&gt;, std::equal_to&lt;KeyT&gt;, VmaStlAllocator&lt; std::pair&lt;KeyT, ValueT&gt; &gt; &gt;</span></div>
+<div class="line"><a name="l05833"></a><span class="lineno"> 5833</span>&#160; </div>
+<div class="line"><a name="l05834"></a><span class="lineno"> 5834</span>&#160;<span class="preprocessor">#else // #if VMA_USE_STL_UNORDERED_MAP</span></div>
 <div class="line"><a name="l05835"></a><span class="lineno"> 5835</span>&#160; </div>
-<div class="line"><a name="l05836"></a><span class="lineno"> 5836</span>&#160;    <span class="keywordtype">void</span> insert(<span class="keyword">const</span> PairType&amp; pair);</div>
-<div class="line"><a name="l05837"></a><span class="lineno"> 5837</span>&#160;    iterator find(<span class="keyword">const</span> KeyT&amp; key);</div>
-<div class="line"><a name="l05838"></a><span class="lineno"> 5838</span>&#160;    <span class="keywordtype">void</span> erase(iterator it);</div>
-<div class="line"><a name="l05839"></a><span class="lineno"> 5839</span>&#160;    </div>
-<div class="line"><a name="l05840"></a><span class="lineno"> 5840</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l05841"></a><span class="lineno"> 5841</span>&#160;    VmaVector&lt; PairType, VmaStlAllocator&lt;PairType&gt; &gt; m_Vector;</div>
-<div class="line"><a name="l05842"></a><span class="lineno"> 5842</span>&#160;};</div>
-<div class="line"><a name="l05843"></a><span class="lineno"> 5843</span>&#160; </div>
-<div class="line"><a name="l05844"></a><span class="lineno"> 5844</span>&#160;<span class="preprocessor">#define VMA_MAP_TYPE(KeyT, ValueT) VmaMap&lt;KeyT, ValueT&gt;</span></div>
+<div class="line"><a name="l05836"></a><span class="lineno"> 5836</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T1, <span class="keyword">typename</span> T2&gt;</div>
+<div class="line"><a name="l05837"></a><span class="lineno"> 5837</span>&#160;<span class="keyword">struct </span>VmaPair</div>
+<div class="line"><a name="l05838"></a><span class="lineno"> 5838</span>&#160;{</div>
+<div class="line"><a name="l05839"></a><span class="lineno"> 5839</span>&#160;    T1 first;</div>
+<div class="line"><a name="l05840"></a><span class="lineno"> 5840</span>&#160;    T2 second;</div>
+<div class="line"><a name="l05841"></a><span class="lineno"> 5841</span>&#160; </div>
+<div class="line"><a name="l05842"></a><span class="lineno"> 5842</span>&#160;    VmaPair() : first(), second() { }</div>
+<div class="line"><a name="l05843"></a><span class="lineno"> 5843</span>&#160;    VmaPair(<span class="keyword">const</span> T1&amp; firstSrc, <span class="keyword">const</span> T2&amp; secondSrc) : first(firstSrc), second(secondSrc) { }</div>
+<div class="line"><a name="l05844"></a><span class="lineno"> 5844</span>&#160;};</div>
 <div class="line"><a name="l05845"></a><span class="lineno"> 5845</span>&#160; </div>
-<div class="line"><a name="l05846"></a><span class="lineno"> 5846</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> FirstT, <span class="keyword">typename</span> SecondT&gt;</div>
-<div class="line"><a name="l05847"></a><span class="lineno"> 5847</span>&#160;<span class="keyword">struct </span>VmaPairFirstLess</div>
-<div class="line"><a name="l05848"></a><span class="lineno"> 5848</span>&#160;{</div>
-<div class="line"><a name="l05849"></a><span class="lineno"> 5849</span>&#160;    <span class="keywordtype">bool</span> operator()(<span class="keyword">const</span> VmaPair&lt;FirstT, SecondT&gt;&amp; lhs, <span class="keyword">const</span> VmaPair&lt;FirstT, SecondT&gt;&amp; rhs)<span class="keyword"> const</span></div>
-<div class="line"><a name="l05850"></a><span class="lineno"> 5850</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l05851"></a><span class="lineno"> 5851</span>&#160;        <span class="keywordflow">return</span> lhs.first &lt; rhs.first;</div>
-<div class="line"><a name="l05852"></a><span class="lineno"> 5852</span>&#160;    }</div>
-<div class="line"><a name="l05853"></a><span class="lineno"> 5853</span>&#160;    <span class="keywordtype">bool</span> operator()(<span class="keyword">const</span> VmaPair&lt;FirstT, SecondT&gt;&amp; lhs, <span class="keyword">const</span> FirstT&amp; rhsFirst)<span class="keyword"> const</span></div>
-<div class="line"><a name="l05854"></a><span class="lineno"> 5854</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l05855"></a><span class="lineno"> 5855</span>&#160;        <span class="keywordflow">return</span> lhs.first &lt; rhsFirst;</div>
-<div class="line"><a name="l05856"></a><span class="lineno"> 5856</span>&#160;    }</div>
-<div class="line"><a name="l05857"></a><span class="lineno"> 5857</span>&#160;};</div>
-<div class="line"><a name="l05858"></a><span class="lineno"> 5858</span>&#160; </div>
-<div class="line"><a name="l05859"></a><span class="lineno"> 5859</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> KeyT, <span class="keyword">typename</span> ValueT&gt;</div>
-<div class="line"><a name="l05860"></a><span class="lineno"> 5860</span>&#160;<span class="keywordtype">void</span> VmaMap&lt;KeyT, ValueT&gt;::insert(<span class="keyword">const</span> PairType&amp; pair)</div>
-<div class="line"><a name="l05861"></a><span class="lineno"> 5861</span>&#160;{</div>
-<div class="line"><a name="l05862"></a><span class="lineno"> 5862</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">size_t</span> indexToInsert = VmaBinaryFindFirstNotLess(</div>
-<div class="line"><a name="l05863"></a><span class="lineno"> 5863</span>&#160;        m_Vector.data(),</div>
-<div class="line"><a name="l05864"></a><span class="lineno"> 5864</span>&#160;        m_Vector.data() + m_Vector.size(),</div>
-<div class="line"><a name="l05865"></a><span class="lineno"> 5865</span>&#160;        pair,</div>
-<div class="line"><a name="l05866"></a><span class="lineno"> 5866</span>&#160;        VmaPairFirstLess&lt;KeyT, ValueT&gt;()) - m_Vector.data();</div>
-<div class="line"><a name="l05867"></a><span class="lineno"> 5867</span>&#160;    VmaVectorInsert(m_Vector, indexToInsert, pair);</div>
-<div class="line"><a name="l05868"></a><span class="lineno"> 5868</span>&#160;}</div>
-<div class="line"><a name="l05869"></a><span class="lineno"> 5869</span>&#160; </div>
-<div class="line"><a name="l05870"></a><span class="lineno"> 5870</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> KeyT, <span class="keyword">typename</span> ValueT&gt;</div>
-<div class="line"><a name="l05871"></a><span class="lineno"> 5871</span>&#160;VmaPair&lt;KeyT, ValueT&gt;* VmaMap&lt;KeyT, ValueT&gt;::find(<span class="keyword">const</span> KeyT&amp; key)</div>
-<div class="line"><a name="l05872"></a><span class="lineno"> 5872</span>&#160;{</div>
-<div class="line"><a name="l05873"></a><span class="lineno"> 5873</span>&#160;    PairType* it = VmaBinaryFindFirstNotLess(</div>
-<div class="line"><a name="l05874"></a><span class="lineno"> 5874</span>&#160;        m_Vector.data(),</div>
-<div class="line"><a name="l05875"></a><span class="lineno"> 5875</span>&#160;        m_Vector.data() + m_Vector.size(),</div>
-<div class="line"><a name="l05876"></a><span class="lineno"> 5876</span>&#160;        key,</div>
-<div class="line"><a name="l05877"></a><span class="lineno"> 5877</span>&#160;        VmaPairFirstLess&lt;KeyT, ValueT&gt;());</div>
-<div class="line"><a name="l05878"></a><span class="lineno"> 5878</span>&#160;    <span class="keywordflow">if</span>((it != m_Vector.end()) &amp;&amp; (it-&gt;first == key))</div>
-<div class="line"><a name="l05879"></a><span class="lineno"> 5879</span>&#160;    {</div>
-<div class="line"><a name="l05880"></a><span class="lineno"> 5880</span>&#160;        <span class="keywordflow">return</span> it;</div>
+<div class="line"><a name="l05846"></a><span class="lineno"> 5846</span>&#160;<span class="comment">/* Class compatible with subset of interface of std::unordered_map.</span></div>
+<div class="line"><a name="l05847"></a><span class="lineno"> 5847</span>&#160;<span class="comment">KeyT, ValueT must be POD because they will be stored in VmaVector.</span></div>
+<div class="line"><a name="l05848"></a><span class="lineno"> 5848</span>&#160;<span class="comment">*/</span></div>
+<div class="line"><a name="l05849"></a><span class="lineno"> 5849</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> KeyT, <span class="keyword">typename</span> ValueT&gt;</div>
+<div class="line"><a name="l05850"></a><span class="lineno"> 5850</span>&#160;<span class="keyword">class </span>VmaMap</div>
+<div class="line"><a name="l05851"></a><span class="lineno"> 5851</span>&#160;{</div>
+<div class="line"><a name="l05852"></a><span class="lineno"> 5852</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l05853"></a><span class="lineno"> 5853</span>&#160;    <span class="keyword">typedef</span> VmaPair&lt;KeyT, ValueT&gt; PairType;</div>
+<div class="line"><a name="l05854"></a><span class="lineno"> 5854</span>&#160;    <span class="keyword">typedef</span> PairType* iterator;</div>
+<div class="line"><a name="l05855"></a><span class="lineno"> 5855</span>&#160; </div>
+<div class="line"><a name="l05856"></a><span class="lineno"> 5856</span>&#160;    VmaMap(<span class="keyword">const</span> VmaStlAllocator&lt;PairType&gt;&amp; allocator) : m_Vector(allocator) { }</div>
+<div class="line"><a name="l05857"></a><span class="lineno"> 5857</span>&#160; </div>
+<div class="line"><a name="l05858"></a><span class="lineno"> 5858</span>&#160;    iterator begin() { <span class="keywordflow">return</span> m_Vector.begin(); }</div>
+<div class="line"><a name="l05859"></a><span class="lineno"> 5859</span>&#160;    iterator end() { <span class="keywordflow">return</span> m_Vector.end(); }</div>
+<div class="line"><a name="l05860"></a><span class="lineno"> 5860</span>&#160; </div>
+<div class="line"><a name="l05861"></a><span class="lineno"> 5861</span>&#160;    <span class="keywordtype">void</span> insert(<span class="keyword">const</span> PairType&amp; pair);</div>
+<div class="line"><a name="l05862"></a><span class="lineno"> 5862</span>&#160;    iterator find(<span class="keyword">const</span> KeyT&amp; key);</div>
+<div class="line"><a name="l05863"></a><span class="lineno"> 5863</span>&#160;    <span class="keywordtype">void</span> erase(iterator it);</div>
+<div class="line"><a name="l05864"></a><span class="lineno"> 5864</span>&#160;    </div>
+<div class="line"><a name="l05865"></a><span class="lineno"> 5865</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l05866"></a><span class="lineno"> 5866</span>&#160;    VmaVector&lt; PairType, VmaStlAllocator&lt;PairType&gt; &gt; m_Vector;</div>
+<div class="line"><a name="l05867"></a><span class="lineno"> 5867</span>&#160;};</div>
+<div class="line"><a name="l05868"></a><span class="lineno"> 5868</span>&#160; </div>
+<div class="line"><a name="l05869"></a><span class="lineno"> 5869</span>&#160;<span class="preprocessor">#define VMA_MAP_TYPE(KeyT, ValueT) VmaMap&lt;KeyT, ValueT&gt;</span></div>
+<div class="line"><a name="l05870"></a><span class="lineno"> 5870</span>&#160; </div>
+<div class="line"><a name="l05871"></a><span class="lineno"> 5871</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> FirstT, <span class="keyword">typename</span> SecondT&gt;</div>
+<div class="line"><a name="l05872"></a><span class="lineno"> 5872</span>&#160;<span class="keyword">struct </span>VmaPairFirstLess</div>
+<div class="line"><a name="l05873"></a><span class="lineno"> 5873</span>&#160;{</div>
+<div class="line"><a name="l05874"></a><span class="lineno"> 5874</span>&#160;    <span class="keywordtype">bool</span> operator()(<span class="keyword">const</span> VmaPair&lt;FirstT, SecondT&gt;&amp; lhs, <span class="keyword">const</span> VmaPair&lt;FirstT, SecondT&gt;&amp; rhs)<span class="keyword"> const</span></div>
+<div class="line"><a name="l05875"></a><span class="lineno"> 5875</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l05876"></a><span class="lineno"> 5876</span>&#160;        <span class="keywordflow">return</span> lhs.first &lt; rhs.first;</div>
+<div class="line"><a name="l05877"></a><span class="lineno"> 5877</span>&#160;    }</div>
+<div class="line"><a name="l05878"></a><span class="lineno"> 5878</span>&#160;    <span class="keywordtype">bool</span> operator()(<span class="keyword">const</span> VmaPair&lt;FirstT, SecondT&gt;&amp; lhs, <span class="keyword">const</span> FirstT&amp; rhsFirst)<span class="keyword"> const</span></div>
+<div class="line"><a name="l05879"></a><span class="lineno"> 5879</span>&#160;<span class="keyword">    </span>{</div>
+<div class="line"><a name="l05880"></a><span class="lineno"> 5880</span>&#160;        <span class="keywordflow">return</span> lhs.first &lt; rhsFirst;</div>
 <div class="line"><a name="l05881"></a><span class="lineno"> 5881</span>&#160;    }</div>
-<div class="line"><a name="l05882"></a><span class="lineno"> 5882</span>&#160;    <span class="keywordflow">else</span></div>
-<div class="line"><a name="l05883"></a><span class="lineno"> 5883</span>&#160;    {</div>
-<div class="line"><a name="l05884"></a><span class="lineno"> 5884</span>&#160;        <span class="keywordflow">return</span> m_Vector.end();</div>
-<div class="line"><a name="l05885"></a><span class="lineno"> 5885</span>&#160;    }</div>
-<div class="line"><a name="l05886"></a><span class="lineno"> 5886</span>&#160;}</div>
-<div class="line"><a name="l05887"></a><span class="lineno"> 5887</span>&#160; </div>
-<div class="line"><a name="l05888"></a><span class="lineno"> 5888</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> KeyT, <span class="keyword">typename</span> ValueT&gt;</div>
-<div class="line"><a name="l05889"></a><span class="lineno"> 5889</span>&#160;<span class="keywordtype">void</span> VmaMap&lt;KeyT, ValueT&gt;::erase(iterator it)</div>
-<div class="line"><a name="l05890"></a><span class="lineno"> 5890</span>&#160;{</div>
-<div class="line"><a name="l05891"></a><span class="lineno"> 5891</span>&#160;    VmaVectorRemove(m_Vector, it - m_Vector.begin());</div>
-<div class="line"><a name="l05892"></a><span class="lineno"> 5892</span>&#160;}</div>
-<div class="line"><a name="l05893"></a><span class="lineno"> 5893</span>&#160; </div>
-<div class="line"><a name="l05894"></a><span class="lineno"> 5894</span>&#160;<span class="preprocessor">#endif // #if VMA_USE_STL_UNORDERED_MAP</span></div>
-<div class="line"><a name="l05895"></a><span class="lineno"> 5895</span>&#160; </div>
-<div class="line"><a name="l05896"></a><span class="lineno"> 5896</span>&#160;<span class="preprocessor">#endif // #if 0</span></div>
-<div class="line"><a name="l05897"></a><span class="lineno"> 5897</span>&#160; </div>
-<div class="line"><a name="l05899"></a><span class="lineno"> 5899</span>&#160; </div>
-<div class="line"><a name="l05900"></a><span class="lineno"> 5900</span>&#160;<span class="keyword">class </span>VmaDeviceMemoryBlock;</div>
-<div class="line"><a name="l05901"></a><span class="lineno"> 5901</span>&#160; </div>
-<div class="line"><a name="l05902"></a><span class="lineno"> 5902</span>&#160;<span class="keyword">enum</span> VMA_CACHE_OPERATION { VMA_CACHE_FLUSH, VMA_CACHE_INVALIDATE };</div>
-<div class="line"><a name="l05903"></a><span class="lineno"> 5903</span>&#160; </div>
-<div class="line"><a name="l05904"></a><span class="lineno"> 5904</span>&#160;<span class="keyword">struct </span>VmaAllocation_T</div>
-<div class="line"><a name="l05905"></a><span class="lineno"> 5905</span>&#160;{</div>
-<div class="line"><a name="l05906"></a><span class="lineno"> 5906</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l05907"></a><span class="lineno"> 5907</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> uint8_t MAP_COUNT_FLAG_PERSISTENT_MAP = 0x80;</div>
-<div class="line"><a name="l05908"></a><span class="lineno"> 5908</span>&#160; </div>
-<div class="line"><a name="l05909"></a><span class="lineno"> 5909</span>&#160;    <span class="keyword">enum</span> FLAGS</div>
-<div class="line"><a name="l05910"></a><span class="lineno"> 5910</span>&#160;    {</div>
-<div class="line"><a name="l05911"></a><span class="lineno"> 5911</span>&#160;        FLAG_USER_DATA_STRING = 0x01,</div>
-<div class="line"><a name="l05912"></a><span class="lineno"> 5912</span>&#160;    };</div>
-<div class="line"><a name="l05913"></a><span class="lineno"> 5913</span>&#160; </div>
-<div class="line"><a name="l05914"></a><span class="lineno"> 5914</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l05915"></a><span class="lineno"> 5915</span>&#160;    <span class="keyword">enum</span> ALLOCATION_TYPE</div>
-<div class="line"><a name="l05916"></a><span class="lineno"> 5916</span>&#160;    {</div>
-<div class="line"><a name="l05917"></a><span class="lineno"> 5917</span>&#160;        ALLOCATION_TYPE_NONE,</div>
-<div class="line"><a name="l05918"></a><span class="lineno"> 5918</span>&#160;        ALLOCATION_TYPE_BLOCK,</div>
-<div class="line"><a name="l05919"></a><span class="lineno"> 5919</span>&#160;        ALLOCATION_TYPE_DEDICATED,</div>
-<div class="line"><a name="l05920"></a><span class="lineno"> 5920</span>&#160;    };</div>
-<div class="line"><a name="l05921"></a><span class="lineno"> 5921</span>&#160; </div>
-<div class="line"><a name="l05922"></a><span class="lineno"> 5922</span>&#160;    <span class="comment">/*</span></div>
-<div class="line"><a name="l05923"></a><span class="lineno"> 5923</span>&#160;<span class="comment">    This struct is allocated using VmaPoolAllocator.</span></div>
-<div class="line"><a name="l05924"></a><span class="lineno"> 5924</span>&#160;<span class="comment">    */</span></div>
-<div class="line"><a name="l05925"></a><span class="lineno"> 5925</span>&#160; </div>
-<div class="line"><a name="l05926"></a><span class="lineno"> 5926</span>&#160;    VmaAllocation_T(uint32_t currentFrameIndex, <span class="keywordtype">bool</span> userDataString) :</div>
-<div class="line"><a name="l05927"></a><span class="lineno"> 5927</span>&#160;        m_Alignment{1},</div>
-<div class="line"><a name="l05928"></a><span class="lineno"> 5928</span>&#160;        m_Size{0},</div>
-<div class="line"><a name="l05929"></a><span class="lineno"> 5929</span>&#160;        m_pUserData{VMA_NULL},</div>
-<div class="line"><a name="l05930"></a><span class="lineno"> 5930</span>&#160;        m_LastUseFrameIndex{currentFrameIndex},</div>
-<div class="line"><a name="l05931"></a><span class="lineno"> 5931</span>&#160;        m_MemoryTypeIndex{0},</div>
-<div class="line"><a name="l05932"></a><span class="lineno"> 5932</span>&#160;        m_Type{(uint8_t)ALLOCATION_TYPE_NONE},</div>
-<div class="line"><a name="l05933"></a><span class="lineno"> 5933</span>&#160;        m_SuballocationType{(uint8_t)VMA_SUBALLOCATION_TYPE_UNKNOWN},</div>
-<div class="line"><a name="l05934"></a><span class="lineno"> 5934</span>&#160;        m_MapCount{0},</div>
-<div class="line"><a name="l05935"></a><span class="lineno"> 5935</span>&#160;        m_Flags{userDataString ? (uint8_t)FLAG_USER_DATA_STRING : (uint8_t)0}</div>
-<div class="line"><a name="l05936"></a><span class="lineno"> 5936</span>&#160;    {</div>
-<div class="line"><a name="l05937"></a><span class="lineno"> 5937</span>&#160;<span class="preprocessor">#if VMA_STATS_STRING_ENABLED</span></div>
-<div class="line"><a name="l05938"></a><span class="lineno"> 5938</span>&#160;        m_CreationFrameIndex = currentFrameIndex;</div>
-<div class="line"><a name="l05939"></a><span class="lineno"> 5939</span>&#160;        m_BufferImageUsage = 0;</div>
-<div class="line"><a name="l05940"></a><span class="lineno"> 5940</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l05941"></a><span class="lineno"> 5941</span>&#160;    }</div>
-<div class="line"><a name="l05942"></a><span class="lineno"> 5942</span>&#160; </div>
-<div class="line"><a name="l05943"></a><span class="lineno"> 5943</span>&#160;    ~VmaAllocation_T()</div>
-<div class="line"><a name="l05944"></a><span class="lineno"> 5944</span>&#160;    {</div>
-<div class="line"><a name="l05945"></a><span class="lineno"> 5945</span>&#160;        VMA_ASSERT((m_MapCount &amp; ~MAP_COUNT_FLAG_PERSISTENT_MAP) == 0 &amp;&amp; <span class="stringliteral">&quot;Allocation was not unmapped before destruction.&quot;</span>);</div>
+<div class="line"><a name="l05882"></a><span class="lineno"> 5882</span>&#160;};</div>
+<div class="line"><a name="l05883"></a><span class="lineno"> 5883</span>&#160; </div>
+<div class="line"><a name="l05884"></a><span class="lineno"> 5884</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> KeyT, <span class="keyword">typename</span> ValueT&gt;</div>
+<div class="line"><a name="l05885"></a><span class="lineno"> 5885</span>&#160;<span class="keywordtype">void</span> VmaMap&lt;KeyT, ValueT&gt;::insert(<span class="keyword">const</span> PairType&amp; pair)</div>
+<div class="line"><a name="l05886"></a><span class="lineno"> 5886</span>&#160;{</div>
+<div class="line"><a name="l05887"></a><span class="lineno"> 5887</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">size_t</span> indexToInsert = VmaBinaryFindFirstNotLess(</div>
+<div class="line"><a name="l05888"></a><span class="lineno"> 5888</span>&#160;        m_Vector.data(),</div>
+<div class="line"><a name="l05889"></a><span class="lineno"> 5889</span>&#160;        m_Vector.data() + m_Vector.size(),</div>
+<div class="line"><a name="l05890"></a><span class="lineno"> 5890</span>&#160;        pair,</div>
+<div class="line"><a name="l05891"></a><span class="lineno"> 5891</span>&#160;        VmaPairFirstLess&lt;KeyT, ValueT&gt;()) - m_Vector.data();</div>
+<div class="line"><a name="l05892"></a><span class="lineno"> 5892</span>&#160;    VmaVectorInsert(m_Vector, indexToInsert, pair);</div>
+<div class="line"><a name="l05893"></a><span class="lineno"> 5893</span>&#160;}</div>
+<div class="line"><a name="l05894"></a><span class="lineno"> 5894</span>&#160; </div>
+<div class="line"><a name="l05895"></a><span class="lineno"> 5895</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> KeyT, <span class="keyword">typename</span> ValueT&gt;</div>
+<div class="line"><a name="l05896"></a><span class="lineno"> 5896</span>&#160;VmaPair&lt;KeyT, ValueT&gt;* VmaMap&lt;KeyT, ValueT&gt;::find(<span class="keyword">const</span> KeyT&amp; key)</div>
+<div class="line"><a name="l05897"></a><span class="lineno"> 5897</span>&#160;{</div>
+<div class="line"><a name="l05898"></a><span class="lineno"> 5898</span>&#160;    PairType* it = VmaBinaryFindFirstNotLess(</div>
+<div class="line"><a name="l05899"></a><span class="lineno"> 5899</span>&#160;        m_Vector.data(),</div>
+<div class="line"><a name="l05900"></a><span class="lineno"> 5900</span>&#160;        m_Vector.data() + m_Vector.size(),</div>
+<div class="line"><a name="l05901"></a><span class="lineno"> 5901</span>&#160;        key,</div>
+<div class="line"><a name="l05902"></a><span class="lineno"> 5902</span>&#160;        VmaPairFirstLess&lt;KeyT, ValueT&gt;());</div>
+<div class="line"><a name="l05903"></a><span class="lineno"> 5903</span>&#160;    <span class="keywordflow">if</span>((it != m_Vector.end()) &amp;&amp; (it-&gt;first == key))</div>
+<div class="line"><a name="l05904"></a><span class="lineno"> 5904</span>&#160;    {</div>
+<div class="line"><a name="l05905"></a><span class="lineno"> 5905</span>&#160;        <span class="keywordflow">return</span> it;</div>
+<div class="line"><a name="l05906"></a><span class="lineno"> 5906</span>&#160;    }</div>
+<div class="line"><a name="l05907"></a><span class="lineno"> 5907</span>&#160;    <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05908"></a><span class="lineno"> 5908</span>&#160;    {</div>
+<div class="line"><a name="l05909"></a><span class="lineno"> 5909</span>&#160;        <span class="keywordflow">return</span> m_Vector.end();</div>
+<div class="line"><a name="l05910"></a><span class="lineno"> 5910</span>&#160;    }</div>
+<div class="line"><a name="l05911"></a><span class="lineno"> 5911</span>&#160;}</div>
+<div class="line"><a name="l05912"></a><span class="lineno"> 5912</span>&#160; </div>
+<div class="line"><a name="l05913"></a><span class="lineno"> 5913</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> KeyT, <span class="keyword">typename</span> ValueT&gt;</div>
+<div class="line"><a name="l05914"></a><span class="lineno"> 5914</span>&#160;<span class="keywordtype">void</span> VmaMap&lt;KeyT, ValueT&gt;::erase(iterator it)</div>
+<div class="line"><a name="l05915"></a><span class="lineno"> 5915</span>&#160;{</div>
+<div class="line"><a name="l05916"></a><span class="lineno"> 5916</span>&#160;    VmaVectorRemove(m_Vector, it - m_Vector.begin());</div>
+<div class="line"><a name="l05917"></a><span class="lineno"> 5917</span>&#160;}</div>
+<div class="line"><a name="l05918"></a><span class="lineno"> 5918</span>&#160; </div>
+<div class="line"><a name="l05919"></a><span class="lineno"> 5919</span>&#160;<span class="preprocessor">#endif // #if VMA_USE_STL_UNORDERED_MAP</span></div>
+<div class="line"><a name="l05920"></a><span class="lineno"> 5920</span>&#160; </div>
+<div class="line"><a name="l05921"></a><span class="lineno"> 5921</span>&#160;<span class="preprocessor">#endif // #if 0</span></div>
+<div class="line"><a name="l05922"></a><span class="lineno"> 5922</span>&#160; </div>
+<div class="line"><a name="l05924"></a><span class="lineno"> 5924</span>&#160; </div>
+<div class="line"><a name="l05925"></a><span class="lineno"> 5925</span>&#160;<span class="keyword">class </span>VmaDeviceMemoryBlock;</div>
+<div class="line"><a name="l05926"></a><span class="lineno"> 5926</span>&#160; </div>
+<div class="line"><a name="l05927"></a><span class="lineno"> 5927</span>&#160;<span class="keyword">enum</span> VMA_CACHE_OPERATION { VMA_CACHE_FLUSH, VMA_CACHE_INVALIDATE };</div>
+<div class="line"><a name="l05928"></a><span class="lineno"> 5928</span>&#160; </div>
+<div class="line"><a name="l05929"></a><span class="lineno"> 5929</span>&#160;<span class="keyword">struct </span>VmaAllocation_T</div>
+<div class="line"><a name="l05930"></a><span class="lineno"> 5930</span>&#160;{</div>
+<div class="line"><a name="l05931"></a><span class="lineno"> 5931</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l05932"></a><span class="lineno"> 5932</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> uint8_t MAP_COUNT_FLAG_PERSISTENT_MAP = 0x80;</div>
+<div class="line"><a name="l05933"></a><span class="lineno"> 5933</span>&#160; </div>
+<div class="line"><a name="l05934"></a><span class="lineno"> 5934</span>&#160;    <span class="keyword">enum</span> FLAGS</div>
+<div class="line"><a name="l05935"></a><span class="lineno"> 5935</span>&#160;    {</div>
+<div class="line"><a name="l05936"></a><span class="lineno"> 5936</span>&#160;        FLAG_USER_DATA_STRING = 0x01,</div>
+<div class="line"><a name="l05937"></a><span class="lineno"> 5937</span>&#160;    };</div>
+<div class="line"><a name="l05938"></a><span class="lineno"> 5938</span>&#160; </div>
+<div class="line"><a name="l05939"></a><span class="lineno"> 5939</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l05940"></a><span class="lineno"> 5940</span>&#160;    <span class="keyword">enum</span> ALLOCATION_TYPE</div>
+<div class="line"><a name="l05941"></a><span class="lineno"> 5941</span>&#160;    {</div>
+<div class="line"><a name="l05942"></a><span class="lineno"> 5942</span>&#160;        ALLOCATION_TYPE_NONE,</div>
+<div class="line"><a name="l05943"></a><span class="lineno"> 5943</span>&#160;        ALLOCATION_TYPE_BLOCK,</div>
+<div class="line"><a name="l05944"></a><span class="lineno"> 5944</span>&#160;        ALLOCATION_TYPE_DEDICATED,</div>
+<div class="line"><a name="l05945"></a><span class="lineno"> 5945</span>&#160;    };</div>
 <div class="line"><a name="l05946"></a><span class="lineno"> 5946</span>&#160; </div>
-<div class="line"><a name="l05947"></a><span class="lineno"> 5947</span>&#160;        <span class="comment">// Check if owned string was freed.</span></div>
-<div class="line"><a name="l05948"></a><span class="lineno"> 5948</span>&#160;        VMA_ASSERT(m_pUserData == VMA_NULL);</div>
-<div class="line"><a name="l05949"></a><span class="lineno"> 5949</span>&#160;    }</div>
+<div class="line"><a name="l05947"></a><span class="lineno"> 5947</span>&#160;    <span class="comment">/*</span></div>
+<div class="line"><a name="l05948"></a><span class="lineno"> 5948</span>&#160;<span class="comment">    This struct is allocated using VmaPoolAllocator.</span></div>
+<div class="line"><a name="l05949"></a><span class="lineno"> 5949</span>&#160;<span class="comment">    */</span></div>
 <div class="line"><a name="l05950"></a><span class="lineno"> 5950</span>&#160; </div>
-<div class="line"><a name="l05951"></a><span class="lineno"> 5951</span>&#160;    <span class="keywordtype">void</span> InitBlockAllocation(</div>
-<div class="line"><a name="l05952"></a><span class="lineno"> 5952</span>&#160;        VmaDeviceMemoryBlock* block,</div>
-<div class="line"><a name="l05953"></a><span class="lineno"> 5953</span>&#160;        VkDeviceSize offset,</div>
-<div class="line"><a name="l05954"></a><span class="lineno"> 5954</span>&#160;        VkDeviceSize alignment,</div>
-<div class="line"><a name="l05955"></a><span class="lineno"> 5955</span>&#160;        VkDeviceSize size,</div>
-<div class="line"><a name="l05956"></a><span class="lineno"> 5956</span>&#160;        uint32_t memoryTypeIndex,</div>
-<div class="line"><a name="l05957"></a><span class="lineno"> 5957</span>&#160;        VmaSuballocationType suballocationType,</div>
-<div class="line"><a name="l05958"></a><span class="lineno"> 5958</span>&#160;        <span class="keywordtype">bool</span> mapped,</div>
-<div class="line"><a name="l05959"></a><span class="lineno"> 5959</span>&#160;        <span class="keywordtype">bool</span> canBecomeLost)</div>
-<div class="line"><a name="l05960"></a><span class="lineno"> 5960</span>&#160;    {</div>
-<div class="line"><a name="l05961"></a><span class="lineno"> 5961</span>&#160;        VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);</div>
-<div class="line"><a name="l05962"></a><span class="lineno"> 5962</span>&#160;        VMA_ASSERT(block != VMA_NULL);</div>
-<div class="line"><a name="l05963"></a><span class="lineno"> 5963</span>&#160;        m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;</div>
-<div class="line"><a name="l05964"></a><span class="lineno"> 5964</span>&#160;        m_Alignment = alignment;</div>
-<div class="line"><a name="l05965"></a><span class="lineno"> 5965</span>&#160;        m_Size = size;</div>
-<div class="line"><a name="l05966"></a><span class="lineno"> 5966</span>&#160;        m_MemoryTypeIndex = memoryTypeIndex;</div>
-<div class="line"><a name="l05967"></a><span class="lineno"> 5967</span>&#160;        m_MapCount = mapped ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;</div>
-<div class="line"><a name="l05968"></a><span class="lineno"> 5968</span>&#160;        m_SuballocationType = (uint8_t)suballocationType;</div>
-<div class="line"><a name="l05969"></a><span class="lineno"> 5969</span>&#160;        m_BlockAllocation.m_Block = block;</div>
-<div class="line"><a name="l05970"></a><span class="lineno"> 5970</span>&#160;        m_BlockAllocation.m_Offset = offset;</div>
-<div class="line"><a name="l05971"></a><span class="lineno"> 5971</span>&#160;        m_BlockAllocation.m_CanBecomeLost = canBecomeLost;</div>
-<div class="line"><a name="l05972"></a><span class="lineno"> 5972</span>&#160;    }</div>
-<div class="line"><a name="l05973"></a><span class="lineno"> 5973</span>&#160; </div>
-<div class="line"><a name="l05974"></a><span class="lineno"> 5974</span>&#160;    <span class="keywordtype">void</span> InitLost()</div>
-<div class="line"><a name="l05975"></a><span class="lineno"> 5975</span>&#160;    {</div>
-<div class="line"><a name="l05976"></a><span class="lineno"> 5976</span>&#160;        VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);</div>
-<div class="line"><a name="l05977"></a><span class="lineno"> 5977</span>&#160;        VMA_ASSERT(m_LastUseFrameIndex.load() == VMA_FRAME_INDEX_LOST);</div>
-<div class="line"><a name="l05978"></a><span class="lineno"> 5978</span>&#160;        m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;</div>
-<div class="line"><a name="l05979"></a><span class="lineno"> 5979</span>&#160;        m_MemoryTypeIndex = 0;</div>
-<div class="line"><a name="l05980"></a><span class="lineno"> 5980</span>&#160;        m_BlockAllocation.m_Block = VMA_NULL;</div>
-<div class="line"><a name="l05981"></a><span class="lineno"> 5981</span>&#160;        m_BlockAllocation.m_Offset = 0;</div>
-<div class="line"><a name="l05982"></a><span class="lineno"> 5982</span>&#160;        m_BlockAllocation.m_CanBecomeLost = <span class="keyword">true</span>;</div>
-<div class="line"><a name="l05983"></a><span class="lineno"> 5983</span>&#160;    }</div>
-<div class="line"><a name="l05984"></a><span class="lineno"> 5984</span>&#160; </div>
-<div class="line"><a name="l05985"></a><span class="lineno"> 5985</span>&#160;    <span class="keywordtype">void</span> ChangeBlockAllocation(</div>
-<div class="line"><a name="l05986"></a><span class="lineno"> 5986</span>&#160;        <a class="code" href="struct_vma_allocator.html">VmaAllocator</a> hAllocator,</div>
-<div class="line"><a name="l05987"></a><span class="lineno"> 5987</span>&#160;        VmaDeviceMemoryBlock* block,</div>
-<div class="line"><a name="l05988"></a><span class="lineno"> 5988</span>&#160;        VkDeviceSize offset); </div>
-<div class="line"><a name="l05989"></a><span class="lineno"> 5989</span>&#160; </div>
-<div class="line"><a name="l05990"></a><span class="lineno"> 5990</span>&#160;    <span class="keywordtype">void</span> ChangeOffset(VkDeviceSize newOffset);</div>
-<div class="line"><a name="l05991"></a><span class="lineno"> 5991</span>&#160; </div>
-<div class="line"><a name="l05992"></a><span class="lineno"> 5992</span>&#160;    <span class="comment">// pMappedData not null means allocation is created with MAPPED flag.</span></div>
-<div class="line"><a name="l05993"></a><span class="lineno"> 5993</span>&#160;    <span class="keywordtype">void</span> InitDedicatedAllocation(</div>
-<div class="line"><a name="l05994"></a><span class="lineno"> 5994</span>&#160;        uint32_t memoryTypeIndex,</div>
-<div class="line"><a name="l05995"></a><span class="lineno"> 5995</span>&#160;        VkDeviceMemory hMemory,</div>
-<div class="line"><a name="l05996"></a><span class="lineno"> 5996</span>&#160;        VmaSuballocationType suballocationType,</div>
-<div class="line"><a name="l05997"></a><span class="lineno"> 5997</span>&#160;        <span class="keywordtype">void</span>* pMappedData,</div>
-<div class="line"><a name="l05998"></a><span class="lineno"> 5998</span>&#160;        VkDeviceSize size)</div>
-<div class="line"><a name="l05999"></a><span class="lineno"> 5999</span>&#160;    {</div>
-<div class="line"><a name="l06000"></a><span class="lineno"> 6000</span>&#160;        VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);</div>
-<div class="line"><a name="l06001"></a><span class="lineno"> 6001</span>&#160;        VMA_ASSERT(hMemory != VK_NULL_HANDLE);</div>
-<div class="line"><a name="l06002"></a><span class="lineno"> 6002</span>&#160;        m_Type = (uint8_t)ALLOCATION_TYPE_DEDICATED;</div>
-<div class="line"><a name="l06003"></a><span class="lineno"> 6003</span>&#160;        m_Alignment = 0;</div>
-<div class="line"><a name="l06004"></a><span class="lineno"> 6004</span>&#160;        m_Size = size;</div>
-<div class="line"><a name="l06005"></a><span class="lineno"> 6005</span>&#160;        m_MemoryTypeIndex = memoryTypeIndex;</div>
-<div class="line"><a name="l06006"></a><span class="lineno"> 6006</span>&#160;        m_SuballocationType = (uint8_t)suballocationType;</div>
-<div class="line"><a name="l06007"></a><span class="lineno"> 6007</span>&#160;        m_MapCount = (pMappedData != VMA_NULL) ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;</div>
-<div class="line"><a name="l06008"></a><span class="lineno"> 6008</span>&#160;        m_DedicatedAllocation.m_hMemory = hMemory;</div>
-<div class="line"><a name="l06009"></a><span class="lineno"> 6009</span>&#160;        m_DedicatedAllocation.m_pMappedData = pMappedData;</div>
-<div class="line"><a name="l06010"></a><span class="lineno"> 6010</span>&#160;    }</div>
-<div class="line"><a name="l06011"></a><span class="lineno"> 6011</span>&#160; </div>
-<div class="line"><a name="l06012"></a><span class="lineno"> 6012</span>&#160;    ALLOCATION_TYPE GetType()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (ALLOCATION_TYPE)m_Type; }</div>
-<div class="line"><a name="l06013"></a><span class="lineno"> 6013</span>&#160;    VkDeviceSize GetAlignment()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Alignment; }</div>
-<div class="line"><a name="l06014"></a><span class="lineno"> 6014</span>&#160;    VkDeviceSize GetSize()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Size; }</div>
-<div class="line"><a name="l06015"></a><span class="lineno"> 6015</span>&#160;    <span class="keywordtype">bool</span> IsUserDataString()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (m_Flags &amp; FLAG_USER_DATA_STRING) != 0; }</div>
-<div class="line"><a name="l06016"></a><span class="lineno"> 6016</span>&#160;    <span class="keywordtype">void</span>* GetUserData()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_pUserData; }</div>
-<div class="line"><a name="l06017"></a><span class="lineno"> 6017</span>&#160;    <span class="keywordtype">void</span> SetUserData(<a class="code" href="struct_vma_allocator.html">VmaAllocator</a> hAllocator, <span class="keywordtype">void</span>* pUserData);</div>
-<div class="line"><a name="l06018"></a><span class="lineno"> 6018</span>&#160;    VmaSuballocationType GetSuballocationType()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (VmaSuballocationType)m_SuballocationType; }</div>
-<div class="line"><a name="l06019"></a><span class="lineno"> 6019</span>&#160; </div>
-<div class="line"><a name="l06020"></a><span class="lineno"> 6020</span>&#160;    VmaDeviceMemoryBlock* GetBlock()<span class="keyword"> const</span></div>
-<div class="line"><a name="l06021"></a><span class="lineno"> 6021</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l06022"></a><span class="lineno"> 6022</span>&#160;        VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);</div>
-<div class="line"><a name="l06023"></a><span class="lineno"> 6023</span>&#160;        <span class="keywordflow">return</span> m_BlockAllocation.m_Block;</div>
-<div class="line"><a name="l06024"></a><span class="lineno"> 6024</span>&#160;    }</div>
-<div class="line"><a name="l06025"></a><span class="lineno"> 6025</span>&#160;    VkDeviceSize GetOffset() <span class="keyword">const</span>;</div>
-<div class="line"><a name="l06026"></a><span class="lineno"> 6026</span>&#160;    VkDeviceMemory GetMemory() <span class="keyword">const</span>;</div>
-<div class="line"><a name="l06027"></a><span class="lineno"> 6027</span>&#160;    uint32_t GetMemoryTypeIndex()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_MemoryTypeIndex; }</div>
-<div class="line"><a name="l06028"></a><span class="lineno"> 6028</span>&#160;    <span class="keywordtype">bool</span> IsPersistentMap()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (m_MapCount &amp; MAP_COUNT_FLAG_PERSISTENT_MAP) != 0; }</div>
-<div class="line"><a name="l06029"></a><span class="lineno"> 6029</span>&#160;    <span class="keywordtype">void</span>* GetMappedData() <span class="keyword">const</span>;</div>
-<div class="line"><a name="l06030"></a><span class="lineno"> 6030</span>&#160;    <span class="keywordtype">bool</span> CanBecomeLost() <span class="keyword">const</span>;</div>
-<div class="line"><a name="l06031"></a><span class="lineno"> 6031</span>&#160;    </div>
-<div class="line"><a name="l06032"></a><span class="lineno"> 6032</span>&#160;    uint32_t GetLastUseFrameIndex()<span class="keyword"> const</span></div>
-<div class="line"><a name="l06033"></a><span class="lineno"> 6033</span>&#160;<span class="keyword">    </span>{</div>
-<div class="line"><a name="l06034"></a><span class="lineno"> 6034</span>&#160;        <span class="keywordflow">return</span> m_LastUseFrameIndex.load();</div>
+<div class="line"><a name="l05951"></a><span class="lineno"> 5951</span>&#160;    VmaAllocation_T(uint32_t currentFrameIndex, <span class="keywordtype">bool</span> userDataString) :</div>
+<div class="line"><a name="l05952"></a><span class="lineno"> 5952</span>&#160;        m_Alignment{1},</div>
+<div class="line"><a name="l05953"></a><span class="lineno"> 5953</span>&#160;        m_Size{0},</div>
+<div class="line"><a name="l05954"></a><span class="lineno"> 5954</span>&#160;        m_pUserData{VMA_NULL},</div>
+<div class="line"><a name="l05955"></a><span class="lineno"> 5955</span>&#160;        m_LastUseFrameIndex{currentFrameIndex},</div>
+<div class="line"><a name="l05956"></a><span class="lineno"> 5956</span>&#160;        m_MemoryTypeIndex{0},</div>
+<div class="line"><a name="l05957"></a><span class="lineno"> 5957</span>&#160;        m_Type{(uint8_t)ALLOCATION_TYPE_NONE},</div>
+<div class="line"><a name="l05958"></a><span class="lineno"> 5958</span>&#160;        m_SuballocationType{(uint8_t)VMA_SUBALLOCATION_TYPE_UNKNOWN},</div>
+<div class="line"><a name="l05959"></a><span class="lineno"> 5959</span>&#160;        m_MapCount{0},</div>
+<div class="line"><a name="l05960"></a><span class="lineno"> 5960</span>&#160;        m_Flags{userDataString ? (uint8_t)FLAG_USER_DATA_STRING : (uint8_t)0}</div>
+<div class="line"><a name="l05961"></a><span class="lineno"> 5961</span>&#160;    {</div>
+<div class="line"><a name="l05962"></a><span class="lineno"> 5962</span>&#160;<span class="preprocessor">#if VMA_STATS_STRING_ENABLED</span></div>
+<div class="line"><a name="l05963"></a><span class="lineno"> 5963</span>&#160;        m_CreationFrameIndex = currentFrameIndex;</div>
+<div class="line"><a name="l05964"></a><span class="lineno"> 5964</span>&#160;        m_BufferImageUsage = 0;</div>
+<div class="line"><a name="l05965"></a><span class="lineno"> 5965</span>&#160;<span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l05966"></a><span class="lineno"> 5966</span>&#160;    }</div>
+<div class="line"><a name="l05967"></a><span class="lineno"> 5967</span>&#160; </div>
+<div class="line"><a name="l05968"></a><span class="lineno"> 5968</span>&#160;    ~VmaAllocation_T()</div>
+<div class="line"><a name="l05969"></a><span class="lineno"> 5969</span>&#160;    {</div>
+<div class="line"><a name="l05970"></a><span class="lineno"> 5970</span>&#160;        VMA_ASSERT((m_MapCount &amp; ~MAP_COUNT_FLAG_PERSISTENT_MAP) == 0 &amp;&amp; <span class="stringliteral">&quot;Allocation was not unmapped before destruction.&quot;</span>);</div>
+<div class="line"><a name="l05971"></a><span class="lineno"> 5971</span>&#160; </div>
+<div class="line"><a name="l05972"></a><span class="lineno"> 5972</span>&#160;        <span class="comment">// Check if owned string was freed.</span></div>
+<div class="line"><a name="l05973"></a><span class="lineno"> 5973</span>&#160;        VMA_ASSERT(m_pUserData == VMA_NULL);</div>
+<div class="line"><a name="l05974"></a><span class="lineno"> 5974</span>&#160;    }</div>
+<div class="line"><a name="l05975"></a><span class="lineno"> 5975</span>&#160; </div>
+<div class="line"><a name="l05976"></a><span class="lineno"> 5976</span>&#160;    <span class="keywordtype">void</span> InitBlockAllocation(</div>
+<div class="line"><a name="l05977"></a><span class="lineno"> 5977</span>&#160;        VmaDeviceMemoryBlock* block,</div>
+<div class="line"><a name="l05978"></a><span class="lineno"> 5978</span>&#160;        VkDeviceSize offset,</div>
+<div class="line"><a name="l05979"></a><span class="lineno"> 5979</span>&#160;        VkDeviceSize alignment,</div>
+<div class="line"><a name="l05980"></a><span class="lineno"> 5980</span>&#160;        VkDeviceSize size,</div>
+<div class="line"><a name="l05981"></a><span class="lineno"> 5981</span>&#160;        uint32_t memoryTypeIndex,</div>
+<div class="line"><a name="l05982"></a><span class="lineno"> 5982</span>&#160;        VmaSuballocationType suballocationType,</div>
+<div class="line"><a name="l05983"></a><span class="lineno"> 5983</span>&#160;        <span class="keywordtype">bool</span> mapped,</div>
+<div class="line"><a name="l05984"></a><span class="lineno"> 5984</span>&#160;        <span class="keywordtype">bool</span> canBecomeLost)</div>
+<div class="line"><a name="l05985"></a><span class="lineno"> 5985</span>&#160;    {</div>
+<div class="line"><a name="l05986"></a><span class="lineno"> 5986</span>&#160;        VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);</div>
+<div class="line"><a name="l05987"></a><span class="lineno"> 5987</span>&#160;        VMA_ASSERT(block != VMA_NULL);</div>
+<div class="line"><a name="l05988"></a><span class="lineno"> 5988</span>&#160;        m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;</div>
+<div class="line"><a name="l05989"></a><span class="lineno"> 5989</span>&#160;        m_Alignment = alignment;</div>
+<div class="line"><a name="l05990"></a><span class="lineno"> 5990</span>&#160;        m_Size = size;</div>
+<div class="line"><a name="l05991"></a><span class="lineno"> 5991</span>&#160;        m_MemoryTypeIndex = memoryTypeIndex;</div>
+<div class="line"><a name="l05992"></a><span class="lineno"> 5992</span>&#160;        m_MapCount = mapped ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;</div>
+<div class="line"><a name="l05993"></a><span class="lineno"> 5993</span>&#160;        m_SuballocationType = (uint8_t)suballocationType;</div>
+<div class="line"><a name="l05994"></a><span class="lineno"> 5994</span>&#160;        m_BlockAllocation.m_Block = block;</div>
+<div class="line"><a name="l05995"></a><span class="lineno"> 5995</span>&#160;        m_BlockAllocation.m_Offset = offset;</div>
+<div class="line"><a name="l05996"></a><span class="lineno"> 5996</span>&#160;        m_BlockAllocation.m_CanBecomeLost = canBecomeLost;</div>
+<div class="line"><a name="l05997"></a><span class="lineno"> 5997</span>&#160;    }</div>
+<div class="line"><a name="l05998"></a><span class="lineno"> 5998</span>&#160; </div>
+<div class="line"><a name="l05999"></a><span class="lineno"> 5999</span>&#160;    <span class="keywordtype">void</span> InitLost()</div>
+<div class="line"><a name="l06000"></a><span class="lineno"> 6000</span>&#160;    {</div>
+<div class="line"><a name="l06001"></a><span class="lineno"> 6001</span>&#160;        VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);</div>
+<div class="line"><a name="l06002"></a><span class="lineno"> 6002</span>&#160;        VMA_ASSERT(m_LastUseFrameIndex.load() == VMA_FRAME_INDEX_LOST);</div>
+<div class="line"><a name="l06003"></a><span class="lineno"> 6003</span>&#160;        m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;</div>
+<div class="line"><a name="l06004"></a><span class="lineno"> 6004</span>&#160;        m_MemoryTypeIndex = 0;</div>
+<div class="line"><a name="l06005"></a><span class="lineno"> 6005</span>&#160;        m_BlockAllocation.m_Block = VMA_NULL;</div>
+<div class="line"><a name="l06006"></a><span class="lineno"> 6006</span>&#160;        m_BlockAllocation.m_Offset = 0;</div>
+<div class="line"><a name="l06007"></a><span class="lineno"> 6007</span>&#160;        m_BlockAllocation.m_CanBecomeLost = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l06008"></a><span class="lineno"> 6008</span>&#160;    }</div>
+<div class="line"><a name="l06009"></a><span class="lineno"> 6009</span>&#160; </div>
+<div class="line"><a name="l06010"></a><span class="lineno"> 6010</span>&#160;    <span class="keywordtype">void</span> ChangeBlockAllocation(</div>
+<div class="line"><a name="l06011"></a><span class="lineno"> 6011</span>&#160;        <a class="code" href="struct_vma_allocator.html">VmaAllocator</a> hAllocator,</div>
+<div class="line"><a name="l06012"></a><span class="lineno"> 6012</span>&#160;        VmaDeviceMemoryBlock* block,</div>
+<div class="line"><a name="l06013"></a><span class="lineno"> 6013</span>&#160;        VkDeviceSize offset); </div>
+<div class="line"><a name="l06014"></a><span class="lineno"> 6014</span>&#160; </div>
+<div class="line"><a name="l06015"></a><span class="lineno"> 6015</span>&#160;    <span class="keywordtype">void</span> ChangeOffset(VkDeviceSize newOffset);</div>
+<div class="line"><a name="l06016"></a><span class="lineno"> 6016</span>&#160; </div>
+<div class="line"><a name="l06017"></a><span class="lineno"> 6017</span>&#160;    <span class="comment">// pMappedData not null means allocation is created with MAPPED flag.</span></div>
+<div class="line"><a name="l06018"></a><span class="lineno"> 6018</span>&#160;    <span class="keywordtype">void</span> InitDedicatedAllocation(</div>
+<div class="line"><a name="l06019"></a><span class="lineno"> 6019</span>&#160;        uint32_t memoryTypeIndex,</div>
+<div class="line"><a name="l06020"></a><span class="lineno"> 6020</span>&#160;        VkDeviceMemory hMemory,</div>
+<div class="line"><a name="l06021"></a><span class="lineno"> 6021</span>&#160;        VmaSuballocationType suballocationType,</div>
+<div class="line"><a name="l06022"></a><span class="lineno"> 6022</span>&#160;        <span class="keywordtype">void</span>* pMappedData,</div>
+<div class="line"><a name="l06023"></a><span class="lineno"> 6023</span>&#160;        VkDeviceSize size)</div>
+<div class="line"><a name="l06024"></a><span class="lineno"> 6024</span>&#160;    {</div>
+<div class="line"><a name="l06025"></a><span class="lineno"> 6025</span>&#160;        VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);</div>
+<div class="line"><a name="l06026"></a><span class="lineno"> 6026</span>&#160;        VMA_ASSERT(hMemory != VK_NULL_HANDLE);</div>
+<div class="line"><a name="l06027"></a><span class="lineno"> 6027</span>&#160;        m_Type = (uint8_t)ALLOCATION_TYPE_DEDICATED;</div>
+<div class="line"><a name="l06028"></a><span class="lineno"> 6028</span>&#160;        m_Alignment = 0;</div>
+<div class="line"><a name="l06029"></a><span class="lineno"> 6029</span>&#160;        m_Size = size;</div>
+<div class="line"><a name="l06030"></a><span class="lineno"> 6030</span>&#160;        m_MemoryTypeIndex = memoryTypeIndex;</div>
+<div class="line"><a name="l06031"></a><span class="lineno"> 6031</span>&#160;        m_SuballocationType = (uint8_t)suballocationType;</div>
+<div class="line"><a name="l06032"></a><span class="lineno"> 6032</span>&#160;        m_MapCount = (pMappedData != VMA_NULL) ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;</div>
+<div class="line"><a name="l06033"></a><span class="lineno"> 6033</span>&#160;        m_DedicatedAllocation.m_hMemory = hMemory;</div>
+<div class="line"><a name="l06034"></a><span class="lineno"> 6034</span>&#160;        m_DedicatedAllocation.m_pMappedData = pMappedData;</div>
 <div class="line"><a name="l06035"></a><span class="lineno"> 6035</span>&#160;    }</div>
-<div class="line"><a name="l06036"></a><span class="lineno"> 6036</span>&#160;    <span class="keywordtype">bool</span> CompareExchangeLastUseFrameIndex(uint32_t&amp; expected, uint32_t desired)</div>
-<div class="line"><a name="l06037"></a><span class="lineno"> 6037</span>&#160;    {</div>
-<div class="line"><a name="l06038"></a><span class="lineno"> 6038</span>&#160;        <span class="keywordflow">return</span> m_LastUseFrameIndex.compare_exchange_weak(expected, desired);</div>
-<div class="line"><a name="l06039"></a><span class="lineno"> 6039</span>&#160;    }</div>
-<div class="line"><a name="l06040"></a><span class="lineno"> 6040</span>&#160;    <span class="comment">/*</span></div>
-<div class="line"><a name="l06041"></a><span class="lineno"> 6041</span>&#160;<span class="comment">    - If hAllocation.LastUseFrameIndex + frameInUseCount &lt; allocator.CurrentFrameIndex,</span></div>
-<div class="line"><a name="l06042"></a><span class="lineno"> 6042</span>&#160;<span class="comment">      makes it lost by setting LastUseFrameIndex = VMA_FRAME_INDEX_LOST and returns true.</span></div>
-<div class="line"><a name="l06043"></a><span class="lineno"> 6043</span>&#160;<span class="comment">    - Else, returns false.</span></div>
-<div class="line"><a name="l06044"></a><span class="lineno"> 6044</span>&#160;<span class="comment">    </span></div>
-<div class="line"><a name="l06045"></a><span class="lineno"> 6045</span>&#160;<span class="comment">    If hAllocation is already lost, assert - you should not call it then.</span></div>
-<div class="line"><a name="l06046"></a><span class="lineno"> 6046</span>&#160;<span class="comment">    If hAllocation was not created with CAN_BECOME_LOST_BIT, assert.</span></div>
-<div class="line"><a name="l06047"></a><span class="lineno"> 6047</span>&#160;<span class="comment">    */</span></div>
-<div class="line"><a name="l06048"></a><span class="lineno"> 6048</span>&#160;    <span class="keywordtype">bool</span> MakeLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);</div>
-<div class="line"><a name="l06049"></a><span class="lineno"> 6049</span>&#160; </div>
-<div class="line"><a name="l06050"></a><span class="lineno"> 6050</span>&#160;    <span class="keywordtype">void</span> DedicatedAllocCalcStatsInfo(<a class="code" href="struct_vma_stat_info.html">VmaStatInfo</a>&amp; outInfo)</div>
-<div class="line"><a name="l06051"></a><span class="lineno"> 6051</span>&#160;    {</div>
-<div class="line"><a name="l06052"></a><span class="lineno"> 6052</span>&#160;        VMA_ASSERT(m_Type == ALLOCATION_TYPE_DEDICATED);</div>
-<div class="line"><a name="l06053"></a><span class="lineno"> 6053</span>&#160;        outInfo.<a class="code" href="struct_vma_stat_info.html#abc4bb7cd611900778464c56e50c970a4">blockCount</a> = 1;</div>
-<div class="line"><a name="l06054"></a><span class="lineno"> 6054</span>&#160;        outInfo.<a class="code" href="struct_vma_stat_info.html#a537741e4d5cdddc1c0ab95ec650afaff">allocationCount</a> = 1;</div>
-<div class="line"><a name="l06055"></a><span class="lineno"> 6055</span>&#160;        outInfo.<a class="code" href="struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9">unusedRangeCount</a> = 0;</div>
-<div class="line"><a name="l06056"></a><span class="lineno"> 6056</span>&#160;        outInfo.<a class="code" href="struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a">usedBytes</a> = m_Size;</div>
-<div class="line"><a name="l06057"></a><span class="lineno"> 6057</span>&#160;        outInfo.<a class="code" href="struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669">unusedBytes</a> = 0;</div>
-<div class="line"><a name="l06058"></a><span class="lineno"> 6058</span>&#160;        outInfo.<a class="code" href="struct_vma_stat_info.html#ade8b40bd3139c04aabd2fc538a356fea">allocationSizeMin</a> = outInfo.<a class="code" href="struct_vma_stat_info.html#a17e9733a5ecd76287d4db6e66f71f50c">allocationSizeMax</a> = m_Size;</div>
-<div class="line"><a name="l06059"></a><span class="lineno"> 6059</span>&#160;        outInfo.<a class="code" href="struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4">unusedRangeSizeMin</a> = UINT64_MAX;</div>
-<div class="line"><a name="l06060"></a><span class="lineno"> 6060</span>&#160;        outInfo.<a class="code" href="struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4">unusedRangeSizeMax</a> = 0;</div>
-<div class="line"><a name="l06061"></a><span class="lineno"> 6061</span>&#160;    }</div>
-<div class="line"><a name="l06062"></a><span class="lineno"> 6062</span>&#160; </div>
-<div class="line"><a name="l06063"></a><span class="lineno"> 6063</span>&#160;    <span class="keywordtype">void</span> BlockAllocMap();</div>
-<div class="line"><a name="l06064"></a><span class="lineno"> 6064</span>&#160;    <span class="keywordtype">void</span> BlockAllocUnmap();</div>
-<div class="line"><a name="l06065"></a><span class="lineno"> 6065</span>&#160;    VkResult DedicatedAllocMap(<a class="code" href="struct_vma_allocator.html">VmaAllocator</a> hAllocator, <span class="keywordtype">void</span>** ppData);</div>
-<div class="line"><a name="l06066"></a><span class="lineno"> 6066</span>&#160;    <span class="keywordtype">void</span> DedicatedAllocUnmap(<a class="code" href="struct_vma_allocator.html">VmaAllocator</a> hAllocator);</div>
-<div class="line"><a name="l06067"></a><span class="lineno"> 6067</span>&#160; </div>
-<div class="line"><a name="l06068"></a><span class="lineno"> 6068</span>&#160;<span class="preprocessor">#if VMA_STATS_STRING_ENABLED</span></div>
-<div class="line"><a name="l06069"></a><span class="lineno"> 6069</span>&#160;    uint32_t GetCreationFrameIndex()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_CreationFrameIndex; }</div>
-<div class="line"><a name="l06070"></a><span class="lineno"> 6070</span>&#160;    uint32_t GetBufferImageUsage()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_BufferImageUsage; }</div>
-<div class="line"><a name="l06071"></a><span class="lineno"> 6071</span>&#160; </div>
-<div class="line"><a name="l06072"></a><span class="lineno"> 6072</span>&#160;    <span class="keywordtype">void</span> InitBufferImageUsage(uint32_t bufferImageUsage)</div>
-<div class="line"><a name="l06073"></a><span class="lineno"> 6073</span>&#160;    {</div>
-<div class="line"><a name="l06074"></a><span class="lineno"> 6074</span>&#160;        VMA_ASSERT(m_BufferImageUsage == 0);</div>
-<div class="line"><a name="l06075"></a><span class="lineno"> 6075</span>&#160;        m_BufferImageUsage = bufferImageUsage;</div>
-<div class="line"><a name="l06076"></a><span class="lineno"> 6076</span>&#160;    }</div>
-<div class="line"><a name="l06077"></a><span class="lineno"> 6077</span>&#160; </div>
-<div class="line"><a name="l06078"></a><span class="lineno"> 6078</span>&#160;    <span class="keywordtype">void</span> PrintParameters(<span class="keyword">class</span> VmaJsonWriter&amp; json) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l06079"></a><span class="lineno"> 6079</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l06080"></a><span class="lineno"> 6080</span>&#160; </div>
-<div class="line"><a name="l06081"></a><span class="lineno&qu