Rebuilt the documentation

This commit is contained in:
Adam Sawicki 2025-04-11 17:33:26 +02:00
parent fc2cea529d
commit 1ea5f2fd8d
12 changed files with 33 additions and 33 deletions

View file

@ -124,7 +124,7 @@ $(function(){ initResizable(false); });
<div class="line"><span class="comment">// Create a pool that can have at most 2 blocks, 128 MiB each.</span></div>
<div class="line"><a class="code hl_struct" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a> poolCreateInfo = {};</div>
<div class="line">poolCreateInfo.<a class="code hl_variable" href="struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319">memoryTypeIndex</a> = memTypeIndex;</div>
<div class="line">poolCreateInfo.<a class="code hl_variable" href="struct_vma_pool_create_info.html#aa4265160536cdb9be821b7686c16c676">blockSize</a> = 128ull * 1024 * 1024;</div>
<div class="line">poolCreateInfo.<a class="code hl_variable" href="struct_vma_pool_create_info.html#aa4265160536cdb9be821b7686c16c676">blockSize</a> = 128ULL * 1024 * 1024;</div>
<div class="line">poolCreateInfo.<a class="code hl_variable" href="struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c">maxBlockCount</a> = 2;</div>
<div class="line"> </div>
<div class="line"><a class="code hl_struct" href="struct_vma_pool.html">VmaPool</a> pool;</div>
@ -199,7 +199,7 @@ When not to use custom pools</h1>
<li>If you want to keep your images and buffers separate, you don't need to. VMA respects <code>bufferImageGranularity</code> limit automatically.</li>
<li>If you want to keep your mapped and not mapped allocations separate, you don't need to. VMA respects <code>nonCoherentAtomSize</code> limit automatically. It also maps only those <code>VkDeviceMemory</code> blocks that need to map any allocation. It even tries to keep mappable and non-mappable allocations in separate blocks to minimize the amount of mapped memory.</li>
<li>If you want to choose a custom size for the default memory block, you can set it globally instead using <a class="el" href="struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a" title="Preferred size of a single VkDeviceMemory block to be allocated from large heaps &gt; 1 GiB....">VmaAllocatorCreateInfo::preferredLargeHeapBlockSize</a>.</li>
<li>If you want to select specific memory type for your allocation, you can set <a class="el" href="struct_vma_allocation_create_info.html#a3bf940c0271d85d6ba32a4d820075055" title="Bitmask containing one bit set for every memory type acceptable for this allocation.">VmaAllocationCreateInfo::memoryTypeBits</a> to <code>(1u &lt;&lt; myMemoryTypeIndex)</code> instead.</li>
<li>If you want to select specific memory type for your allocation, you can set <a class="el" href="struct_vma_allocation_create_info.html#a3bf940c0271d85d6ba32a4d820075055" title="Bitmask containing one bit set for every memory type acceptable for this allocation.">VmaAllocationCreateInfo::memoryTypeBits</a> to <code>(1U &lt;&lt; myMemoryTypeIndex)</code> instead.</li>
<li>If you need to create a buffer with certain minimum alignment, you can still do it using default pools with dedicated function <a class="el" href="group__group__alloc.html#gaa06a690013a0d01e60894ac378083834" title="Creates a buffer with additional minimum alignment.">vmaCreateBufferWithAlignment()</a>.</li>
</ul>
<h1><a class="anchor" id="linear_algorithm"></a>
@ -211,7 +211,7 @@ Linear allocation algorithm</h1>
<p>With this one flag, you can create a custom pool that can be used in many ways: free-at-once, stack, double stack, and ring buffer. See below for details. You don't need to specify explicitly which of these options you are going to use - it is detected automatically.</p>
<h2><a class="anchor" id="linear_algorithm_free_at_once"></a>
Free-at-once</h2>
<p>In a pool that uses linear algorithm, you still need to free all the allocations individually, e.g. by using <a class="el" href="group__group__alloc.html#ga5fea5518972ae9094b1526cbcb19b05f" title="Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(),...">vmaFreeMemory()</a> or <a class="el" href="group__group__alloc.html#ga0d9f4e4ba5bf9aab1f1c746387753d77" title="Destroys Vulkan buffer and frees allocated memory.">vmaDestroyBuffer()</a>. You can free them in any order. New allocations are always made after last one - free space in the middle is not reused. However, when you release all the allocation and the pool becomes empty, allocation starts from the beginning again. This way you can use linear algorithm to speed up creation of allocations that you are going to release all at once.</p>
<p>In a pool that uses linear algorithm, you still need to free all the allocations individually, e.g. by using <a class="el" href="group__group__alloc.html#ga11f0fbc034fa81a4efedd73d61ce7568" title="Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(),...">vmaFreeMemory()</a> or <a class="el" href="group__group__alloc.html#ga0d9f4e4ba5bf9aab1f1c746387753d77" title="Destroys Vulkan buffer and frees allocated memory.">vmaDestroyBuffer()</a>. You can free them in any order. New allocations are always made after last one - free space in the middle is not reused. However, when you release all the allocation and the pool becomes empty, allocation starts from the beginning again. This way you can use linear algorithm to speed up creation of allocations that you are going to release all at once.</p>
<p><img src="../gfx/Linear_allocator_3_free_at_once.png" alt="Free-at-once" class="inline"/></p>
<p>This mode is also available for pools created with <a class="el" href="struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c" title="Maximum number of blocks that can be allocated in this pool. Optional.">VmaPoolCreateInfo::maxBlockCount</a> value that allows multiple memory blocks.</p>
<h2><a class="anchor" id="linear_algorithm_stack"></a>