Added possibility to choose different allocation algorithm in custom pools and virtual blocks.

Changed behavior of VirtualBlock::Allocate, FreeAllocation: VirtualAllocation::AllocHandle = 0 (not UINT64_MAX) now means null allocation.
Ported linear allocation algorithm from VMA.
Renamed VIRTUAL_ALLOCATION_INFO members to uppercase Offset, Size.
Fixed D3D12MA_DEBUG_MARGIN not to be applied to virtual allocator.
Added test for D3D12MA_DEBUG_MARGIN (ported from VMA).
Code mostly by @medranSolus
Updated and rebuilt documentation.
This commit is contained in:
Adam Sawicki 2022-02-04 13:22:45 +01:00
parent 56335afdad
commit 3a3b44555a
61 changed files with 3162 additions and 277 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
docs/gfx/Margins_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

BIN
docs/gfx/Margins_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -154,19 +154,42 @@ Typedefs</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:abbad31a7e0b3d09d77f3fb704b77645e"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e">D3D12MA::ALLOCATION_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea0bf578b096d6ea73cea86b031541733e">D3D12MA::ALLOCATION_FLAG_NONE</a> = 0
<tr class="memitem:abbad31a7e0b3d09d77f3fb704b77645e"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e">D3D12MA::ALLOCATION_FLAGS</a> { <br />
&#160;&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea0bf578b096d6ea73cea86b031541733e">D3D12MA::ALLOCATION_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675">D3D12MA::ALLOCATION_FLAG_COMMITTED</a> = 0x1
, <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea9a52c6ae694eadcd20896091e77c0628">D3D12MA::ALLOCATION_FLAG_NEVER_ALLOCATE</a> = 0x2
, <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6">D3D12MA::ALLOCATION_FLAG_WITHIN_BUDGET</a> = 0x4
, <br />
&#160;&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eafb0e2dacce691336e717550a1df72474">D3D12MA::ALLOCATION_FLAG_UPPER_ADDRESS</a> = 0x8
<br />
}</td></tr>
<tr class="memdesc:abbad31a7e0b3d09d77f3fb704b77645e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with ALLOCATION_DESC::Flags. <a href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e">More...</a><br /></td></tr>
<tr class="separator:abbad31a7e0b3d09d77f3fb704b77645e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a919d8545365d6b7209a964f2b99936d1"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1">D3D12MA::POOL_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02">D3D12MA::POOL_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a0dbdb7cee4b4e381851275aa5ca2164a">D3D12MA::POOL_FLAG_ALGORITHM_TLSF</a> = 0x1
, <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a">D3D12MA::POOL_FLAG_ALGORITHM_LINEAR</a> = 0x2
, <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aec9d4939b8cc5438545b9df840b5f5f7">D3D12MA::POOL_FLAG_ALGORITHM_MASK</a> = POOL_FLAG_ALGORITHM_TLSF | POOL_FLAG_ALGORITHM_LINEAR
}</td></tr>
<tr class="memdesc:a919d8545365d6b7209a964f2b99936d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with POOL_DESC::Flags. <a href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1">More...</a><br /></td></tr>
<tr class="separator:a919d8545365d6b7209a964f2b99936d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5ae5a5e42b878f2e18ab5d1fbfb9916"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916">D3D12MA::ALLOCATOR_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f">D3D12MA::ALLOCATOR_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52">D3D12MA::ALLOCATOR_FLAG_SINGLETHREADED</a> = 0x1
, <a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb">D3D12MA::ALLOCATOR_FLAG_ALWAYS_COMMITTED</a> = 0x2
}</td></tr>
<tr class="memdesc:ad5ae5a5e42b878f2e18ab5d1fbfb9916"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with ALLOCATOR_DESC::Flags. <a href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916">More...</a><br /></td></tr>
<tr class="separator:ad5ae5a5e42b878f2e18ab5d1fbfb9916"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a578329923a103be086ac52e3bed2085d"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d">D3D12MA::VIRTUAL_BLOCK_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dafc882884f8bacd5cab3087567df8c53d">D3D12MA::VIRTUAL_BLOCK_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dab6eea831fa737a4160a81d9c0b2cf3cf">D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_TLSF</a> = POOL_FLAG_ALGORITHM_TLSF
, <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d">D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR</a> = POOL_FLAG_ALGORITHM_LINEAR
, <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085da0fee243cbf2902a68123ac85caa21e3e">D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK</a> = POOL_FLAG_ALGORITHM_MASK
}</td></tr>
<tr class="memdesc:a578329923a103be086ac52e3bed2085d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with VIRTUAL_BLOCK_DESC::Flags. <a href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d">More...</a><br /></td></tr>
<tr class="separator:a578329923a103be086ac52e3bed2085d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e4152ccaf661f5398b24a23cbe9ae72"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72">D3D12MA::VIRTUAL_ALLOCATION_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a03576295004dec9dc8f99a895d232027">D3D12MA::VIRTUAL_ALLOCATION_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a86beebcb80a1a10cb5525e2c9ed1435e">D3D12MA::VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS</a> = ALLOCATION_FLAG_UPPER_ADDRESS
}</td></tr>
<tr class="memdesc:a7e4152ccaf661f5398b24a23cbe9ae72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with VIRTUAL_ALLOCATION_DESC::Flags. <a href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72">More...</a><br /></td></tr>
<tr class="separator:a7e4152ccaf661f5398b24a23cbe9ae72"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>

View File

@ -156,12 +156,13 @@ Public Member Functions</h2></td></tr>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">pDesc</td><td></td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">pAllocation</td><td>Unique indentifier of the new allocation within single block. <code>UINT64_MAX</code> in AllocHandle if allocation failed. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">pAllocation</td><td>Unique indentifier of the new allocation within single block. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">pOffset</td><td>Returned offset of the new allocation. Optional, can be null. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>S_OK</code> if allocation succeeded, <code>E_OUTOFMEMORY</code> if it failed. </dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code>S_OK</code> if allocation succeeded, <code>E_OUTOFMEMORY</code> if it failed.</dd></dl>
<p>If the allocation failed, <code>pAllocation-&gt;AllocHandle</code> is set to 0 and <code>pOffset</code>, if not null, is set to <code>UINT64_MAX</code>. </p>
</div>
</div>
@ -247,6 +248,7 @@ Public Member Functions</h2></td></tr>
</div><div class="memdoc">
<p>Frees the allocation. </p>
<p >Calling this function with <code>allocation.AllocHandle == 0</code> is correct and does nothing. </p>
</div>
</div>

View File

@ -101,16 +101,28 @@ Custom CPU memory allocator</h1>
<div class="line"> </div>
<div class="line"><a class="code hl_class" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a>* allocator;</div>
<div class="line">HRESULT hr = <a class="code hl_function" href="namespace_d3_d12_m_a.html#ab7a1cd1683986d75ce1488b0920f4cb0">D3D12MA::CreateAllocator</a>(&amp;allocatorDesc, &amp;allocator);</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocator_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></div><div class="ttdoc">Represents main object of this library initialized for particular ID3D12Device.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:692</div></div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocator_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></div><div class="ttdoc">Represents main object of this library initialized for particular ID3D12Device.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:737</div></div>
<div class="ttc" id="anamespace_d3_d12_m_a_html_ab7a1cd1683986d75ce1488b0920f4cb0"><div class="ttname"><a href="namespace_d3_d12_m_a.html#ab7a1cd1683986d75ce1488b0920f4cb0">D3D12MA::CreateAllocator</a></div><div class="ttdeci">D3D12MA_API HRESULT CreateAllocator(const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)</div><div class="ttdoc">Creates new main D3D12MA::Allocator object and returns it through ppAllocator.</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html">D3D12MA::ALLOCATION_CALLBACKS</a></div><div class="ttdoc">Custom callbacks to CPU memory allocation functions.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:181</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s_html_a114e6c4d63d6b020e01f526a975d6849"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html#a114e6c4d63d6b020e01f526a975d6849">D3D12MA::ALLOCATION_CALLBACKS::pFree</a></div><div class="ttdeci">FREE_FUNC_PTR pFree</div><div class="ttdoc">Dellocation function.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:185</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s_html_af4d6436455728696fefd503869226436"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html#af4d6436455728696fefd503869226436">D3D12MA::ALLOCATION_CALLBACKS::pAllocate</a></div><div class="ttdeci">ALLOCATE_FUNC_PTR pAllocate</div><div class="ttdoc">Allocation function.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:183</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html">D3D12MA::ALLOCATOR_DESC</a></div><div class="ttdoc">Parameters of created Allocator object. To be used with CreateAllocator().</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:573</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_a773ecc1945eb47c20e06455c3759e4ef"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#a773ecc1945eb47c20e06455c3759e4ef">D3D12MA::ALLOCATOR_DESC::pAllocationCallbacks</a></div><div class="ttdeci">const ALLOCATION_CALLBACKS * pAllocationCallbacks</div><div class="ttdoc">Custom CPU memory allocation callbacks. Optional.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:593</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_abf9a9f87f0ffea52816efd363c5fcd7b"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#abf9a9f87f0ffea52816efd363c5fcd7b">D3D12MA::ALLOCATOR_DESC::pAdapter</a></div><div class="ttdeci">IDXGIAdapter * pAdapter</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:599</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_ada1bf21205065b3aa0284b5a9ee1cb3c"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ada1bf21205065b3aa0284b5a9ee1cb3c">D3D12MA::ALLOCATOR_DESC::pDevice</a></div><div class="ttdeci">ID3D12Device * pDevice</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:581</div></div>
</div><!-- fragment --> </div></div><!-- contents -->
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html">D3D12MA::ALLOCATION_CALLBACKS</a></div><div class="ttdoc">Custom callbacks to CPU memory allocation functions.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:182</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s_html_a114e6c4d63d6b020e01f526a975d6849"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html#a114e6c4d63d6b020e01f526a975d6849">D3D12MA::ALLOCATION_CALLBACKS::pFree</a></div><div class="ttdeci">FREE_FUNC_PTR pFree</div><div class="ttdoc">Dellocation function.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:186</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s_html_af4d6436455728696fefd503869226436"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html#af4d6436455728696fefd503869226436">D3D12MA::ALLOCATION_CALLBACKS::pAllocate</a></div><div class="ttdeci">ALLOCATE_FUNC_PTR pAllocate</div><div class="ttdoc">Allocation function.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:184</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html">D3D12MA::ALLOCATOR_DESC</a></div><div class="ttdoc">Parameters of created Allocator object. To be used with CreateAllocator().</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:618</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_a773ecc1945eb47c20e06455c3759e4ef"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#a773ecc1945eb47c20e06455c3759e4ef">D3D12MA::ALLOCATOR_DESC::pAllocationCallbacks</a></div><div class="ttdeci">const ALLOCATION_CALLBACKS * pAllocationCallbacks</div><div class="ttdoc">Custom CPU memory allocation callbacks. Optional.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:638</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_abf9a9f87f0ffea52816efd363c5fcd7b"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#abf9a9f87f0ffea52816efd363c5fcd7b">D3D12MA::ALLOCATOR_DESC::pAdapter</a></div><div class="ttdeci">IDXGIAdapter * pAdapter</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:644</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_ada1bf21205065b3aa0284b5a9ee1cb3c"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ada1bf21205065b3aa0284b5a9ee1cb3c">D3D12MA::ALLOCATOR_DESC::pDevice</a></div><div class="ttdeci">ID3D12Device * pDevice</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:626</div></div>
</div><!-- fragment --><h1><a class="anchor" id="debug_margins"></a>
Debug margins</h1>
<p >By default, allocations are laid out in memory blocks next to each other if possible (considering required alignment returned by <code>ID3D12Device::GetResourceAllocationInfo</code>).</p>
<p ><img src="../gfx/Margins_1.png" alt="Allocations without margin" class="inline"/></p>
<p >Define macro <code>D3D12MA_DEBUG_MARGIN</code> to some non-zero value (e.g. 16) inside "D3D12MemAlloc.cpp" to enforce specified number of bytes as a margin after every allocation.</p>
<p ><img src="../gfx/Margins_2.png" alt="Allocations with margin" class="inline"/></p>
<p >If your bug goes away after enabling margins, it means it may be caused by memory being overwritten outside of allocation boundaries. It is not 100% certain though. Change in application behavior may also be caused by different order and distribution of allocations across memory blocks after margins are applied.</p>
<p >Margins work with all memory heap types.</p>
<p >Margin is applied only to placed allocations made out of memory heaps and not to committed allocations, which have their own, implicit memory heap of specific size. It is thus not applied to allocations made using <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675">D3D12MA::ALLOCATION_FLAG_COMMITTED</a> flag or those automatically decided to put into committed allocations, e.g. due to its large size.</p>
<p >Margins appear in JSON dump as part of free space.</p>
<p >Note that enabling margins increases memory usage and fragmentation.</p>
<p >Margins do not apply to <a class="el" href="virtual_allocator.html">Virtual allocator</a>. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View File

@ -110,7 +110,7 @@ Features and benefits</h1>
<div class="line">ID3D12Resource* res;</div>
<div class="line">hr = allocator-&gt;CreateResource(&amp;allocDesc, &amp;resDesc,</div>
<div class="line"> D3D12_RESOURCE_STATE_GENERIC_READ, NULL, &amp;alloc, IID_PPV_ARGS(&amp;res));</div>
<div class="ttc" id="anamespace_d3_d12_m_a_html_abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675"><div class="ttname"><a href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675">D3D12MA::ALLOCATION_FLAG_COMMITTED</a></div><div class="ttdeci">@ ALLOCATION_FLAG_COMMITTED</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:201</div></div>
<div class="ttc" id="anamespace_d3_d12_m_a_html_abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675"><div class="ttname"><a href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675">D3D12MA::ALLOCATION_FLAG_COMMITTED</a></div><div class="ttdeci">@ ALLOCATION_FLAG_COMMITTED</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:202</div></div>
</div><!-- fragment --><p >This feature may seem unnecessary, but creating committed allocations from custom pools may be useful in some cases, e.g. to have separate memory usage statistics for some group of resources or to use extended allocation parameters, like custom <code>D3D12_HEAP_PROPERTIES</code>, which are available only in custom pools. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->

View File

@ -112,7 +112,7 @@ $(function() {
<h3><a id="index_f" name="index_f"></a>- f -</h3><ul>
<li>Flags&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a92dec49b788a334fc91c55340dfbace6">D3D12MA::ALLOCATION_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ad8abad7c80ea0d8df27c85243ce720f3">D3D12MA::ALLOCATOR_DESC</a></li>
<li>Flags&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a92dec49b788a334fc91c55340dfbace6">D3D12MA::ALLOCATION_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ad8abad7c80ea0d8df27c85243ce720f3">D3D12MA::ALLOCATOR_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4">D3D12MA::POOL_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab848f8ad39b5bf8a7c8c077e113e7fc9">D3D12MA::VIRTUAL_ALLOCATION_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a1c887a732b4db0c68a07902462e0732b">D3D12MA::VIRTUAL_BLOCK_DESC</a></li>
<li>FreeAllocation()&#160;:&#160;<a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#aab44e46bd122054c894fc84740f1e8fb">D3D12MA::VirtualBlock</a></li>
<li>FreeStatsString()&#160;:&#160;<a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a8392663494384c16d8bfa12b827b4f9c">D3D12MA::Allocator</a>, <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#a6f78ddaa7da194e239089e52093e68a9">D3D12MA::VirtualBlock</a></li>
</ul>
@ -167,7 +167,7 @@ $(function() {
<h3><a id="index_o" name="index_o"></a>- o -</h3><ul>
<li>offset&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a2e0856b5cd556fef0d66c766ac750928">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></li>
<li>Offset&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#aa125871ef3fcc8af81fc831cd386dc2e">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></li>
</ul>
@ -188,9 +188,7 @@ $(function() {
<li>SetAllocationUserData()&#160;:&#160;<a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#a9faeb1ad64ffd04b86a314fe04a8c81d">D3D12MA::VirtualBlock</a></li>
<li>SetCurrentFrameIndex()&#160;:&#160;<a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a468ba0c93121eaaee402b08775f1dd11">D3D12MA::Allocator</a></li>
<li>SetName()&#160;:&#160;<a class="el" href="class_d3_d12_m_a_1_1_allocation.html#af9e643276b577aa7f21937f75d4b82ac">D3D12MA::Allocation</a>, <a class="el" href="class_d3_d12_m_a_1_1_pool.html#a20617cfec0461cf8c2b92115b5140c5b">D3D12MA::Pool</a></li>
<li>Size&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></li>
<li>size&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ab8ede12141594a69230afeb34664fc34">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></li>
<li>Size&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">D3D12MA::VIRTUAL_BLOCK_DESC</a></li>
<li>Size&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">D3D12MA::VIRTUAL_ALLOCATION_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ac265159500190e35ebef8e4784c73a09">D3D12MA::VIRTUAL_ALLOCATION_INFO</a>, <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">D3D12MA::VIRTUAL_BLOCK_DESC</a></li>
</ul>

View File

@ -96,7 +96,7 @@ $(function() {
<h3><a id="index_f" name="index_f"></a>- f -</h3><ul>
<li>Flags&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a92dec49b788a334fc91c55340dfbace6">D3D12MA::ALLOCATION_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ad8abad7c80ea0d8df27c85243ce720f3">D3D12MA::ALLOCATOR_DESC</a></li>
<li>Flags&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a92dec49b788a334fc91c55340dfbace6">D3D12MA::ALLOCATION_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ad8abad7c80ea0d8df27c85243ce720f3">D3D12MA::ALLOCATOR_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4">D3D12MA::POOL_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab848f8ad39b5bf8a7c8c077e113e7fc9">D3D12MA::VIRTUAL_ALLOCATION_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a1c887a732b4db0c68a07902462e0732b">D3D12MA::VIRTUAL_BLOCK_DESC</a></li>
</ul>
@ -129,7 +129,7 @@ $(function() {
<h3><a id="index_o" name="index_o"></a>- o -</h3><ul>
<li>offset&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a2e0856b5cd556fef0d66c766ac750928">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></li>
<li>Offset&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#aa125871ef3fcc8af81fc831cd386dc2e">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></li>
</ul>
@ -147,9 +147,7 @@ $(function() {
<h3><a id="index_s" name="index_s"></a>- s -</h3><ul>
<li>Size&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></li>
<li>size&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ab8ede12141594a69230afeb34664fc34">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></li>
<li>Size&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">D3D12MA::VIRTUAL_BLOCK_DESC</a></li>
<li>Size&#160;:&#160;<a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">D3D12MA::VIRTUAL_ALLOCATION_DESC</a>, <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ac265159500190e35ebef8e4784c73a09">D3D12MA::VIRTUAL_ALLOCATION_INFO</a>, <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">D3D12MA::VIRTUAL_BLOCK_DESC</a></li>
</ul>

View File

@ -77,24 +77,11 @@ Thread safety</h1>
<li>When the allocator is created with <a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52">D3D12MA::ALLOCATOR_FLAG_SINGLETHREADED</a>, calls to methods of <a class="el" href="class_d3_d12_m_a_1_1_allocator.html" title="Represents main object of this library initialized for particular ID3D12Device.">D3D12MA::Allocator</a> class must be made from a single thread or synchronized by the user. Using this flag may improve performance.</li>
<li><a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html" title="Represents pure allocation algorithm and a data structure with allocations in some memory block,...">D3D12MA::VirtualBlock</a> is not safe to be used from multiple threads simultaneously.</li>
</ul>
<h1><a class="anchor" id="general_considerations_future_plans"></a>
Future plans</h1>
<p >Features planned for future releases:</p>
<p >Near future: feature parity with <a href="https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/">Vulkan Memory Allocator</a>, including:</p>
<ul>
<li>Alternative allocation algorithms: linear allocator, buddy allocator</li>
<li>Support for priorities using <code>ID3D12Device1::SetResidencyPriority</code></li>
</ul>
<p >Later:</p>
<ul>
<li>Memory defragmentation</li>
<li>Support for multi-GPU (multi-adapter)</li>
</ul>
<h1><a class="anchor" id="general_considerations_features_not_supported"></a>
Features not supported</h1>
<p >Features deliberately excluded from the scope of this library:</p>
<ul>
<li><b>Descriptor allocation.</b> Although also called "heaps", objects that represent descriptors are separate part of the D3D12 API from buffers and textures.</li>
<li><b>Descriptor allocation.</b> Although also called "heaps", objects that represent descriptors are separate part of the D3D12 API from buffers and textures. You can still use <a class="el" href="virtual_allocator.html">Virtual allocator</a> to manage descriptors and their ranges inside a descriptor heap.</li>
<li><b>Support for reserved (tiled) resources.</b> We don't recommend using them.</li>
<li>Support for <code>ID3D12Device::Evict</code> and <code>MakeResident</code>. We don't recommend using them. You can call them on the D3D12 objects manually. Plese keep in mind, however, that eviction happens on the level of entire <code>ID3D12Heap</code> memory blocks and not individual buffers or textures which may be placed inside them.</li>
<li><b>Handling CPU memory allocation failures.</b> When dynamically creating small C++ objects in CPU memory (not the GPU memory), allocation failures are not handled gracefully, because that would complicate code significantly and is usually not needed in desktop PC applications anyway. Success of an allocation is just checked with an assert.</li>

View File

@ -81,16 +81,17 @@ Table of contents</h1>
</li>
<li><a class="el" href="custom_pools.html">Custom memory pools</a></li>
<li><a class="el" href="resource_aliasing.html">Resource aliasing (overlap)</a></li>
<li><a class="el" href="linear_algorithm.html">Linear allocation algorithm</a></li>
<li><a class="el" href="virtual_allocator.html">Virtual allocator</a></li>
</ul>
</li>
<li><a class="el" href="configuration.html">Configuration</a><ul>
<li><a class="el" href="configuration.html#custom_memory_allocator">Custom CPU memory allocator</a></li>
<li><a class="el" href="configuration.html#debug_margins">Debug margins</a></li>
</ul>
</li>
<li><a class="el" href="general_considerations.html">General considerations</a><ul>
<li><a class="el" href="general_considerations.html#general_considerations_thread_safety">Thread safety</a></li>
<li><a class="el" href="general_considerations.html#general_considerations_future_plans">Future plans</a></li>
<li><a class="el" href="general_considerations.html#general_considerations_features_not_supported">Features not supported</a></li>
</ul>
</li>

View File

@ -0,0 +1,113 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Direct3D 12 Memory Allocator: Linear allocation algorithm</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Direct3D 12 Memory Allocator
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="index.html">D3D12 Memory Allocator</a></li> </ul>
</div>
</div><!-- top -->
<div><div class="header">
<div class="headertitle"><div class="title">Linear allocation algorithm </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p >Each D3D12 memory block managed by this library has accompanying metadata that keeps track of used and unused regions. By default, the metadata structure and algorithm tries to find best place for new allocations among free regions to optimize memory usage. This way you can allocate and free objects in any order.</p>
<p ><img src="../gfx/Linear_allocator_1_algo_default.png" alt="Default allocation algorithm" class="inline"/></p>
<p >Sometimes there is a need to use simpler, linear allocation algorithm. You can create custom pool that uses such algorithm by adding flag <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a" title="Enables alternative, linear allocation algorithm in this pool.">D3D12MA::POOL_FLAG_ALGORITHM_LINEAR</a> to <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4" title="Flags.">D3D12MA::POOL_DESC::Flags</a> while creating <a class="el" href="class_d3_d12_m_a_1_1_pool.html" title="Custom memory pool.">D3D12MA::Pool</a> object. Then an alternative metadata management is used. It always creates new allocations after last one and doesn't reuse free regions after allocations freed in the middle. It results in better allocation performance and less memory consumed by metadata.</p>
<p ><img src="../gfx/Linear_allocator_2_algo_linear.png" alt="Linear allocation algorithm" class="inline"/></p>
<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>
<h1><a class="anchor" id="linear_algorithm_free_at_once"></a>
Free-at-once</h1>
<p >In a pool that uses linear algorithm, you still need to free all the allocations individually by calling <code>allocation-&gt;Release()</code>. 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_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#abbce3a99f253928f9c3c09fa16015f9e" title="Maximum number of heaps (memory blocks) that can be allocated in this pool. Optional.">D3D12MA::POOL_DESC::MaxBlockCount</a> value that allows multiple memory blocks.</p>
<h1><a class="anchor" id="linear_algorithm_stack"></a>
Stack</h1>
<p >When you free an allocation that was created last, its space can be reused. Thanks to this, if you always release allocations in the order opposite to their creation (LIFO - Last In First Out), you can achieve behavior of a stack.</p>
<p ><img src="../gfx/Linear_allocator_4_stack.png" alt="Stack" class="inline"/></p>
<p >This mode is also available for pools created with <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#abbce3a99f253928f9c3c09fa16015f9e" title="Maximum number of heaps (memory blocks) that can be allocated in this pool. Optional.">D3D12MA::POOL_DESC::MaxBlockCount</a> value that allows multiple memory blocks.</p>
<h1><a class="anchor" id="linear_algorithm_double_stack"></a>
Double stack</h1>
<p >The space reserved by a custom pool with linear algorithm may be used by two stacks:</p>
<ul>
<li>First, default one, growing up from offset 0.</li>
<li>Second, "upper" one, growing down from the end towards lower offsets.</li>
</ul>
<p >To make allocation from the upper stack, add flag <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eafb0e2dacce691336e717550a1df72474">D3D12MA::ALLOCATION_FLAG_UPPER_ADDRESS</a> to <a class="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a92dec49b788a334fc91c55340dfbace6" title="Flags.">D3D12MA::ALLOCATION_DESC::Flags</a>.</p>
<p ><img src="../gfx/Linear_allocator_7_double_stack.png" alt="Double stack" class="inline"/></p>
<p >Double stack is available only in pools with one memory block - <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#abbce3a99f253928f9c3c09fa16015f9e" title="Maximum number of heaps (memory blocks) that can be allocated in this pool. Optional.">D3D12MA::POOL_DESC::MaxBlockCount</a> must be 1. Otherwise behavior is undefined.</p>
<p >When the two stacks' ends meet so there is not enough space between them for a new allocation, such allocation fails with usual <code>E_OUTOFMEMORY</code> error.</p>
<h1><a class="anchor" id="linear_algorithm_ring_buffer"></a>
Ring buffer</h1>
<p >When you free some allocations from the beginning and there is not enough free space for a new one at the end of a pool, allocator's "cursor" wraps around to the beginning and starts allocation there. Thanks to this, if you always release allocations in the same order as you created them (FIFO - First In First Out), you can achieve behavior of a ring buffer / queue.</p>
<p ><img src="../gfx/Linear_allocator_5_ring_buffer.png" alt="Ring buffer" class="inline"/></p>
<p >Ring buffer is available only in pools with one memory block - <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#abbce3a99f253928f9c3c09fa16015f9e" title="Maximum number of heaps (memory blocks) that can be allocated in this pool. Optional.">D3D12MA::POOL_DESC::MaxBlockCount</a> must be 1. Otherwise behavior is undefined.</p>
<h1><a class="anchor" id="linear_algorithm_additional_considerations"></a>
Additional considerations</h1>
<p >Linear algorithm can also be used with <a class="el" href="virtual_allocator.html">Virtual allocator</a>. See flag <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d" title="Enables alternative, linear allocation algorithm in this virtual block.">D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR</a>. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>

View File

@ -134,19 +134,42 @@ Typedefs</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:abbad31a7e0b3d09d77f3fb704b77645e"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e">ALLOCATION_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea0bf578b096d6ea73cea86b031541733e">ALLOCATION_FLAG_NONE</a> = 0
<tr class="memitem:abbad31a7e0b3d09d77f3fb704b77645e"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e">ALLOCATION_FLAGS</a> { <br />
&#160;&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea0bf578b096d6ea73cea86b031541733e">ALLOCATION_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675">ALLOCATION_FLAG_COMMITTED</a> = 0x1
, <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea9a52c6ae694eadcd20896091e77c0628">ALLOCATION_FLAG_NEVER_ALLOCATE</a> = 0x2
, <a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6">ALLOCATION_FLAG_WITHIN_BUDGET</a> = 0x4
, <br />
&#160;&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eafb0e2dacce691336e717550a1df72474">ALLOCATION_FLAG_UPPER_ADDRESS</a> = 0x8
<br />
}</td></tr>
<tr class="memdesc:abbad31a7e0b3d09d77f3fb704b77645e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with ALLOCATION_DESC::Flags. <a href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e">More...</a><br /></td></tr>
<tr class="separator:abbad31a7e0b3d09d77f3fb704b77645e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a919d8545365d6b7209a964f2b99936d1"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1">POOL_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02">POOL_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a0dbdb7cee4b4e381851275aa5ca2164a">POOL_FLAG_ALGORITHM_TLSF</a> = 0x1
, <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a">POOL_FLAG_ALGORITHM_LINEAR</a> = 0x2
, <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aec9d4939b8cc5438545b9df840b5f5f7">POOL_FLAG_ALGORITHM_MASK</a> = POOL_FLAG_ALGORITHM_TLSF | POOL_FLAG_ALGORITHM_LINEAR
}</td></tr>
<tr class="memdesc:a919d8545365d6b7209a964f2b99936d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with POOL_DESC::Flags. <a href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1">More...</a><br /></td></tr>
<tr class="separator:a919d8545365d6b7209a964f2b99936d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5ae5a5e42b878f2e18ab5d1fbfb9916"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916">ALLOCATOR_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f">ALLOCATOR_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52">ALLOCATOR_FLAG_SINGLETHREADED</a> = 0x1
, <a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb">ALLOCATOR_FLAG_ALWAYS_COMMITTED</a> = 0x2
}</td></tr>
<tr class="memdesc:ad5ae5a5e42b878f2e18ab5d1fbfb9916"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with ALLOCATOR_DESC::Flags. <a href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916">More...</a><br /></td></tr>
<tr class="separator:ad5ae5a5e42b878f2e18ab5d1fbfb9916"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a578329923a103be086ac52e3bed2085d"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d">VIRTUAL_BLOCK_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dafc882884f8bacd5cab3087567df8c53d">VIRTUAL_BLOCK_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dab6eea831fa737a4160a81d9c0b2cf3cf">VIRTUAL_BLOCK_FLAG_ALGORITHM_TLSF</a> = POOL_FLAG_ALGORITHM_TLSF
, <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d">VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR</a> = POOL_FLAG_ALGORITHM_LINEAR
, <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085da0fee243cbf2902a68123ac85caa21e3e">VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK</a> = POOL_FLAG_ALGORITHM_MASK
}</td></tr>
<tr class="memdesc:a578329923a103be086ac52e3bed2085d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with VIRTUAL_BLOCK_DESC::Flags. <a href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d">More...</a><br /></td></tr>
<tr class="separator:a578329923a103be086ac52e3bed2085d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e4152ccaf661f5398b24a23cbe9ae72"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72">VIRTUAL_ALLOCATION_FLAGS</a> { <a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a03576295004dec9dc8f99a895d232027">VIRTUAL_ALLOCATION_FLAG_NONE</a> = 0
, <a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a86beebcb80a1a10cb5525e2c9ed1435e">VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS</a> = ALLOCATION_FLAG_UPPER_ADDRESS
}</td></tr>
<tr class="memdesc:a7e4152ccaf661f5398b24a23cbe9ae72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit flags to be used with VIRTUAL_ALLOCATION_DESC::Flags. <a href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72">More...</a><br /></td></tr>
<tr class="separator:a7e4152ccaf661f5398b24a23cbe9ae72"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
@ -239,6 +262,9 @@ Variables</h2></td></tr>
</td></tr>
<tr><td class="fieldname"><a id="abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6" name="abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6"></a>ALLOCATION_FLAG_WITHIN_BUDGET&#160;</td><td class="fielddoc"><p >Create allocation only if additional memory required for it, if any, won't exceed memory budget. Otherwise return <code>E_OUTOFMEMORY</code>. </p>
</td></tr>
<tr><td class="fieldname"><a id="abbad31a7e0b3d09d77f3fb704b77645eafb0e2dacce691336e717550a1df72474" name="abbad31a7e0b3d09d77f3fb704b77645eafb0e2dacce691336e717550a1df72474"></a>ALLOCATION_FLAG_UPPER_ADDRESS&#160;</td><td class="fielddoc"><p ><a class="el" href="class_d3_d12_m_a_1_1_allocation.html" title="Represents single memory allocation.">Allocation</a> will be created from upper stack in a double stack pool.</p>
<p >This flag is only allowed for custom pools created with <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a" title="Enables alternative, linear allocation algorithm in this pool.">POOL_FLAG_ALGORITHM_LINEAR</a> flag. </p>
</td></tr>
</table>
</div>
@ -266,6 +292,85 @@ Variables</h2></td></tr>
</td></tr>
</table>
</div>
</div>
<a id="a919d8545365d6b7209a964f2b99936d1" name="a919d8545365d6b7209a964f2b99936d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a919d8545365d6b7209a964f2b99936d1">&#9670;&nbsp;</a></span>POOL_FLAGS</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1">D3D12MA::POOL_FLAGS</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Bit flags to be used with <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4" title="Flags.">POOL_DESC::Flags</a>. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02" name="a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02"></a>POOL_FLAG_NONE&#160;</td><td class="fielddoc"><p >Zero. </p>
</td></tr>
<tr><td class="fieldname"><a id="a919d8545365d6b7209a964f2b99936d1a0dbdb7cee4b4e381851275aa5ca2164a" name="a919d8545365d6b7209a964f2b99936d1a0dbdb7cee4b4e381851275aa5ca2164a"></a>POOL_FLAG_ALGORITHM_TLSF&#160;</td><td class="fielddoc"><p >Enables alternative, TLSF allocation algorithm in virtual block. </p>
<p >This algorithm is based on 2-level lists dividing address space into smaller chunks. The first level is aligned to power of two which serves as buckets for requested memory to fall into, and the second level is lineary subdivided into lists of free memory. This algorithm aims to achieve bounded response time even in the worst case scenario. <a class="el" href="class_d3_d12_m_a_1_1_allocation.html" title="Represents single memory allocation.">Allocation</a> time can be sometimes slightly longer than compared to other algorithms but in return the application can avoid stalls in case of fragmentation, giving predictable results, suitable for real-time use cases. </p>
</td></tr>
<tr><td class="fieldname"><a id="a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a" name="a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a"></a>POOL_FLAG_ALGORITHM_LINEAR&#160;</td><td class="fielddoc"><p >Enables alternative, linear allocation algorithm in this pool. </p>
<p >Specify this flag to enable linear allocation algorithm, which always creates new allocations after last one and doesn't reuse space from allocations freed in between. It trades memory consumption for simplified algorithm and data structure, which has better performance and uses less memory for metadata.</p>
<p >By using this flag, you can achieve behavior of free-at-once, stack, ring buffer, and double stack. For details, see documentation chapter <a class="el" href="linear_algorithm.html">Linear allocation algorithm</a>. </p>
</td></tr>
<tr><td class="fieldname"><a id="a919d8545365d6b7209a964f2b99936d1aec9d4939b8cc5438545b9df840b5f5f7" name="a919d8545365d6b7209a964f2b99936d1aec9d4939b8cc5438545b9df840b5f5f7"></a>POOL_FLAG_ALGORITHM_MASK&#160;</td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<a id="a7e4152ccaf661f5398b24a23cbe9ae72" name="a7e4152ccaf661f5398b24a23cbe9ae72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e4152ccaf661f5398b24a23cbe9ae72">&#9670;&nbsp;</a></span>VIRTUAL_ALLOCATION_FLAGS</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72">D3D12MA::VIRTUAL_ALLOCATION_FLAGS</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Bit flags to be used with <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab848f8ad39b5bf8a7c8c077e113e7fc9" title="Flags.">VIRTUAL_ALLOCATION_DESC::Flags</a>. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a7e4152ccaf661f5398b24a23cbe9ae72a03576295004dec9dc8f99a895d232027" name="a7e4152ccaf661f5398b24a23cbe9ae72a03576295004dec9dc8f99a895d232027"></a>VIRTUAL_ALLOCATION_FLAG_NONE&#160;</td><td class="fielddoc"><p >Zero. </p>
</td></tr>
<tr><td class="fieldname"><a id="a7e4152ccaf661f5398b24a23cbe9ae72a86beebcb80a1a10cb5525e2c9ed1435e" name="a7e4152ccaf661f5398b24a23cbe9ae72a86beebcb80a1a10cb5525e2c9ed1435e"></a>VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS&#160;</td><td class="fielddoc"><p ><a class="el" href="class_d3_d12_m_a_1_1_allocation.html" title="Represents single memory allocation.">Allocation</a> will be created from upper stack in a double stack pool. </p>
<p >This flag is only allowed for virtual blocks created with <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d" title="Enables alternative, linear allocation algorithm in this virtual block.">VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR</a> flag. </p>
</td></tr>
</table>
</div>
</div>
<a id="a578329923a103be086ac52e3bed2085d" name="a578329923a103be086ac52e3bed2085d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a578329923a103be086ac52e3bed2085d">&#9670;&nbsp;</a></span>VIRTUAL_BLOCK_FLAGS</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d">D3D12MA::VIRTUAL_BLOCK_FLAGS</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Bit flags to be used with <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a1c887a732b4db0c68a07902462e0732b" title="Flags.">VIRTUAL_BLOCK_DESC::Flags</a>. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a578329923a103be086ac52e3bed2085dafc882884f8bacd5cab3087567df8c53d" name="a578329923a103be086ac52e3bed2085dafc882884f8bacd5cab3087567df8c53d"></a>VIRTUAL_BLOCK_FLAG_NONE&#160;</td><td class="fielddoc"><p >Zero. </p>
</td></tr>
<tr><td class="fieldname"><a id="a578329923a103be086ac52e3bed2085dab6eea831fa737a4160a81d9c0b2cf3cf" name="a578329923a103be086ac52e3bed2085dab6eea831fa737a4160a81d9c0b2cf3cf"></a>VIRTUAL_BLOCK_FLAG_ALGORITHM_TLSF&#160;</td><td class="fielddoc"><p >Enables alternative, TLSF allocation algorithm in virtual block. </p>
<p >This algorithm is based on 2-level lists dividing address space into smaller chunks. The first level is aligned to power of two which serves as buckets for requested memory to fall into, and the second level is lineary subdivided into lists of free memory. This algorithm aims to achieve bounded response time even in the worst case scenario. <a class="el" href="class_d3_d12_m_a_1_1_allocation.html" title="Represents single memory allocation.">Allocation</a> time can be sometimes slightly longer than compared to other algorithms but in return the application can avoid stalls in case of fragmentation, giving predictable results, suitable for real-time use cases. </p>
</td></tr>
<tr><td class="fieldname"><a id="a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d" name="a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d"></a>VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR&#160;</td><td class="fielddoc"><p >Enables alternative, linear allocation algorithm in this virtual block. </p>
<p >Specify this flag to enable linear allocation algorithm, which always creates new allocations after last one and doesn't reuse space from allocations freed in between. It trades memory consumption for simplified algorithm and data structure, which has better performance and uses less memory for metadata.</p>
<p >By using this flag, you can achieve behavior of free-at-once, stack, ring buffer, and double stack. For details, see documentation chapter <a class="el" href="linear_algorithm.html">Linear allocation algorithm</a>. </p>
</td></tr>
<tr><td class="fieldname"><a id="a578329923a103be086ac52e3bed2085da0fee243cbf2902a68123ac85caa21e3e" name="a578329923a103be086ac52e3bed2085da0fee243cbf2902a68123ac85caa21e3e"></a>VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK&#160;</td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>

View File

@ -67,6 +67,7 @@ $(function() {
<li>ALLOCATION_FLAG_COMMITTED&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675">D3D12MA</a></li>
<li>ALLOCATION_FLAG_NEVER_ALLOCATE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea9a52c6ae694eadcd20896091e77c0628">D3D12MA</a></li>
<li>ALLOCATION_FLAG_NONE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea0bf578b096d6ea73cea86b031541733e">D3D12MA</a></li>
<li>ALLOCATION_FLAG_UPPER_ADDRESS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eafb0e2dacce691336e717550a1df72474">D3D12MA</a></li>
<li>ALLOCATION_FLAG_WITHIN_BUDGET&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6">D3D12MA</a></li>
<li>ALLOCATION_FLAGS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e">D3D12MA</a></li>
<li>ALLOCATOR_FLAG_ALWAYS_COMMITTED&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb">D3D12MA</a></li>
@ -78,6 +79,19 @@ $(function() {
<li>CreateVirtualBlock()&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#ab024647ae85ee63e2fa2c1c4beac6d98">D3D12MA</a></li>
<li>FREE_FUNC_PTR&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a6a68d0d4ed318abe8f5496d27d6caff7">D3D12MA</a></li>
<li>HEAP_TYPE_COUNT&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abad7f40135648f8d0871be36f2919982">D3D12MA</a></li>
<li>POOL_FLAG_ALGORITHM_LINEAR&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a">D3D12MA</a></li>
<li>POOL_FLAG_ALGORITHM_MASK&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aec9d4939b8cc5438545b9df840b5f5f7">D3D12MA</a></li>
<li>POOL_FLAG_ALGORITHM_TLSF&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a0dbdb7cee4b4e381851275aa5ca2164a">D3D12MA</a></li>
<li>POOL_FLAG_NONE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02">D3D12MA</a></li>
<li>POOL_FLAGS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1">D3D12MA</a></li>
<li>VIRTUAL_ALLOCATION_FLAG_NONE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a03576295004dec9dc8f99a895d232027">D3D12MA</a></li>
<li>VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a86beebcb80a1a10cb5525e2c9ed1435e">D3D12MA</a></li>
<li>VIRTUAL_ALLOCATION_FLAGS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085da0fee243cbf2902a68123ac85caa21e3e">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAG_ALGORITHM_TLSF&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dab6eea831fa737a4160a81d9c0b2cf3cf">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAG_NONE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dafc882884f8bacd5cab3087567df8c53d">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAGS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d">D3D12MA</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->

View File

@ -65,6 +65,9 @@ $(function() {
&#160;<ul>
<li>ALLOCATION_FLAGS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e">D3D12MA</a></li>
<li>ALLOCATOR_FLAGS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916">D3D12MA</a></li>
<li>POOL_FLAGS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1">D3D12MA</a></li>
<li>VIRTUAL_ALLOCATION_FLAGS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAGS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d">D3D12MA</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->

View File

@ -66,10 +66,21 @@ $(function() {
<li>ALLOCATION_FLAG_COMMITTED&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675">D3D12MA</a></li>
<li>ALLOCATION_FLAG_NEVER_ALLOCATE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea9a52c6ae694eadcd20896091e77c0628">D3D12MA</a></li>
<li>ALLOCATION_FLAG_NONE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea0bf578b096d6ea73cea86b031541733e">D3D12MA</a></li>
<li>ALLOCATION_FLAG_UPPER_ADDRESS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eafb0e2dacce691336e717550a1df72474">D3D12MA</a></li>
<li>ALLOCATION_FLAG_WITHIN_BUDGET&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6">D3D12MA</a></li>
<li>ALLOCATOR_FLAG_ALWAYS_COMMITTED&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb">D3D12MA</a></li>
<li>ALLOCATOR_FLAG_NONE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f">D3D12MA</a></li>
<li>ALLOCATOR_FLAG_SINGLETHREADED&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52">D3D12MA</a></li>
<li>POOL_FLAG_ALGORITHM_LINEAR&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a">D3D12MA</a></li>
<li>POOL_FLAG_ALGORITHM_MASK&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aec9d4939b8cc5438545b9df840b5f5f7">D3D12MA</a></li>
<li>POOL_FLAG_ALGORITHM_TLSF&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a0dbdb7cee4b4e381851275aa5ca2164a">D3D12MA</a></li>
<li>POOL_FLAG_NONE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02">D3D12MA</a></li>
<li>VIRTUAL_ALLOCATION_FLAG_NONE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a03576295004dec9dc8f99a895d232027">D3D12MA</a></li>
<li>VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a86beebcb80a1a10cb5525e2c9ed1435e">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085da0fee243cbf2902a68123ac85caa21e3e">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAG_ALGORITHM_TLSF&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dab6eea831fa737a4160a81d9c0b2cf3cf">D3D12MA</a></li>
<li>VIRTUAL_BLOCK_FLAG_NONE&#160;:&#160;<a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dafc882884f8bacd5cab3087567df8c53d">D3D12MA</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->

View File

@ -90,11 +90,11 @@ Project setup and initialization</h1>
<div class="line"> </div>
<div class="line"><a class="code hl_class" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a>* allocator;</div>
<div class="line">HRESULT hr = <a class="code hl_function" href="namespace_d3_d12_m_a.html#ab7a1cd1683986d75ce1488b0920f4cb0">D3D12MA::CreateAllocator</a>(&amp;allocatorDesc, &amp;allocator);</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocator_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></div><div class="ttdoc">Represents main object of this library initialized for particular ID3D12Device.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:692</div></div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocator_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></div><div class="ttdoc">Represents main object of this library initialized for particular ID3D12Device.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:737</div></div>
<div class="ttc" id="anamespace_d3_d12_m_a_html_ab7a1cd1683986d75ce1488b0920f4cb0"><div class="ttname"><a href="namespace_d3_d12_m_a.html#ab7a1cd1683986d75ce1488b0920f4cb0">D3D12MA::CreateAllocator</a></div><div class="ttdeci">D3D12MA_API HRESULT CreateAllocator(const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)</div><div class="ttdoc">Creates new main D3D12MA::Allocator object and returns it through ppAllocator.</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html">D3D12MA::ALLOCATOR_DESC</a></div><div class="ttdoc">Parameters of created Allocator object. To be used with CreateAllocator().</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:573</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_abf9a9f87f0ffea52816efd363c5fcd7b"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#abf9a9f87f0ffea52816efd363c5fcd7b">D3D12MA::ALLOCATOR_DESC::pAdapter</a></div><div class="ttdeci">IDXGIAdapter * pAdapter</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:599</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_ada1bf21205065b3aa0284b5a9ee1cb3c"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ada1bf21205065b3aa0284b5a9ee1cb3c">D3D12MA::ALLOCATOR_DESC::pDevice</a></div><div class="ttdeci">ID3D12Device * pDevice</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:581</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html">D3D12MA::ALLOCATOR_DESC</a></div><div class="ttdoc">Parameters of created Allocator object. To be used with CreateAllocator().</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:618</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_abf9a9f87f0ffea52816efd363c5fcd7b"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#abf9a9f87f0ffea52816efd363c5fcd7b">D3D12MA::ALLOCATOR_DESC::pAdapter</a></div><div class="ttdeci">IDXGIAdapter * pAdapter</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:644</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_ada1bf21205065b3aa0284b5a9ee1cb3c"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ada1bf21205065b3aa0284b5a9ee1cb3c">D3D12MA::ALLOCATOR_DESC::pDevice</a></div><div class="ttdeci">ID3D12Device * pDevice</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:626</div></div>
</div><!-- fragment --><p >(5.) Right before destroying the D3D12 device, destroy the allocator object.</p>
<p >Objects of this library must be destroyed by calling <code>Release</code> method. They are somewhat compatible with COM: they implement <code>IUnknown</code> interface with its virtual methods: <code>AddRef</code>, <code>Release</code>, <code>QueryInterface</code>, and they are reference-counted internally. You can use smart pointers designed for COM with objects of this library - e.g. <code>CComPtr</code> or <code>Microsoft::WRL::ComPtr</code>. The reference counter is thread-safe. <code>QueryInterface</code> method supports only <code>IUnknown</code>, as classes of this library don't define their own GUIDs.</p>
<div class="fragment"><div class="line">allocator-&gt;Release();</div>
@ -128,10 +128,10 @@ Creating resources</h1>
<div class="line"> NULL,</div>
<div class="line"> &amp;allocation,</div>
<div class="line"> IID_PPV_ARGS(&amp;resource));</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocation_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocation.html">D3D12MA::Allocation</a></div><div class="ttdoc">Represents single memory allocation.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:278</div></div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocation_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocation.html">D3D12MA::Allocation</a></div><div class="ttdoc">Represents single memory allocation.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:285</div></div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocator_html_aa37d6b9fe8ea0864f7a35b9d68e8345a"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocator.html#aa37d6b9fe8ea0864f7a35b9d68e8345a">D3D12MA::Allocator::CreateResource</a></div><div class="ttdeci">HRESULT CreateResource(const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, Allocation **ppAllocation, REFIID riidResource, void **ppvResource)</div><div class="ttdoc">Allocates memory and creates a D3D12 resource (buffer or texture). This is the main allocation functi...</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::ALLOCATION_DESC</a></div><div class="ttdoc">Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:222</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_aa46b3c0456e5a23edef3328607ebf4d7"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#aa46b3c0456e5a23edef3328607ebf4d7">D3D12MA::ALLOCATION_DESC::HeapType</a></div><div class="ttdeci">D3D12_HEAP_TYPE HeapType</div><div class="ttdoc">The type of memory heap where the new allocation should be placed.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:231</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::ALLOCATION_DESC</a></div><div class="ttdoc">Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:229</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_aa46b3c0456e5a23edef3328607ebf4d7"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#aa46b3c0456e5a23edef3328607ebf4d7">D3D12MA::ALLOCATION_DESC::HeapType</a></div><div class="ttdeci">D3D12_HEAP_TYPE HeapType</div><div class="ttdoc">The type of memory heap where the new allocation should be placed.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:238</div></div>
</div><!-- fragment --><p >You need to remember both resource and allocation objects and destroy them separately when no longer needed.</p>
<div class="fragment"><div class="line">allocation-&gt;Release();</div>
<div class="line">resource-&gt;Release();</div>

View File

@ -144,11 +144,11 @@ $(function() {
<div class="line">res2-&gt;Release();</div>
<div class="line">res1-&gt;Release();</div>
<div class="line">alloc-&gt;Release();</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocation_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocation.html">D3D12MA::Allocation</a></div><div class="ttdoc">Represents single memory allocation.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:278</div></div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocation_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocation.html">D3D12MA::Allocation</a></div><div class="ttdoc">Represents single memory allocation.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:285</div></div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_allocation_html_adca8d5a82bed492fe7265fcda6e53da2"><div class="ttname"><a href="class_d3_d12_m_a_1_1_allocation.html#adca8d5a82bed492fe7265fcda6e53da2">D3D12MA::Allocation::GetHeap</a></div><div class="ttdeci">ID3D12Heap * GetHeap() const</div><div class="ttdoc">Returns memory heap that the resource is created in.</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::ALLOCATION_DESC</a></div><div class="ttdoc">Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:222</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_a97878838f976b2d1e6b1a76881035690"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a97878838f976b2d1e6b1a76881035690">D3D12MA::ALLOCATION_DESC::ExtraHeapFlags</a></div><div class="ttdeci">D3D12_HEAP_FLAGS ExtraHeapFlags</div><div class="ttdoc">Additional heap flags to be used when allocating memory.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:247</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_aa46b3c0456e5a23edef3328607ebf4d7"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#aa46b3c0456e5a23edef3328607ebf4d7">D3D12MA::ALLOCATION_DESC::HeapType</a></div><div class="ttdeci">D3D12_HEAP_TYPE HeapType</div><div class="ttdoc">The type of memory heap where the new allocation should be placed.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:231</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::ALLOCATION_DESC</a></div><div class="ttdoc">Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:229</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_a97878838f976b2d1e6b1a76881035690"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a97878838f976b2d1e6b1a76881035690">D3D12MA::ALLOCATION_DESC::ExtraHeapFlags</a></div><div class="ttdeci">D3D12_HEAP_FLAGS ExtraHeapFlags</div><div class="ttdoc">Additional heap flags to be used when allocating memory.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:254</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_aa46b3c0456e5a23edef3328607ebf4d7"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#aa46b3c0456e5a23edef3328607ebf4d7">D3D12MA::ALLOCATION_DESC::HeapType</a></div><div class="ttdeci">D3D12_HEAP_TYPE HeapType</div><div class="ttdoc">The type of memory heap where the new allocation should be placed.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:238</div></div>
</div><!-- fragment --><p >Remember that using resouces that alias in memory requires proper synchronization. You need to issue a special barrier of type <code>D3D12_RESOURCE_BARRIER_TYPE_ALIASING</code>. You also need to treat a resource after aliasing as uninitialized - containing garbage data. For example, if you use <code>res1</code> and then want to use <code>res2</code>, you need to first initialize <code>res2</code> using either Clear, Discard, or Copy to the entire resource.</p>
<p >Additional considerations:</p>
<ul>

View File

@ -10,20 +10,21 @@ var searchData=
['allocation_5fflag_5fcommitted_7',['ALLOCATION_FLAG_COMMITTED',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675',1,'D3D12MA']]],
['allocation_5fflag_5fnever_5fallocate_8',['ALLOCATION_FLAG_NEVER_ALLOCATE',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea9a52c6ae694eadcd20896091e77c0628',1,'D3D12MA']]],
['allocation_5fflag_5fnone_9',['ALLOCATION_FLAG_NONE',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea0bf578b096d6ea73cea86b031541733e',1,'D3D12MA']]],
['allocation_5fflag_5fwithin_5fbudget_10',['ALLOCATION_FLAG_WITHIN_BUDGET',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6',1,'D3D12MA']]],
['allocation_5fflags_11',['ALLOCATION_FLAGS',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e',1,'D3D12MA']]],
['allocationbytes_12',['AllocationBytes',['../struct_d3_d12_m_a_1_1_budget.html#abcb043908bd528852f8ef3867ad76099',1,'D3D12MA::Budget']]],
['allocationcount_13',['AllocationCount',['../struct_d3_d12_m_a_1_1_stat_info.html#a2f50de812e296b71594174ff67bbac6e',1,'D3D12MA::StatInfo']]],
['allocationsizeavg_14',['AllocationSizeAvg',['../struct_d3_d12_m_a_1_1_stat_info.html#acf3339540ff01d93b6a6f5dc68d83f60',1,'D3D12MA::StatInfo']]],
['allocationsizemax_15',['AllocationSizeMax',['../struct_d3_d12_m_a_1_1_stat_info.html#acd3c6f72ffb61a8d39b65a3dab317eb6',1,'D3D12MA::StatInfo']]],
['allocationsizemin_16',['AllocationSizeMin',['../struct_d3_d12_m_a_1_1_stat_info.html#a9d9e69e9cad231fea3a41b06e7eeee35',1,'D3D12MA::StatInfo']]],
['allocator_17',['Allocator',['../class_d3_d12_m_a_1_1_allocator.html',1,'D3D12MA']]],
['allocator_5fdesc_18',['ALLOCATOR_DESC',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html',1,'D3D12MA']]],
['allocator_5fflag_5falways_5fcommitted_19',['ALLOCATOR_FLAG_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb',1,'D3D12MA']]],
['allocator_5fflag_5fnone_20',['ALLOCATOR_FLAG_NONE',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f',1,'D3D12MA']]],
['allocator_5fflag_5fsinglethreaded_21',['ALLOCATOR_FLAG_SINGLETHREADED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52',1,'D3D12MA']]],
['allocator_5fflags_22',['ALLOCATOR_FLAGS',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916',1,'D3D12MA']]],
['allochandle_23',['AllocHandle',['../struct_d3_d12_m_a_1_1_virtual_allocation.html#a5d3166cf1f284fbbea4d0b169c4dba13',1,'D3D12MA::VirtualAllocation']]],
['allochandle_24',['allocHandle',['../class_d3_d12_m_a_1_1_allocation.html#a5c38846905b1ca0ff228c6081f2fc20c',1,'D3D12MA::Allocation']]],
['allochandle_25',['AllocHandle',['../namespace_d3_d12_m_a.html#a15e349adce86a40e0417d405aef1af80',1,'D3D12MA']]]
['allocation_5fflag_5fupper_5faddress_10',['ALLOCATION_FLAG_UPPER_ADDRESS',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eafb0e2dacce691336e717550a1df72474',1,'D3D12MA']]],
['allocation_5fflag_5fwithin_5fbudget_11',['ALLOCATION_FLAG_WITHIN_BUDGET',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6',1,'D3D12MA']]],
['allocation_5fflags_12',['ALLOCATION_FLAGS',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645e',1,'D3D12MA']]],
['allocationbytes_13',['AllocationBytes',['../struct_d3_d12_m_a_1_1_budget.html#abcb043908bd528852f8ef3867ad76099',1,'D3D12MA::Budget']]],
['allocationcount_14',['AllocationCount',['../struct_d3_d12_m_a_1_1_stat_info.html#a2f50de812e296b71594174ff67bbac6e',1,'D3D12MA::StatInfo']]],
['allocationsizeavg_15',['AllocationSizeAvg',['../struct_d3_d12_m_a_1_1_stat_info.html#acf3339540ff01d93b6a6f5dc68d83f60',1,'D3D12MA::StatInfo']]],
['allocationsizemax_16',['AllocationSizeMax',['../struct_d3_d12_m_a_1_1_stat_info.html#acd3c6f72ffb61a8d39b65a3dab317eb6',1,'D3D12MA::StatInfo']]],
['allocationsizemin_17',['AllocationSizeMin',['../struct_d3_d12_m_a_1_1_stat_info.html#a9d9e69e9cad231fea3a41b06e7eeee35',1,'D3D12MA::StatInfo']]],
['allocator_18',['Allocator',['../class_d3_d12_m_a_1_1_allocator.html',1,'D3D12MA']]],
['allocator_5fdesc_19',['ALLOCATOR_DESC',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html',1,'D3D12MA']]],
['allocator_5fflag_5falways_5fcommitted_20',['ALLOCATOR_FLAG_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb',1,'D3D12MA']]],
['allocator_5fflag_5fnone_21',['ALLOCATOR_FLAG_NONE',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f',1,'D3D12MA']]],
['allocator_5fflag_5fsinglethreaded_22',['ALLOCATOR_FLAG_SINGLETHREADED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52',1,'D3D12MA']]],
['allocator_5fflags_23',['ALLOCATOR_FLAGS',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916',1,'D3D12MA']]],
['allochandle_24',['AllocHandle',['../struct_d3_d12_m_a_1_1_virtual_allocation.html#a5d3166cf1f284fbbea4d0b169c4dba13',1,'D3D12MA::VirtualAllocation']]],
['allochandle_25',['allocHandle',['../class_d3_d12_m_a_1_1_allocation.html#a5c38846905b1ca0ff228c6081f2fc20c',1,'D3D12MA::Allocation']]],
['allochandle_26',['AllocHandle',['../namespace_d3_d12_m_a.html#a15e349adce86a40e0417d405aef1af80',1,'D3D12MA']]]
];

View File

@ -3,8 +3,7 @@ var searchData=
['setallocationuserdata_0',['SetAllocationUserData',['../class_d3_d12_m_a_1_1_virtual_block.html#a9faeb1ad64ffd04b86a314fe04a8c81d',1,'D3D12MA::VirtualBlock']]],
['setcurrentframeindex_1',['SetCurrentFrameIndex',['../class_d3_d12_m_a_1_1_allocator.html#a468ba0c93121eaaee402b08775f1dd11',1,'D3D12MA::Allocator']]],
['setname_2',['SetName',['../class_d3_d12_m_a_1_1_allocation.html#af9e643276b577aa7f21937f75d4b82ac',1,'D3D12MA::Allocation::SetName()'],['../class_d3_d12_m_a_1_1_pool.html#a20617cfec0461cf8c2b92115b5140c5b',1,'D3D12MA::Pool::SetName()']]],
['size_3',['Size',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4',1,'D3D12MA::VIRTUAL_BLOCK_DESC::Size()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::Size()']]],
['size_4',['size',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ab8ede12141594a69230afeb34664fc34',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO']]],
['statinfo_5',['StatInfo',['../struct_d3_d12_m_a_1_1_stat_info.html',1,'D3D12MA']]],
['stats_6',['Stats',['../struct_d3_d12_m_a_1_1_stats.html',1,'D3D12MA']]]
['size_3',['Size',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4',1,'D3D12MA::VIRTUAL_BLOCK_DESC::Size()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::Size()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ac265159500190e35ebef8e4784c73a09',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO::Size()']]],
['statinfo_4',['StatInfo',['../struct_d3_d12_m_a_1_1_stat_info.html',1,'D3D12MA']]],
['stats_5',['Stats',['../struct_d3_d12_m_a_1_1_stats.html',1,'D3D12MA']]]
];

View File

@ -2,8 +2,16 @@ var searchData=
[
['virtual_20allocator_0',['Virtual allocator',['../virtual_allocator.html',1,'index']]],
['virtual_5fallocation_5fdesc_1',['VIRTUAL_ALLOCATION_DESC',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html',1,'D3D12MA']]],
['virtual_5fallocation_5finfo_2',['VIRTUAL_ALLOCATION_INFO',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html',1,'D3D12MA']]],
['virtual_5fblock_5fdesc_3',['VIRTUAL_BLOCK_DESC',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html',1,'D3D12MA']]],
['virtualallocation_4',['VirtualAllocation',['../struct_d3_d12_m_a_1_1_virtual_allocation.html',1,'D3D12MA']]],
['virtualblock_5',['VirtualBlock',['../class_d3_d12_m_a_1_1_virtual_block.html',1,'D3D12MA']]]
['virtual_5fallocation_5fflag_5fnone_2',['VIRTUAL_ALLOCATION_FLAG_NONE',['../namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a03576295004dec9dc8f99a895d232027',1,'D3D12MA']]],
['virtual_5fallocation_5fflag_5fupper_5faddress_3',['VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS',['../namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a86beebcb80a1a10cb5525e2c9ed1435e',1,'D3D12MA']]],
['virtual_5fallocation_5fflags_4',['VIRTUAL_ALLOCATION_FLAGS',['../namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72',1,'D3D12MA']]],
['virtual_5fallocation_5finfo_5',['VIRTUAL_ALLOCATION_INFO',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html',1,'D3D12MA']]],
['virtual_5fblock_5fdesc_6',['VIRTUAL_BLOCK_DESC',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html',1,'D3D12MA']]],
['virtual_5fblock_5fflag_5falgorithm_5flinear_7',['VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d',1,'D3D12MA']]],
['virtual_5fblock_5fflag_5falgorithm_5fmask_8',['VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085da0fee243cbf2902a68123ac85caa21e3e',1,'D3D12MA']]],
['virtual_5fblock_5fflag_5falgorithm_5ftlsf_9',['VIRTUAL_BLOCK_FLAG_ALGORITHM_TLSF',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dab6eea831fa737a4160a81d9c0b2cf3cf',1,'D3D12MA']]],
['virtual_5fblock_5fflag_5fnone_10',['VIRTUAL_BLOCK_FLAG_NONE',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dafc882884f8bacd5cab3087567df8c53d',1,'D3D12MA']]],
['virtual_5fblock_5fflags_11',['VIRTUAL_BLOCK_FLAGS',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d',1,'D3D12MA']]],
['virtualallocation_12',['VirtualAllocation',['../struct_d3_d12_m_a_1_1_virtual_allocation.html',1,'D3D12MA']]],
['virtualblock_13',['VirtualBlock',['../class_d3_d12_m_a_1_1_virtual_block.html',1,'D3D12MA']]]
];

View File

@ -1,6 +1,6 @@
var searchData=
[
['flags_0',['Flags',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a92dec49b788a334fc91c55340dfbace6',1,'D3D12MA::ALLOCATION_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ad8abad7c80ea0d8df27c85243ce720f3',1,'D3D12MA::ALLOCATOR_DESC::Flags()']]],
['flags_0',['Flags',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a92dec49b788a334fc91c55340dfbace6',1,'D3D12MA::ALLOCATION_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4',1,'D3D12MA::POOL_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ad8abad7c80ea0d8df27c85243ce720f3',1,'D3D12MA::ALLOCATOR_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a1c887a732b4db0c68a07902462e0732b',1,'D3D12MA::VIRTUAL_BLOCK_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab848f8ad39b5bf8a7c8c077e113e7fc9',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::Flags()']]],
['free_5ffunc_5fptr_1',['FREE_FUNC_PTR',['../namespace_d3_d12_m_a.html#a6a68d0d4ed318abe8f5496d27d6caff7',1,'D3D12MA']]],
['freeallocation_2',['FreeAllocation',['../class_d3_d12_m_a_1_1_virtual_block.html#aab44e46bd122054c894fc84740f1e8fb',1,'D3D12MA::VirtualBlock']]],
['freestatsstring_3',['FreeStatsString',['../class_d3_d12_m_a_1_1_allocator.html#a8392663494384c16d8bfa12b827b4f9c',1,'D3D12MA::Allocator::FreeStatsString()'],['../class_d3_d12_m_a_1_1_virtual_block.html#a6f78ddaa7da194e239089e52093e68a9',1,'D3D12MA::VirtualBlock::FreeStatsString()']]]

View File

@ -1,4 +1,5 @@
var searchData=
[
['list_0',['list',['../class_d3_d12_m_a_1_1_allocation.html#ab1f59d849add2cdbfbebf4eb98db5c97',1,'D3D12MA::Allocation']]]
['linear_20allocation_20algorithm_0',['Linear allocation algorithm',['../linear_algorithm.html',1,'index']]],
['list_1',['list',['../class_d3_d12_m_a_1_1_allocation.html#ab1f59d849add2cdbfbebf4eb98db5c97',1,'D3D12MA::Allocation']]]
];

View File

@ -1,4 +1,4 @@
var searchData=
[
['offset_0',['offset',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a2e0856b5cd556fef0d66c766ac750928',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO']]]
['offset_0',['Offset',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#aa125871ef3fcc8af81fc831cd386dc2e',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO']]]
];

View File

@ -7,8 +7,13 @@ var searchData=
['pfree_4',['pFree',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html#a114e6c4d63d6b020e01f526a975d6849',1,'D3D12MA::ALLOCATION_CALLBACKS']]],
['pool_5',['Pool',['../class_d3_d12_m_a_1_1_pool.html',1,'D3D12MA']]],
['pool_5fdesc_6',['POOL_DESC',['../struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html',1,'D3D12MA']]],
['pprotectedsession_7',['pProtectedSession',['../struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a475840ec05c19732c8d5aa8bb27270f4',1,'D3D12MA::POOL_DESC']]],
['preferredblocksize_8',['PreferredBlockSize',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#a97149c9559deae943c2cfa49aeeff8a6',1,'D3D12MA::ALLOCATOR_DESC']]],
['prev_9',['prev',['../class_d3_d12_m_a_1_1_allocation.html#adc3ac89758a915a409e047f9b89aa160',1,'D3D12MA::Allocation']]],
['puserdata_10',['pUserData',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html#af75391788c1241a06bb0de792c02c335',1,'D3D12MA::ALLOCATION_CALLBACKS::pUserData()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab8ec8dd20b4b9dc2aaa79d7da024170b',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::pUserData()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a4b23ad296ab6cd425fb3b6c83c13b4ff',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO::pUserData()']]]
['pool_5fflag_5falgorithm_5flinear_7',['POOL_FLAG_ALGORITHM_LINEAR',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a',1,'D3D12MA']]],
['pool_5fflag_5falgorithm_5fmask_8',['POOL_FLAG_ALGORITHM_MASK',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aec9d4939b8cc5438545b9df840b5f5f7',1,'D3D12MA']]],
['pool_5fflag_5falgorithm_5ftlsf_9',['POOL_FLAG_ALGORITHM_TLSF',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a0dbdb7cee4b4e381851275aa5ca2164a',1,'D3D12MA']]],
['pool_5fflag_5fnone_10',['POOL_FLAG_NONE',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02',1,'D3D12MA']]],
['pool_5fflags_11',['POOL_FLAGS',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1',1,'D3D12MA']]],
['pprotectedsession_12',['pProtectedSession',['../struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a475840ec05c19732c8d5aa8bb27270f4',1,'D3D12MA::POOL_DESC']]],
['preferredblocksize_13',['PreferredBlockSize',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#a97149c9559deae943c2cfa49aeeff8a6',1,'D3D12MA::ALLOCATOR_DESC']]],
['prev_14',['prev',['../class_d3_d12_m_a_1_1_allocation.html#adc3ac89758a915a409e047f9b89aa160',1,'D3D12MA::Allocation']]],
['puserdata_15',['pUserData',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html#af75391788c1241a06bb0de792c02c335',1,'D3D12MA::ALLOCATION_CALLBACKS::pUserData()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab8ec8dd20b4b9dc2aaa79d7da024170b',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::pUserData()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a4b23ad296ab6cd425fb3b6c83c13b4ff',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO::pUserData()']]]
];

View File

@ -0,0 +1,37 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="enums_1.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
createResults();
/* @license-end */
</script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
window.addEventListener("message", function(event) {
if (event.data == "take_focus") {
var elem = searchResults.NavNext(0);
if (elem) elem.focus();
}
});
/* @license-end */
</script>
</div>
</body>
</html>

View File

@ -0,0 +1,4 @@
var searchData=
[
['pool_5fflags_0',['POOL_FLAGS',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1',1,'D3D12MA']]]
];

View File

@ -0,0 +1,37 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="enums_2.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
createResults();
/* @license-end */
</script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
window.addEventListener("message", function(event) {
if (event.data == "take_focus") {
var elem = searchResults.NavNext(0);
if (elem) elem.focus();
}
});
/* @license-end */
</script>
</div>
</body>
</html>

View File

@ -0,0 +1,5 @@
var searchData=
[
['virtual_5fallocation_5fflags_0',['VIRTUAL_ALLOCATION_FLAGS',['../namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72',1,'D3D12MA']]],
['virtual_5fblock_5fflags_1',['VIRTUAL_BLOCK_FLAGS',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d',1,'D3D12MA']]]
];

View File

@ -3,8 +3,9 @@ var searchData=
['allocation_5fflag_5fcommitted_0',['ALLOCATION_FLAG_COMMITTED',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea661a5472dba3dcecc5a2cc92afd25675',1,'D3D12MA']]],
['allocation_5fflag_5fnever_5fallocate_1',['ALLOCATION_FLAG_NEVER_ALLOCATE',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea9a52c6ae694eadcd20896091e77c0628',1,'D3D12MA']]],
['allocation_5fflag_5fnone_2',['ALLOCATION_FLAG_NONE',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645ea0bf578b096d6ea73cea86b031541733e',1,'D3D12MA']]],
['allocation_5fflag_5fwithin_5fbudget_3',['ALLOCATION_FLAG_WITHIN_BUDGET',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6',1,'D3D12MA']]],
['allocator_5fflag_5falways_5fcommitted_4',['ALLOCATOR_FLAG_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb',1,'D3D12MA']]],
['allocator_5fflag_5fnone_5',['ALLOCATOR_FLAG_NONE',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f',1,'D3D12MA']]],
['allocator_5fflag_5fsinglethreaded_6',['ALLOCATOR_FLAG_SINGLETHREADED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52',1,'D3D12MA']]]
['allocation_5fflag_5fupper_5faddress_3',['ALLOCATION_FLAG_UPPER_ADDRESS',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eafb0e2dacce691336e717550a1df72474',1,'D3D12MA']]],
['allocation_5fflag_5fwithin_5fbudget_4',['ALLOCATION_FLAG_WITHIN_BUDGET',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6',1,'D3D12MA']]],
['allocator_5fflag_5falways_5fcommitted_5',['ALLOCATOR_FLAG_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb',1,'D3D12MA']]],
['allocator_5fflag_5fnone_6',['ALLOCATOR_FLAG_NONE',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f',1,'D3D12MA']]],
['allocator_5fflag_5fsinglethreaded_7',['ALLOCATOR_FLAG_SINGLETHREADED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52',1,'D3D12MA']]]
];

View File

@ -0,0 +1,37 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="enumvalues_1.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
createResults();
/* @license-end */
</script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
window.addEventListener("message", function(event) {
if (event.data == "take_focus") {
var elem = searchResults.NavNext(0);
if (elem) elem.focus();
}
});
/* @license-end */
</script>
</div>
</body>
</html>

View File

@ -0,0 +1,7 @@
var searchData=
[
['pool_5fflag_5falgorithm_5flinear_0',['POOL_FLAG_ALGORITHM_LINEAR',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a',1,'D3D12MA']]],
['pool_5fflag_5falgorithm_5fmask_1',['POOL_FLAG_ALGORITHM_MASK',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aec9d4939b8cc5438545b9df840b5f5f7',1,'D3D12MA']]],
['pool_5fflag_5falgorithm_5ftlsf_2',['POOL_FLAG_ALGORITHM_TLSF',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a0dbdb7cee4b4e381851275aa5ca2164a',1,'D3D12MA']]],
['pool_5fflag_5fnone_3',['POOL_FLAG_NONE',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02',1,'D3D12MA']]]
];

View File

@ -0,0 +1,37 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="enumvalues_2.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
createResults();
/* @license-end */
</script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
window.addEventListener("message", function(event) {
if (event.data == "take_focus") {
var elem = searchResults.NavNext(0);
if (elem) elem.focus();
}
});
/* @license-end */
</script>
</div>
</body>
</html>

View File

@ -0,0 +1,9 @@
var searchData=
[
['virtual_5fallocation_5fflag_5fnone_0',['VIRTUAL_ALLOCATION_FLAG_NONE',['../namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a03576295004dec9dc8f99a895d232027',1,'D3D12MA']]],
['virtual_5fallocation_5fflag_5fupper_5faddress_1',['VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS',['../namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72a86beebcb80a1a10cb5525e2c9ed1435e',1,'D3D12MA']]],
['virtual_5fblock_5fflag_5falgorithm_5flinear_2',['VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d',1,'D3D12MA']]],
['virtual_5fblock_5fflag_5falgorithm_5fmask_3',['VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085da0fee243cbf2902a68123ac85caa21e3e',1,'D3D12MA']]],
['virtual_5fblock_5fflag_5falgorithm_5ftlsf_4',['VIRTUAL_BLOCK_FLAG_ALGORITHM_TLSF',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dab6eea831fa737a4160a81d9c0b2cf3cf',1,'D3D12MA']]],
['virtual_5fblock_5fflag_5fnone_5',['VIRTUAL_BLOCK_FLAG_NONE',['../namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dafc882884f8bacd5cab3087567df8c53d',1,'D3D12MA']]]
];

View File

@ -1,4 +1,4 @@
var searchData=
[
['quick_20start_0',['Quick start',['../quick_start.html',1,'index']]]
['linear_20allocation_20algorithm_0',['Linear allocation algorithm',['../linear_algorithm.html',1,'index']]]
];

View File

@ -1,4 +1,4 @@
var searchData=
[
['resource_20aliasing_20_28overlap_29_0',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
['quick_20start_0',['Quick start',['../quick_start.html',1,'index']]]
];

View File

@ -1,4 +1,4 @@
var searchData=
[
['virtual_20allocator_0',['Virtual allocator',['../virtual_allocator.html',1,'index']]]
['resource_20aliasing_20_28overlap_29_0',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]]
];

View File

@ -0,0 +1,37 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="pages_6.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
createResults();
/* @license-end */
</script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
window.addEventListener("message", function(event) {
if (event.data == "take_focus") {
var elem = searchResults.NavNext(0);
if (elem) elem.focus();
}
});
/* @license-end */
</script>
</div>
</body>
</html>

View File

@ -0,0 +1,4 @@
var searchData=
[
['virtual_20allocator_0',['Virtual allocator',['../virtual_allocator.html',1,'index']]]
];

View File

@ -7,11 +7,11 @@ var indexSectionsWithContent =
4: "abcfgisw",
5: "abcefhlmnopstu",
6: "af",
7: "a",
8: "a",
7: "apv",
8: "apv",
9: "cd",
10: "d",
11: "cdgqrv"
11: "cdglqrv"
};
var indexSectionNames =

View File

@ -1,4 +1,4 @@
var searchData=
[
['flags_0',['Flags',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a92dec49b788a334fc91c55340dfbace6',1,'D3D12MA::ALLOCATION_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ad8abad7c80ea0d8df27c85243ce720f3',1,'D3D12MA::ALLOCATOR_DESC::Flags()']]]
['flags_0',['Flags',['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a92dec49b788a334fc91c55340dfbace6',1,'D3D12MA::ALLOCATION_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4',1,'D3D12MA::POOL_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ad8abad7c80ea0d8df27c85243ce720f3',1,'D3D12MA::ALLOCATOR_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a1c887a732b4db0c68a07902462e0732b',1,'D3D12MA::VIRTUAL_BLOCK_DESC::Flags()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab848f8ad39b5bf8a7c8c077e113e7fc9',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::Flags()']]]
];

View File

@ -1,4 +1,4 @@
var searchData=
[
['offset_0',['offset',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a2e0856b5cd556fef0d66c766ac750928',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO']]]
['offset_0',['Offset',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#aa125871ef3fcc8af81fc831cd386dc2e',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO']]]
];

View File

@ -1,5 +1,4 @@
var searchData=
[
['size_0',['Size',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4',1,'D3D12MA::VIRTUAL_BLOCK_DESC::Size()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::Size()']]],
['size_1',['size',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ab8ede12141594a69230afeb34664fc34',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO']]]
['size_0',['Size',['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4',1,'D3D12MA::VIRTUAL_BLOCK_DESC::Size()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::Size()'],['../struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ac265159500190e35ebef8e4784c73a09',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO::Size()']]]
];

View File

@ -73,12 +73,13 @@ $(function() {
<p>This is the complete list of members for <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#af7284cc51a8ed5b551075584256de23c">BlockSize</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a3795956e4fbfe7c3a23546e02e5d28dc">HeapFlags</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a06e06813bcb5206e9f7a8b0564bf1d6a">HeapProperties</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#abbce3a99f253928f9c3c09fa16015f9e">MaxBlockCount</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a0a6283eeb1f3f99d8c4ae264aec7f749">MinAllocationAlignment</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a6f10db3911a3bea1becfc9a0dfa5bac8">MinBlockCount</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a475840ec05c19732c8d5aa8bb27270f4">pProtectedSession</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4">Flags</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a3795956e4fbfe7c3a23546e02e5d28dc">HeapFlags</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a06e06813bcb5206e9f7a8b0564bf1d6a">HeapProperties</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#abbce3a99f253928f9c3c09fa16015f9e">MaxBlockCount</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a0a6283eeb1f3f99d8c4ae264aec7f749">MinAllocationAlignment</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a6f10db3911a3bea1becfc9a0dfa5bac8">MinBlockCount</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a475840ec05c19732c8d5aa8bb27270f4">pProtectedSession</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">D3D12MA::POOL_DESC</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View File

@ -80,6 +80,9 @@ $(function() {
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ac4ed93b0191344d68c0b4ac1a4822ff4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1">POOL_FLAGS</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4">Flags</a></td></tr>
<tr class="memdesc:ac4ed93b0191344d68c0b4ac1a4822ff4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flags. <a href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4">More...</a><br /></td></tr>
<tr class="separator:ac4ed93b0191344d68c0b4ac1a4822ff4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06e06813bcb5206e9f7a8b0564bf1d6a"><td class="memItemLeft" align="right" valign="top">D3D12_HEAP_PROPERTIES&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a06e06813bcb5206e9f7a8b0564bf1d6a">HeapProperties</a></td></tr>
<tr class="memdesc:a06e06813bcb5206e9f7a8b0564bf1d6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">The parameters of memory heap where allocations of this pool should be placed. <a href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a06e06813bcb5206e9f7a8b0564bf1d6a">More...</a><br /></td></tr>
<tr class="separator:a06e06813bcb5206e9f7a8b0564bf1d6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
@ -120,6 +123,22 @@ Public Attributes</h2></td></tr>
<p>Size of a single heap (memory block) to be allocated as part of this pool, in bytes. Optional. </p>
<p >Specify nonzero to set explicit, constant size of memory blocks used by this pool. Leave 0 to use default and let the library manage block sizes automatically. Then sizes of particular blocks may vary. </p>
</div>
</div>
<a id="ac4ed93b0191344d68c0b4ac1a4822ff4" name="ac4ed93b0191344d68c0b4ac1a4822ff4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4ed93b0191344d68c0b4ac1a4822ff4">&#9670;&nbsp;</a></span>Flags</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1">POOL_FLAGS</a> D3D12MA::POOL_DESC::Flags</td>
</tr>
</table>
</div><div class="memdoc">
<p>Flags. </p>
</div>
</div>
<a id="a3795956e4fbfe7c3a23546e02e5d28dc" name="a3795956e4fbfe7c3a23546e02e5d28dc"></a>

View File

@ -73,8 +73,9 @@ $(function() {
<p>This is the complete list of members for <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#aaa95e62f2f399339a09dcbb312a42de0">Alignment</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab8ec8dd20b4b9dc2aaa79d7da024170b">pUserData</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">Size</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab848f8ad39b5bf8a7c8c077e113e7fc9">Flags</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab8ec8dd20b4b9dc2aaa79d7da024170b">pUserData</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">Size</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View File

@ -80,6 +80,9 @@ $(function() {
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ab848f8ad39b5bf8a7c8c077e113e7fc9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72">VIRTUAL_ALLOCATION_FLAGS</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab848f8ad39b5bf8a7c8c077e113e7fc9">Flags</a></td></tr>
<tr class="memdesc:ab848f8ad39b5bf8a7c8c077e113e7fc9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flags. <a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab848f8ad39b5bf8a7c8c077e113e7fc9">More...</a><br /></td></tr>
<tr class="separator:ab848f8ad39b5bf8a7c8c077e113e7fc9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a976b649e45abdd0769da0d79acde4bac"><td class="memItemLeft" align="right" valign="top">UINT64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">Size</a></td></tr>
<tr class="memdesc:a976b649e45abdd0769da0d79acde4bac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the allocation. <a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">More...</a><br /></td></tr>
<tr class="separator:a976b649e45abdd0769da0d79acde4bac"><td class="memSeparator" colspan="2">&#160;</td></tr>
@ -108,6 +111,22 @@ Public Attributes</h2></td></tr>
<p>Required alignment of the allocation. </p>
<p >Must be power of two. Special value 0 has the same meaning as 1 - means no special alignment is required, so allocation can start at any offset. </p>
</div>
</div>
<a id="ab848f8ad39b5bf8a7c8c077e113e7fc9" name="ab848f8ad39b5bf8a7c8c077e113e7fc9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab848f8ad39b5bf8a7c8c077e113e7fc9">&#9670;&nbsp;</a></span>Flags</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespace_d3_d12_m_a.html#a7e4152ccaf661f5398b24a23cbe9ae72">VIRTUAL_ALLOCATION_FLAGS</a> D3D12MA::VIRTUAL_ALLOCATION_DESC::Flags</td>
</tr>
</table>
</div><div class="memdoc">
<p>Flags. </p>
</div>
</div>
<a id="ab8ec8dd20b4b9dc2aaa79d7da024170b" name="ab8ec8dd20b4b9dc2aaa79d7da024170b"></a>

View File

@ -72,9 +72,9 @@ $(function() {
<p>This is the complete list of members for <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html">D3D12MA::VIRTUAL_ALLOCATION_INFO</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a2e0856b5cd556fef0d66c766ac750928">offset</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#aa125871ef3fcc8af81fc831cd386dc2e">Offset</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a4b23ad296ab6cd425fb3b6c83c13b4ff">pUserData</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ab8ede12141594a69230afeb34664fc34">size</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ac265159500190e35ebef8e4784c73a09">Size</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html">D3D12MA::VIRTUAL_ALLOCATION_INFO</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View File

@ -80,12 +80,12 @@ $(function() {
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a2e0856b5cd556fef0d66c766ac750928"><td class="memItemLeft" align="right" valign="top">UINT64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a2e0856b5cd556fef0d66c766ac750928">offset</a></td></tr>
<tr class="memdesc:a2e0856b5cd556fef0d66c766ac750928"><td class="mdescLeft">&#160;</td><td class="mdescRight">Offset of the allocation. <a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a2e0856b5cd556fef0d66c766ac750928">More...</a><br /></td></tr>
<tr class="separator:a2e0856b5cd556fef0d66c766ac750928"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8ede12141594a69230afeb34664fc34"><td class="memItemLeft" align="right" valign="top">UINT64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ab8ede12141594a69230afeb34664fc34">size</a></td></tr>
<tr class="memdesc:ab8ede12141594a69230afeb34664fc34"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the allocation. <a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ab8ede12141594a69230afeb34664fc34">More...</a><br /></td></tr>
<tr class="separator:ab8ede12141594a69230afeb34664fc34"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa125871ef3fcc8af81fc831cd386dc2e"><td class="memItemLeft" align="right" valign="top">UINT64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#aa125871ef3fcc8af81fc831cd386dc2e">Offset</a></td></tr>
<tr class="memdesc:aa125871ef3fcc8af81fc831cd386dc2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Offset of the allocation. <a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#aa125871ef3fcc8af81fc831cd386dc2e">More...</a><br /></td></tr>
<tr class="separator:aa125871ef3fcc8af81fc831cd386dc2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac265159500190e35ebef8e4784c73a09"><td class="memItemLeft" align="right" valign="top">UINT64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ac265159500190e35ebef8e4784c73a09">Size</a></td></tr>
<tr class="memdesc:ac265159500190e35ebef8e4784c73a09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the allocation. <a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#ac265159500190e35ebef8e4784c73a09">More...</a><br /></td></tr>
<tr class="separator:ac265159500190e35ebef8e4784c73a09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b23ad296ab6cd425fb3b6c83c13b4ff"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a4b23ad296ab6cd425fb3b6c83c13b4ff">pUserData</a></td></tr>
<tr class="memdesc:a4b23ad296ab6cd425fb3b6c83c13b4ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Custom pointer associated with the allocation. <a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#a4b23ad296ab6cd425fb3b6c83c13b4ff">More...</a><br /></td></tr>
<tr class="separator:a4b23ad296ab6cd425fb3b6c83c13b4ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
@ -93,14 +93,14 @@ Public Attributes</h2></td></tr>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Parameters of an existing virtual allocation, returned by <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#ac605dce05ca0d411e46079f0bad765d1" title="Returns information about an allocation - its offset, size and custom pointer.">VirtualBlock::GetAllocationInfo()</a>. </p>
</div><h2 class="groupheader">Member Data Documentation</h2>
<a id="a2e0856b5cd556fef0d66c766ac750928" name="a2e0856b5cd556fef0d66c766ac750928"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e0856b5cd556fef0d66c766ac750928">&#9670;&nbsp;</a></span>offset</h2>
<a id="aa125871ef3fcc8af81fc831cd386dc2e" name="aa125871ef3fcc8af81fc831cd386dc2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa125871ef3fcc8af81fc831cd386dc2e">&#9670;&nbsp;</a></span>Offset</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">UINT64 D3D12MA::VIRTUAL_ALLOCATION_INFO::offset</td>
<td class="memname">UINT64 D3D12MA::VIRTUAL_ALLOCATION_INFO::Offset</td>
</tr>
</table>
</div><div class="memdoc">
@ -126,14 +126,14 @@ Public Attributes</h2></td></tr>
</div>
</div>
<a id="ab8ede12141594a69230afeb34664fc34" name="ab8ede12141594a69230afeb34664fc34"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8ede12141594a69230afeb34664fc34">&#9670;&nbsp;</a></span>size</h2>
<a id="ac265159500190e35ebef8e4784c73a09" name="ac265159500190e35ebef8e4784c73a09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac265159500190e35ebef8e4784c73a09">&#9670;&nbsp;</a></span>Size</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">UINT64 D3D12MA::VIRTUAL_ALLOCATION_INFO::size</td>
<td class="memname">UINT64 D3D12MA::VIRTUAL_ALLOCATION_INFO::Size</td>
</tr>
</table>
</div><div class="memdoc">

View File

@ -72,8 +72,9 @@ $(function() {
<p>This is the complete list of members for <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html">D3D12MA::VIRTUAL_BLOCK_DESC</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#aa8ea08ad0ee64cb2d29c03b85008317f">pAllocationCallbacks</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html">D3D12MA::VIRTUAL_BLOCK_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">Size</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html">D3D12MA::VIRTUAL_BLOCK_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a1c887a732b4db0c68a07902462e0732b">Flags</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html">D3D12MA::VIRTUAL_BLOCK_DESC</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#aa8ea08ad0ee64cb2d29c03b85008317f">pAllocationCallbacks</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html">D3D12MA::VIRTUAL_BLOCK_DESC</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">Size</a></td><td class="entry"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html">D3D12MA::VIRTUAL_BLOCK_DESC</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View File

@ -80,6 +80,9 @@ $(function() {
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a1c887a732b4db0c68a07902462e0732b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d">VIRTUAL_BLOCK_FLAGS</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a1c887a732b4db0c68a07902462e0732b">Flags</a></td></tr>
<tr class="memdesc:a1c887a732b4db0c68a07902462e0732b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flags. <a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a1c887a732b4db0c68a07902462e0732b">More...</a><br /></td></tr>
<tr class="separator:a1c887a732b4db0c68a07902462e0732b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac56491679f276a5a9956ed99bc4654e4"><td class="memItemLeft" align="right" valign="top">UINT64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">Size</a></td></tr>
<tr class="memdesc:ac56491679f276a5a9956ed99bc4654e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Total size of the block. <a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">More...</a><br /></td></tr>
<tr class="separator:ac56491679f276a5a9956ed99bc4654e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
@ -90,6 +93,22 @@ Public Attributes</h2></td></tr>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Parameters of created <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html" title="Represents pure allocation algorithm and a data structure with allocations in some memory block,...">D3D12MA::VirtualBlock</a> object to be passed to <a class="el" href="namespace_d3_d12_m_a.html#ab024647ae85ee63e2fa2c1c4beac6d98" title="Creates new D3D12MA::VirtualBlock object and returns it through ppVirtualBlock.">CreateVirtualBlock()</a>. </p>
</div><h2 class="groupheader">Member Data Documentation</h2>
<a id="a1c887a732b4db0c68a07902462e0732b" name="a1c887a732b4db0c68a07902462e0732b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c887a732b4db0c68a07902462e0732b">&#9670;&nbsp;</a></span>Flags</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085d">VIRTUAL_BLOCK_FLAGS</a> D3D12MA::VIRTUAL_BLOCK_DESC::Flags</td>
</tr>
</table>
</div><div class="memdoc">
<p>Flags. </p>
</div>
</div>
<a id="aa8ea08ad0ee64cb2d29c03b85008317f" name="aa8ea08ad0ee64cb2d29c03b85008317f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8ea08ad0ee64cb2d29c03b85008317f">&#9670;&nbsp;</a></span>pAllocationCallbacks</h2>

View File

@ -81,7 +81,7 @@ $(function() {
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a5d3166cf1f284fbbea4d0b169c4dba13"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespace_d3_d12_m_a.html#a15e349adce86a40e0417d405aef1af80">AllocHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_d3_d12_m_a_1_1_virtual_allocation.html#a5d3166cf1f284fbbea4d0b169c4dba13">AllocHandle</a></td></tr>
<tr class="memdesc:a5d3166cf1f284fbbea4d0b169c4dba13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unique idenitfier of current allocation. <a href="struct_d3_d12_m_a_1_1_virtual_allocation.html#a5d3166cf1f284fbbea4d0b169c4dba13">More...</a><br /></td></tr>
<tr class="memdesc:a5d3166cf1f284fbbea4d0b169c4dba13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unique idenitfier of current allocation. 0 means null/invalid. <a href="struct_d3_d12_m_a_1_1_virtual_allocation.html#a5d3166cf1f284fbbea4d0b169c4dba13">More...</a><br /></td></tr>
<tr class="separator:a5d3166cf1f284fbbea4d0b169c4dba13"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
@ -99,7 +99,7 @@ Public Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Unique idenitfier of current allocation. </p>
<p>Unique idenitfier of current allocation. 0 means null/invalid. </p>
</div>
</div>

View File

@ -83,24 +83,25 @@ Creating virtual block</h1>
<div class="line"> </div>
<div class="line"><a class="code hl_class" href="class_d3_d12_m_a_1_1_virtual_block.html">D3D12MA::VirtualBlock</a> *block;</div>
<div class="line">HRESULT hr = <a class="code hl_function" href="namespace_d3_d12_m_a.html#ab024647ae85ee63e2fa2c1c4beac6d98">CreateVirtualBlock</a>(&amp;blockDesc, &amp;block);</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_virtual_block_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_virtual_block.html">D3D12MA::VirtualBlock</a></div><div class="ttdoc">Represents pure allocation algorithm and a data structure with allocations in some memory block,...</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:941</div></div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_virtual_block_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_virtual_block.html">D3D12MA::VirtualBlock</a></div><div class="ttdoc">Represents pure allocation algorithm and a data structure with allocations in some memory block,...</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:1038</div></div>
<div class="ttc" id="anamespace_d3_d12_m_a_html_ab024647ae85ee63e2fa2c1c4beac6d98"><div class="ttname"><a href="namespace_d3_d12_m_a.html#ab024647ae85ee63e2fa2c1c4beac6d98">D3D12MA::CreateVirtualBlock</a></div><div class="ttdeci">D3D12MA_API HRESULT CreateVirtualBlock(const VIRTUAL_BLOCK_DESC *pDesc, VirtualBlock **ppVirtualBlock)</div><div class="ttdoc">Creates new D3D12MA::VirtualBlock object and returns it through ppVirtualBlock.</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html">D3D12MA::VIRTUAL_BLOCK_DESC</a></div><div class="ttdoc">Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock().</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:878</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c_html_ac56491679f276a5a9956ed99bc4654e4"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">D3D12MA::VIRTUAL_BLOCK_DESC::Size</a></div><div class="ttdeci">UINT64 Size</div><div class="ttdoc">Total size of the block.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:884</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html">D3D12MA::VIRTUAL_BLOCK_DESC</a></div><div class="ttdoc">Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock().</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:958</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c_html_ac56491679f276a5a9956ed99bc4654e4"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4">D3D12MA::VIRTUAL_BLOCK_DESC::Size</a></div><div class="ttdeci">UINT64 Size</div><div class="ttdoc">Total size of the block.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:966</div></div>
</div><!-- fragment --><h1><a class="anchor" id="virtual_allocator_making_virtual_allocations"></a>
Making virtual allocations</h1>
<p ><a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html" title="Represents pure allocation algorithm and a data structure with allocations in some memory block,...">D3D12MA::VirtualBlock</a> object contains internal data structure that keeps track of free and occupied regions using the same code as the main D3D12 memory allocator. However, there is no "virtual allocation" object. When you request a new allocation, a <code>UINT64</code> number is returned. It is an offset inside the block where the allocation has been placed, but it also uniquely identifies the allocation within this block.</p>
<p ><a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html" title="Represents pure allocation algorithm and a data structure with allocations in some memory block,...">D3D12MA::VirtualBlock</a> object contains internal data structure that keeps track of free and occupied regions using the same code as the main D3D12 memory allocator. A single allocation is identified by a lightweight structure <a class="el" href="struct_d3_d12_m_a_1_1_virtual_allocation.html" title="Represents single memory allocation done inside VirtualBlock.">D3D12MA::VirtualAllocation</a>. You will also likely want to know the offset at which the allocation was made in the block.</p>
<p >In order to make an allocation:</p>
<ol type="1">
<li>Fill in <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html" title="Parameters of created virtual allocation to be passed to VirtualBlock::Allocate().">D3D12MA::VIRTUAL_ALLOCATION_DESC</a> structure.</li>
<li>Call <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179" title="Creates new allocation.">D3D12MA::VirtualBlock::Allocate</a>. Get new <code>UINT64 offset</code> that identifies the allocation.</li>
<li>Call <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179" title="Creates new allocation.">D3D12MA::VirtualBlock::Allocate</a>. Get new <a class="el" href="struct_d3_d12_m_a_1_1_virtual_allocation.html" title="Represents single memory allocation done inside VirtualBlock.">D3D12MA::VirtualAllocation</a> value that identifies the allocation.</li>
</ol>
<p >Example:</p>
<div class="fragment"><div class="line"><a class="code hl_struct" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a> allocDesc = {};</div>
<div class="line">allocDesc.<a class="code hl_variable" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">Size</a> = 4096; <span class="comment">// 4 KB</span></div>
<div class="line"> </div>
<div class="line"><a class="code hl_struct" href="struct_d3_d12_m_a_1_1_virtual_allocation.html">D3D12MA::VirtualAllocation</a> alloc;</div>
<div class="line">UINT64 allocOffset;</div>
<div class="line">hr = block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179">Allocate</a>(&amp;allocDesc, &amp;allocOffset);</div>
<div class="line">hr = block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179">Allocate</a>(&amp;allocDesc, &amp;alloc, &amp;allocOffset);</div>
<div class="line"><span class="keywordflow">if</span>(SUCCEEDED(hr))</div>
<div class="line">{</div>
<div class="line"> <span class="comment">// Use the 4 KB of your memory starting at allocOffset.</span></div>
@ -110,13 +111,15 @@ Making virtual allocations</h1>
<div class="line"> <span class="comment">// Allocation failed - no space for it could be found. Handle this error!</span></div>
<div class="line">}</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_virtual_block_html_a9281daf76e888ea1bd5247d5732e8179"><div class="ttname"><a href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179">D3D12MA::VirtualBlock::Allocate</a></div><div class="ttdeci">HRESULT Allocate(const VIRTUAL_ALLOCATION_DESC *pDesc, VirtualAllocation *pAllocation, UINT64 *pOffset)</div><div class="ttdoc">Creates new allocation.</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></div><div class="ttdoc">Parameters of created virtual allocation to be passed to VirtualBlock::Allocate().</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:894</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_a976b649e45abdd0769da0d79acde4bac"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">D3D12MA::VIRTUAL_ALLOCATION_DESC::Size</a></div><div class="ttdeci">UINT64 Size</div><div class="ttdoc">Size of the allocation.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:899</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::VIRTUAL_ALLOCATION_DESC</a></div><div class="ttdoc">Parameters of created virtual allocation to be passed to VirtualBlock::Allocate().</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:989</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_a976b649e45abdd0769da0d79acde4bac"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">D3D12MA::VIRTUAL_ALLOCATION_DESC::Size</a></div><div class="ttdeci">UINT64 Size</div><div class="ttdoc">Size of the allocation.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:996</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_virtual_allocation_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_virtual_allocation.html">D3D12MA::VirtualAllocation</a></div><div class="ttdoc">Represents single memory allocation done inside VirtualBlock.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:265</div></div>
</div><!-- fragment --><h1><a class="anchor" id="virtual_allocator_deallocation"></a>
Deallocation</h1>
<p >When no longer needed, an allocation can be freed by calling <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#aab44e46bd122054c894fc84740f1e8fb" title="Frees the allocation.">D3D12MA::VirtualBlock::FreeAllocation</a>. You can only pass to this function the exact offset that was previously returned by <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179" title="Creates new allocation.">D3D12MA::VirtualBlock::Allocate</a> and not any other location within the memory.</p>
<p >When whole block is no longer needed, the block object can be released by calling D3D12MA::VirtualBlock::Release. All allocations must be freed before the block is destroyed, which is checked internally by an assert. However, if you don't want to call <code>block-&gt;FreeAllocation</code> for each allocation, you can use <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#ae22b18c0b7c31b44c1d740f886369189" title="Frees all the allocations.">D3D12MA::VirtualBlock::Clear</a> to free them all at once - a feature not available in normal D3D12 memory allocator. Example:</p>
<div class="fragment"><div class="line">block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#aab44e46bd122054c894fc84740f1e8fb">FreeAllocation</a>(allocOffset);</div>
<p >When no longer needed, an allocation can be freed by calling <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#aab44e46bd122054c894fc84740f1e8fb" title="Frees the allocation.">D3D12MA::VirtualBlock::FreeAllocation</a>.</p>
<p >When whole block is no longer needed, the block object can be released by calling <code>block-&gt;Release()</code>. All allocations must be freed before the block is destroyed, which is checked internally by an assert. However, if you don't want to call <code>block-&gt;FreeAllocation</code> for each allocation, you can use <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#ae22b18c0b7c31b44c1d740f886369189" title="Frees all the allocations.">D3D12MA::VirtualBlock::Clear</a> to free them all at once - a feature not available in normal D3D12 memory allocator.</p>
<p >Example:</p>
<div class="fragment"><div class="line">block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#aab44e46bd122054c894fc84740f1e8fb">FreeAllocation</a>(alloc);</div>
<div class="line">block-&gt;Release();</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_virtual_block_html_aab44e46bd122054c894fc84740f1e8fb"><div class="ttname"><a href="class_d3_d12_m_a_1_1_virtual_block.html#aab44e46bd122054c894fc84740f1e8fb">D3D12MA::VirtualBlock::FreeAllocation</a></div><div class="ttdeci">void FreeAllocation(VirtualAllocation allocation)</div><div class="ttdoc">Frees the allocation.</div></div>
</div><!-- fragment --><h1><a class="anchor" id="virtual_allocator_allocation_parameters"></a>
@ -128,14 +131,14 @@ Allocation parameters</h1>
<div class="line">};</div>
<div class="line">CustomAllocData* allocData = <span class="keyword">new</span> CustomAllocData();</div>
<div class="line">allocData-&gt;m_AllocName = <span class="stringliteral">&quot;My allocation 1&quot;</span>;</div>
<div class="line">block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#a9faeb1ad64ffd04b86a314fe04a8c81d">SetAllocationUserData</a>(allocOffset, allocData);</div>
<div class="line">block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#a9faeb1ad64ffd04b86a314fe04a8c81d">SetAllocationUserData</a>(alloc, allocData);</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_virtual_block_html_a9faeb1ad64ffd04b86a314fe04a8c81d"><div class="ttname"><a href="class_d3_d12_m_a_1_1_virtual_block.html#a9faeb1ad64ffd04b86a314fe04a8c81d">D3D12MA::VirtualBlock::SetAllocationUserData</a></div><div class="ttdeci">void SetAllocationUserData(VirtualAllocation allocation, void *pUserData)</div><div class="ttdoc">Changes custom pointer for an allocation to a new value.</div></div>
</div><!-- fragment --><p >The pointer can later be fetched, along with allocation size, by passing the allocation offset to function <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#ac605dce05ca0d411e46079f0bad765d1" title="Returns information about an allocation - its offset, size and custom pointer.">D3D12MA::VirtualBlock::GetAllocationInfo</a> and inspecting returned structure <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html" title="Parameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo().">D3D12MA::VIRTUAL_ALLOCATION_INFO</a>. If you allocated a new object to be used as the custom pointer, don't forget to delete that object before freeing the allocation! Example:</p>
</div><!-- fragment --><p >The pointer can later be fetched, along with allocation offset and size, by passing the allocation handle to function <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#ac605dce05ca0d411e46079f0bad765d1" title="Returns information about an allocation - its offset, size and custom pointer.">D3D12MA::VirtualBlock::GetAllocationInfo</a> and inspecting returned structure <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html" title="Parameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo().">D3D12MA::VIRTUAL_ALLOCATION_INFO</a>. If you allocated a new object to be used as the custom pointer, don't forget to delete that object before freeing the allocation! Example:</p>
<div class="fragment"><div class="line">VIRTUAL_ALLOCATION_INFO allocInfo;</div>
<div class="line">block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#ac605dce05ca0d411e46079f0bad765d1">GetAllocationInfo</a>(allocOffset, &amp;allocInfo);</div>
<div class="line">block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#ac605dce05ca0d411e46079f0bad765d1">GetAllocationInfo</a>(alloc, &amp;allocInfo);</div>
<div class="line"><span class="keyword">delete</span> (CustomAllocData*)allocInfo.pUserData;</div>
<div class="line"> </div>
<div class="line">block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#aab44e46bd122054c894fc84740f1e8fb">FreeAllocation</a>(allocOffset);</div>
<div class="line">block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#aab44e46bd122054c894fc84740f1e8fb">FreeAllocation</a>(alloc);</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_virtual_block_html_ac605dce05ca0d411e46079f0bad765d1"><div class="ttname"><a href="class_d3_d12_m_a_1_1_virtual_block.html#ac605dce05ca0d411e46079f0bad765d1">D3D12MA::VirtualBlock::GetAllocationInfo</a></div><div class="ttdeci">void GetAllocationInfo(VirtualAllocation allocation, VIRTUAL_ALLOCATION_INFO *pInfo) const</div><div class="ttdoc">Returns information about an allocation - its offset, size and custom pointer.</div></div>
</div><!-- fragment --><h1><a class="anchor" id="virtual_allocator_alignment_and_units"></a>
Alignment and units</h1>
@ -144,14 +147,15 @@ Alignment and units</h1>
<div class="line">allocDesc.<a class="code hl_variable" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac">Size</a> = 4096; <span class="comment">// 4 KB</span></div>
<div class="line">allocDesc.<a class="code hl_variable" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#aaa95e62f2f399339a09dcbb312a42de0">Alignment</a> = 4; <span class="comment">// Returned offset must be a multiply of 4 B</span></div>
<div class="line"> </div>
<div class="line"><a class="code hl_struct" href="struct_d3_d12_m_a_1_1_virtual_allocation.html">D3D12MA::VirtualAllocation</a> alloc;</div>
<div class="line">UINT64 allocOffset;</div>
<div class="line">hr = block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179">Allocate</a>(&amp;allocDesc, &amp;allocOffset);</div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_aaa95e62f2f399339a09dcbb312a42de0"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#aaa95e62f2f399339a09dcbb312a42de0">D3D12MA::VIRTUAL_ALLOCATION_DESC::Alignment</a></div><div class="ttdeci">UINT64 Alignment</div><div class="ttdoc">Required alignment of the allocation.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:904</div></div>
<div class="line">hr = block-&gt;<a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179">Allocate</a>(&amp;allocDesc, &amp;alloc, &amp;allocOffset);</div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c_html_aaa95e62f2f399339a09dcbb312a42de0"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#aaa95e62f2f399339a09dcbb312a42de0">D3D12MA::VIRTUAL_ALLOCATION_DESC::Alignment</a></div><div class="ttdeci">UINT64 Alignment</div><div class="ttdoc">Required alignment of the allocation.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:1001</div></div>
</div><!-- fragment --><p >Alignments of different allocations made from one block may vary. However, if all alignments and sizes are always multiply of some size e.g. 4 B or <code>sizeof(MyDataStruct)</code>, you can express all sizes, alignments, and offsets in multiples of that size instead of individual bytes. It might be more convenient, but you need to make sure to use this new unit consistently in all the places:</p>
<ul>
<li><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#ac56491679f276a5a9956ed99bc4654e4" title="Total size of the block.">D3D12MA::VIRTUAL_BLOCK_DESC::Size</a></li>
<li><a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#a976b649e45abdd0769da0d79acde4bac" title="Size of the allocation.">D3D12MA::VIRTUAL_ALLOCATION_DESC::Size</a> and <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#aaa95e62f2f399339a09dcbb312a42de0" title="Required alignment of the allocation.">D3D12MA::VIRTUAL_ALLOCATION_DESC::Alignment</a></li>
<li>Using offset returned by <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179" title="Creates new allocation.">D3D12MA::VirtualBlock::Allocate</a></li>
<li>Using offset returned by <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179" title="Creates new allocation.">D3D12MA::VirtualBlock::Allocate</a> and <a class="el" href="struct_d3_d12_m_a_1_1_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html#aa125871ef3fcc8af81fc831cd386dc2e" title="Offset of the allocation.">D3D12MA::VIRTUAL_ALLOCATION_INFO::Offset</a></li>
</ul>
<h1><a class="anchor" id="virtual_allocator_statistics"></a>
Statistics</h1>
@ -161,12 +165,13 @@ Statistics</h1>
<div class="line">printf(<span class="stringliteral">&quot;My virtual block has %llu bytes used by %u virtual allocations\n&quot;</span>,</div>
<div class="line"> statInfo.<a class="code hl_variable" href="struct_d3_d12_m_a_1_1_stat_info.html#ac4f3379ea88025e4ccf5880fab2699f7">UsedBytes</a>, statInfo.<a class="code hl_variable" href="struct_d3_d12_m_a_1_1_stat_info.html#a2f50de812e296b71594174ff67bbac6e">AllocationCount</a>);</div>
<div class="ttc" id="aclass_d3_d12_m_a_1_1_virtual_block_html_a039ee8426818d0126cf7f44c1c658526"><div class="ttname"><a href="class_d3_d12_m_a_1_1_virtual_block.html#a039ee8426818d0126cf7f44c1c658526">D3D12MA::VirtualBlock::CalculateStats</a></div><div class="ttdeci">void CalculateStats(StatInfo *pInfo) const</div><div class="ttdoc">Retrieves statistics from the current state of the block.</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_stat_info_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_stat_info.html">D3D12MA::StatInfo</a></div><div class="ttdoc">Calculated statistics of memory usage in entire allocator.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:611</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_stat_info_html_a2f50de812e296b71594174ff67bbac6e"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_stat_info.html#a2f50de812e296b71594174ff67bbac6e">D3D12MA::StatInfo::AllocationCount</a></div><div class="ttdeci">UINT AllocationCount</div><div class="ttdoc">Number of D3D12MA::Allocation objects allocated.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:615</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_stat_info_html_ac4f3379ea88025e4ccf5880fab2699f7"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_stat_info.html#ac4f3379ea88025e4ccf5880fab2699f7">D3D12MA::StatInfo::UsedBytes</a></div><div class="ttdeci">UINT64 UsedBytes</div><div class="ttdoc">Total number of bytes occupied by all allocations.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:619</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_stat_info_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_stat_info.html">D3D12MA::StatInfo</a></div><div class="ttdoc">Calculated statistics of memory usage in entire allocator.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:656</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_stat_info_html_a2f50de812e296b71594174ff67bbac6e"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_stat_info.html#a2f50de812e296b71594174ff67bbac6e">D3D12MA::StatInfo::AllocationCount</a></div><div class="ttdeci">UINT AllocationCount</div><div class="ttdoc">Number of D3D12MA::Allocation objects allocated.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:660</div></div>
<div class="ttc" id="astruct_d3_d12_m_a_1_1_stat_info_html_ac4f3379ea88025e4ccf5880fab2699f7"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_stat_info.html#ac4f3379ea88025e4ccf5880fab2699f7">D3D12MA::StatInfo::UsedBytes</a></div><div class="ttdeci">UINT64 UsedBytes</div><div class="ttdoc">Total number of bytes occupied by all allocations.</div><div class="ttdef"><b>Definition:</b> D3D12MemAlloc.h:664</div></div>
</div><!-- fragment --><p >You can also request a full list of allocations and free regions as a string in JSON format by calling <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#a828a27070bfa762cae796d4c8f2ef703" title="Builds and returns statistics as a string in JSON format, including the list of allocations with thei...">D3D12MA::VirtualBlock::BuildStatsString</a>. Returned string must be later freed using <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#a6f78ddaa7da194e239089e52093e68a9" title="Frees memory of a string returned from VirtualBlock::BuildStatsString.">D3D12MA::VirtualBlock::FreeStatsString</a>. The format of this string may differ from the one returned by the main D3D12 allocator, but it is similar.</p>
<h1><a class="anchor" id="virtual_allocator_additional_considerations"></a>
Additional considerations</h1>
<p >Alternative, linear algorithm can be used with virtual allocator - see flag <a class="el" href="namespace_d3_d12_m_a.html#a578329923a103be086ac52e3bed2085dabd9968af113acc9a756254ab9f1dc13d" title="Enables alternative, linear allocation algorithm in this virtual block.">D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR</a> and documentation: <a class="el" href="linear_algorithm.html">Linear allocation algorithm</a>.</p>
<p >Note that the "virtual allocator" functionality is implemented on a level of individual memory blocks. Keeping track of a whole collection of blocks, allocating new ones when out of free space, deleting empty ones, and deciding which one to try first for a new allocation must be implemented by the user. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->

View File

@ -40,12 +40,13 @@ Documentation of all members: D3D12MemAlloc.h
- [Mapping memory](@ref quick_start_mapping_memory)
- \subpage custom_pools
- \subpage resource_aliasing
- \subpage linear_algorithm
- \subpage virtual_allocator
- \subpage configuration
- [Custom CPU memory allocator](@ref custom_memory_allocator)
- [Debug margins](@ref debug_margins)
- \subpage general_considerations
- [Thread safety](@ref general_considerations_thread_safety)
- [Future plans](@ref general_considerations_future_plans)
- [Features not supported](@ref general_considerations_features_not_supported)
\section main_see_also See also
@ -215,6 +216,12 @@ enum ALLOCATION_FLAGS
memory budget. Otherwise return `E_OUTOFMEMORY`.
*/
ALLOCATION_FLAG_WITHIN_BUDGET = 0x4,
/** Allocation will be created from upper stack in a double stack pool.
This flag is only allowed for custom pools created with #POOL_FLAG_ALGORITHM_LINEAR flag.
*/
ALLOCATION_FLAG_UPPER_ADDRESS = 0x8
};
/// \brief Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.
@ -256,7 +263,7 @@ struct ALLOCATION_DESC
/// \brief Represents single memory allocation done inside VirtualBlock.
struct D3D12MA_API VirtualAllocation
{
/// \brief Unique idenitfier of current allocation.
/// \brief Unique idenitfier of current allocation. 0 means null/invalid.
AllocHandle AllocHandle;
};
@ -353,6 +360,7 @@ private:
friend class BlockVector;
friend class CommittedAllocationList;
friend class JsonWriter;
friend class BlockMetadata_Linear;
friend struct CommittedAllocationListItemTraits;
template<typename T> friend void D3D12MA_DELETE(const ALLOCATION_CALLBACKS&, T*);
template<typename T> friend class PoolAllocator;
@ -430,7 +438,7 @@ private:
void InitCommitted(CommittedAllocationList* list);
void InitPlaced(AllocHandle allocHandle, UINT64 alignment, NormalBlock* block);
void InitHeap(CommittedAllocationList* list, ID3D12Heap* heap);
// If the Allocation represents committed resource with implicit heap, returns UINT64_MAX
// If the Allocation represents committed resource with implicit heap, returns UINT64_MAX.
AllocHandle GetAllocHandle() const;
template<typename D3D12_RESOURCE_DESC_T>
void SetResource(ID3D12Resource* resource, const D3D12_RESOURCE_DESC_T* pResourceDesc);
@ -439,9 +447,46 @@ private:
D3D12MA_CLASS_NO_COPY(Allocation)
};
/// \brief Bit flags to be used with POOL_DESC::Flags.
enum POOL_FLAGS
{
/// Zero
POOL_FLAG_NONE = 0,
/** \brief Enables alternative, TLSF allocation algorithm in virtual block.
This algorithm is based on 2-level lists dividing address space into smaller
chunks. The first level is aligned to power of two which serves as buckets for requested
memory to fall into, and the second level is lineary subdivided into lists of free memory.
This algorithm aims to achieve bounded response time even in the worst case scenario.
Allocation time can be sometimes slightly longer than compared to other algorithms
but in return the application can avoid stalls in case of fragmentation, giving
predictable results, suitable for real-time use cases.
*/
POOL_FLAG_ALGORITHM_TLSF = 0x1,
/** \brief Enables alternative, linear allocation algorithm in this pool.
Specify this flag to enable linear allocation algorithm, which always creates
new allocations after last one and doesn't reuse space from allocations freed in
between. It trades memory consumption for simplified algorithm and data
structure, which has better performance and uses less memory for metadata.
By using this flag, you can achieve behavior of free-at-once, stack,
ring buffer, and double stack.
For details, see documentation chapter \ref linear_algorithm.
*/
POOL_FLAG_ALGORITHM_LINEAR = 0x2,
// Bit mask to extract only `ALGORITHM` bits from entire set of flags.
POOL_FLAG_ALGORITHM_MASK = POOL_FLAG_ALGORITHM_TLSF | POOL_FLAG_ALGORITHM_LINEAR
};
/// \brief Parameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool.
struct POOL_DESC
{
/// Flags.
POOL_FLAGS Flags;
/** \brief The parameters of memory heap where allocations of this pool should be placed.
In the simplest case, just fill it with zeros and set `Type` to one of: `D3D12_HEAP_TYPE_DEFAULT`,
@ -873,9 +918,46 @@ private:
D3D12MA_CLASS_NO_COPY(Allocator)
};
/// \brief Bit flags to be used with VIRTUAL_BLOCK_DESC::Flags.
enum VIRTUAL_BLOCK_FLAGS
{
/// Zero
VIRTUAL_BLOCK_FLAG_NONE = 0,
/** \brief Enables alternative, TLSF allocation algorithm in virtual block.
This algorithm is based on 2-level lists dividing address space into smaller
chunks. The first level is aligned to power of two which serves as buckets for requested
memory to fall into, and the second level is lineary subdivided into lists of free memory.
This algorithm aims to achieve bounded response time even in the worst case scenario.
Allocation time can be sometimes slightly longer than compared to other algorithms
but in return the application can avoid stalls in case of fragmentation, giving
predictable results, suitable for real-time use cases.
*/
VIRTUAL_BLOCK_FLAG_ALGORITHM_TLSF = POOL_FLAG_ALGORITHM_TLSF,
/** \brief Enables alternative, linear allocation algorithm in this virtual block.
Specify this flag to enable linear allocation algorithm, which always creates
new allocations after last one and doesn't reuse space from allocations freed in
between. It trades memory consumption for simplified algorithm and data
structure, which has better performance and uses less memory for metadata.
By using this flag, you can achieve behavior of free-at-once, stack,
ring buffer, and double stack.
For details, see documentation chapter \ref linear_algorithm.
*/
VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR = POOL_FLAG_ALGORITHM_LINEAR,
// Bit mask to extract only `ALGORITHM` bits from entire set of flags.
VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK = POOL_FLAG_ALGORITHM_MASK
};
/// Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock().
struct VIRTUAL_BLOCK_DESC
{
/// Flags.
VIRTUAL_BLOCK_FLAGS Flags;
/** \brief Total size of the block.
Sizes can be expressed in bytes or any units you want as long as you are consistent in using them.
@ -889,9 +971,24 @@ struct VIRTUAL_BLOCK_DESC
const ALLOCATION_CALLBACKS* pAllocationCallbacks;
};
/// \brief Bit flags to be used with VIRTUAL_ALLOCATION_DESC::Flags.
enum VIRTUAL_ALLOCATION_FLAGS
{
/// Zero
VIRTUAL_ALLOCATION_FLAG_NONE = 0,
/** \brief Allocation will be created from upper stack in a double stack pool.
This flag is only allowed for virtual blocks created with #VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR flag.
*/
VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS = ALLOCATION_FLAG_UPPER_ADDRESS,
};
/// Parameters of created virtual allocation to be passed to VirtualBlock::Allocate().
struct VIRTUAL_ALLOCATION_DESC
{
/// Flags.
VIRTUAL_ALLOCATION_FLAGS Flags;
/** \brief Size of the allocation.
Cannot be zero.
@ -913,12 +1010,12 @@ struct VIRTUAL_ALLOCATION_DESC
struct VIRTUAL_ALLOCATION_INFO
{
/// \brief Offset of the allocation.
UINT64 offset;
UINT64 Offset;
/** \brief Size of the allocation.
Same value as passed in VIRTUAL_ALLOCATION_DESC::Size.
*/
UINT64 size;
UINT64 Size;
/** \brief Custom pointer associated with the allocation.
Same value as passed in VIRTUAL_ALLOCATION_DESC::pUserData or VirtualBlock::SetAllocationUserData().
@ -949,12 +1046,16 @@ public:
/** \brief Creates new allocation.
\param pDesc
\param[out] pAllocation Unique indentifier of the new allocation within single block. `UINT64_MAX` in AllocHandle if allocation failed.
\param[out] pAllocation Unique indentifier of the new allocation within single block.
\param[out] pOffset Returned offset of the new allocation. Optional, can be null.
\return `S_OK` if allocation succeeded, `E_OUTOFMEMORY` if it failed.
If the allocation failed, `pAllocation->AllocHandle` is set to 0 and `pOffset`, if not null, is set to `UINT64_MAX`.
*/
HRESULT Allocate(const VIRTUAL_ALLOCATION_DESC* pDesc, VirtualAllocation* pAllocation, UINT64* pOffset);
/** \brief Frees the allocation.
Calling this function with `allocation.AllocHandle == 0` is correct and does nothing.
*/
void FreeAllocation(VirtualAllocation allocation);
/** \brief Frees all the allocations.
@ -1009,6 +1110,9 @@ D3D12MA_API HRESULT CreateVirtualBlock(const VIRTUAL_BLOCK_DESC* pDesc, VirtualB
/// \cond INTERNAL
DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::ALLOCATION_FLAGS);
DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::ALLOCATOR_FLAGS);
DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::POOL_FLAGS);
DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::VIRTUAL_BLOCK_FLAGS);
DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::VIRTUAL_ALLOCATION_FLAGS);
/// \endcond
/**
@ -1395,6 +1499,93 @@ Additional considerations:
Otherwise they must be placed in different memory heap types, and thus aliasing them is not possible.
\page linear_algorithm Linear allocation algorithm
Each D3D12 memory block managed by this library has accompanying metadata that
keeps track of used and unused regions. By default, the metadata structure and
algorithm tries to find best place for new allocations among free regions to
optimize memory usage. This way you can allocate and free objects in any order.
![Default allocation algorithm](../gfx/Linear_allocator_1_algo_default.png)
Sometimes there is a need to use simpler, linear allocation algorithm. You can
create custom pool that uses such algorithm by adding flag
D3D12MA::POOL_FLAG_ALGORITHM_LINEAR to D3D12MA::POOL_DESC::Flags while creating
D3D12MA::Pool object. Then an alternative metadata management is used. It always
creates new allocations after last one and doesn't reuse free regions after
allocations freed in the middle. It results in better allocation performance and
less memory consumed by metadata.
![Linear allocation algorithm](../gfx/Linear_allocator_2_algo_linear.png)
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.
\section linear_algorithm_free_at_once Free-at-once
In a pool that uses linear algorithm, you still need to free all the allocations
individually by calling `allocation->Release()`. 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.
![Free-at-once](../gfx/Linear_allocator_3_free_at_once.png)
This mode is also available for pools created with D3D12MA::POOL_DESC::MaxBlockCount
value that allows multiple memory blocks.
\section linear_algorithm_stack Stack
When you free an allocation that was created last, its space can be reused.
Thanks to this, if you always release allocations in the order opposite to their
creation (LIFO - Last In First Out), you can achieve behavior of a stack.
![Stack](../gfx/Linear_allocator_4_stack.png)
This mode is also available for pools created with D3D12MA::POOL_DESC::MaxBlockCount
value that allows multiple memory blocks.
\section linear_algorithm_double_stack Double stack
The space reserved by a custom pool with linear algorithm may be used by two
stacks:
- First, default one, growing up from offset 0.
- Second, "upper" one, growing down from the end towards lower offsets.
To make allocation from the upper stack, add flag D3D12MA::ALLOCATION_FLAG_UPPER_ADDRESS
to D3D12MA::ALLOCATION_DESC::Flags.
![Double stack](../gfx/Linear_allocator_7_double_stack.png)
Double stack is available only in pools with one memory block -
D3D12MA::POOL_DESC::MaxBlockCount must be 1. Otherwise behavior is undefined.
When the two stacks' ends meet so there is not enough space between them for a
new allocation, such allocation fails with usual `E_OUTOFMEMORY` error.
\section linear_algorithm_ring_buffer Ring buffer
When you free some allocations from the beginning and there is not enough free space
for a new one at the end of a pool, allocator's "cursor" wraps around to the
beginning and starts allocation there. Thanks to this, if you always release
allocations in the same order as you created them (FIFO - First In First Out),
you can achieve behavior of a ring buffer / queue.
![Ring buffer](../gfx/Linear_allocator_5_ring_buffer.png)
Ring buffer is available only in pools with one memory block -
D3D12MA::POOL_DESC::MaxBlockCount must be 1. Otherwise behavior is undefined.
\section linear_algorithm_additional_considerations Additional considerations
Linear algorithm can also be used with \ref virtual_allocator.
See flag D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR.
\page virtual_allocator Virtual allocator
As an extra feature, the core allocation algorithm of the library is exposed through a simple and convenient API of "virtual allocator".
@ -1425,14 +1616,13 @@ HRESULT hr = CreateVirtualBlock(&blockDesc, &block);
D3D12MA::VirtualBlock object contains internal data structure that keeps track of free and occupied regions
using the same code as the main D3D12 memory allocator.
However, there is no "virtual allocation" object.
When you request a new allocation, a `UINT64` number is returned.
It is an offset inside the block where the allocation has been placed, but it also uniquely identifies the allocation within this block.
A single allocation is identified by a lightweight structure D3D12MA::VirtualAllocation.
You will also likely want to know the offset at which the allocation was made in the block.
In order to make an allocation:
-# Fill in D3D12MA::VIRTUAL_ALLOCATION_DESC structure.
-# Call D3D12MA::VirtualBlock::Allocate. Get new `UINT64 offset` that identifies the allocation.
-# Call D3D12MA::VirtualBlock::Allocate. Get new D3D12MA::VirtualAllocation value that identifies the allocation.
Example:
@ -1440,8 +1630,9 @@ Example:
D3D12MA::VIRTUAL_ALLOCATION_DESC allocDesc = {};
allocDesc.Size = 4096; // 4 KB
D3D12MA::VirtualAllocation alloc;
UINT64 allocOffset;
hr = block->Allocate(&allocDesc, &allocOffset);
hr = block->Allocate(&allocDesc, &alloc, &allocOffset);
if(SUCCEEDED(hr))
{
// Use the 4 KB of your memory starting at allocOffset.
@ -1455,16 +1646,16 @@ else
\section virtual_allocator_deallocation Deallocation
When no longer needed, an allocation can be freed by calling D3D12MA::VirtualBlock::FreeAllocation.
You can only pass to this function the exact offset that was previously returned by D3D12MA::VirtualBlock::Allocate
and not any other location within the memory.
When whole block is no longer needed, the block object can be released by calling D3D12MA::VirtualBlock::Release.
When whole block is no longer needed, the block object can be released by calling `block->Release()`.
All allocations must be freed before the block is destroyed, which is checked internally by an assert.
However, if you don't want to call `block->FreeAllocation` for each allocation, you can use D3D12MA::VirtualBlock::Clear to free them all at once -
a feature not available in normal D3D12 memory allocator. Example:
a feature not available in normal D3D12 memory allocator.
Example:
\code
block->FreeAllocation(allocOffset);
block->FreeAllocation(alloc);
block->Release();
\endcode
@ -1482,20 +1673,20 @@ struct CustomAllocData
};
CustomAllocData* allocData = new CustomAllocData();
allocData->m_AllocName = "My allocation 1";
block->SetAllocationUserData(allocOffset, allocData);
block->SetAllocationUserData(alloc, allocData);
\endcode
The pointer can later be fetched, along with allocation size, by passing the allocation offset to function
The pointer can later be fetched, along with allocation offset and size, by passing the allocation handle to function
D3D12MA::VirtualBlock::GetAllocationInfo and inspecting returned structure D3D12MA::VIRTUAL_ALLOCATION_INFO.
If you allocated a new object to be used as the custom pointer, don't forget to delete that object before freeing the allocation!
Example:
\code
VIRTUAL_ALLOCATION_INFO allocInfo;
block->GetAllocationInfo(allocOffset, &allocInfo);
block->GetAllocationInfo(alloc, &allocInfo);
delete (CustomAllocData*)allocInfo.pUserData;
block->FreeAllocation(allocOffset);
block->FreeAllocation(alloc);
\endcode
\section virtual_allocator_alignment_and_units Alignment and units
@ -1509,8 +1700,9 @@ D3D12MA::VIRTUAL_ALLOCATION_DESC allocDesc = {};
allocDesc.Size = 4096; // 4 KB
allocDesc.Alignment = 4; // Returned offset must be a multiply of 4 B
D3D12MA::VirtualAllocation alloc;
UINT64 allocOffset;
hr = block->Allocate(&allocDesc, &allocOffset);
hr = block->Allocate(&allocDesc, &alloc, &allocOffset);
\endcode
Alignments of different allocations made from one block may vary.
@ -1520,7 +1712,7 @@ It might be more convenient, but you need to make sure to use this new unit cons
- D3D12MA::VIRTUAL_BLOCK_DESC::Size
- D3D12MA::VIRTUAL_ALLOCATION_DESC::Size and D3D12MA::VIRTUAL_ALLOCATION_DESC::Alignment
- Using offset returned by D3D12MA::VirtualBlock::Allocate
- Using offset returned by D3D12MA::VirtualBlock::Allocate and D3D12MA::VIRTUAL_ALLOCATION_INFO::Offset
\section virtual_allocator_statistics Statistics
@ -1542,6 +1734,9 @@ The format of this string may differ from the one returned by the main D3D12 all
\section virtual_allocator_additional_considerations Additional considerations
Alternative, linear algorithm can be used with virtual allocator - see flag
D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR and documentation: \ref linear_algorithm.
Note that the "virtual allocator" functionality is implemented on a level of individual memory blocks.
Keeping track of a whole collection of blocks, allocating new ones when out of free space,
deleting empty ones, and deciding which one to try first for a new allocation must be implemented by the user.
@ -1594,6 +1789,37 @@ HRESULT hr = D3D12MA::CreateAllocator(&allocatorDesc, &allocator);
\endcode
\section debug_margins Debug margins
By default, allocations are laid out in memory blocks next to each other if possible
(considering required alignment returned by `ID3D12Device::GetResourceAllocationInfo`).
![Allocations without margin](../gfx/Margins_1.png)
Define macro `D3D12MA_DEBUG_MARGIN` to some non-zero value (e.g. 16) inside "D3D12MemAlloc.cpp"
to enforce specified number of bytes as a margin after every allocation.
![Allocations with margin](../gfx/Margins_2.png)
If your bug goes away after enabling margins, it means it may be caused by memory
being overwritten outside of allocation boundaries. It is not 100% certain though.
Change in application behavior may also be caused by different order and distribution
of allocations across memory blocks after margins are applied.
Margins work with all memory heap types.
Margin is applied only to placed allocations made out of memory heaps and not to committed
allocations, which have their own, implicit memory heap of specific size.
It is thus not applied to allocations made using D3D12MA::ALLOCATION_FLAG_COMMITTED flag
or those automatically decided to put into committed allocations, e.g. due to its large size.
Margins appear in [JSON dump](@ref statistics_json_dump) as part of free space.
Note that enabling margins increases memory usage and fragmentation.
Margins do not apply to \ref virtual_allocator.
\page general_considerations General considerations
\section general_considerations_thread_safety Thread safety
@ -1607,26 +1833,13 @@ HRESULT hr = D3D12MA::CreateAllocator(&allocatorDesc, &allocator);
Using this flag may improve performance.
- D3D12MA::VirtualBlock is not safe to be used from multiple threads simultaneously.
\section general_considerations_future_plans Future plans
Features planned for future releases:
Near future: feature parity with [Vulkan Memory Allocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/), including:
- Alternative allocation algorithms: linear allocator, buddy allocator
- Support for priorities using `ID3D12Device1::SetResidencyPriority`
Later:
- Memory defragmentation
- Support for multi-GPU (multi-adapter)
\section general_considerations_features_not_supported Features not supported
Features deliberately excluded from the scope of this library:
- **Descriptor allocation.** Although also called "heaps", objects that represent
descriptors are separate part of the D3D12 API from buffers and textures.
You can still use \ref virtual_allocator to manage descriptors and their ranges inside a descriptor heap.
- **Support for reserved (tiled) resources.** We don't recommend using them.
- Support for `ID3D12Device::Evict` and `MakeResident`. We don't recommend using them.
You can call them on the D3D12 objects manually.

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,9 @@ extern void EndCommandList(ID3D12GraphicsCommandList* cmdList);
static constexpr UINT64 MEGABYTE = 1024 * 1024;
// Define to the same value as you did for D3D12MemAlloc.cpp.
//#define D3D12MA_DEBUG_MARGIN 16
struct ResourceWithAllocation
{
ComPtr<ID3D12Resource> resource;
@ -139,13 +142,14 @@ static void TestVirtualBlocks(const TestContext& ctx)
allocDesc.Size = 8 * MEGABYTE;
VirtualAllocation alloc0;
CHECK_HR( block->Allocate(&allocDesc, &alloc0, nullptr) );
CHECK_BOOL(alloc0.AllocHandle);
// # Validate the allocation
VIRTUAL_ALLOCATION_INFO alloc0Info = {};
block->GetAllocationInfo(alloc0, &alloc0Info);
CHECK_BOOL( alloc0Info.offset < blockSize );
CHECK_BOOL( alloc0Info.size == allocDesc.Size );
CHECK_BOOL( alloc0Info.Offset < blockSize );
CHECK_BOOL( alloc0Info.Size == allocDesc.Size );
CHECK_BOOL( alloc0Info.pUserData == allocDesc.pUserData );
// # Check SetUserData
@ -160,19 +164,22 @@ static void TestVirtualBlocks(const TestContext& ctx)
allocDesc.Alignment = alignment;
VirtualAllocation alloc1;
CHECK_HR( block->Allocate(&allocDesc, &alloc1, nullptr) );
CHECK_BOOL(alloc1.AllocHandle);
VIRTUAL_ALLOCATION_INFO alloc1Info = {};
block->GetAllocationInfo(alloc1, &alloc1Info);
CHECK_BOOL( alloc1Info.offset < blockSize );
CHECK_BOOL( alloc1Info.offset + 4 * MEGABYTE <= alloc0Info.offset || alloc0Info.offset + 8 * MEGABYTE <= alloc1Info.offset); // Check if they don't overlap.
CHECK_BOOL( alloc1Info.Offset < blockSize );
CHECK_BOOL( alloc1Info.Offset + 4 * MEGABYTE <= alloc0Info.Offset || alloc0Info.Offset + 8 * MEGABYTE <= alloc1Info.Offset); // Check if they don't overlap.
// # Allocate another 8 MB - it should fail
allocDesc.Size = 8 * MEGABYTE;
allocDesc.Alignment = alignment;
VirtualAllocation alloc2;
CHECK_BOOL( FAILED(block->Allocate(&allocDesc, &alloc2, nullptr)) );
CHECK_BOOL( alloc2.AllocHandle == (AllocHandle)UINT64_MAX );
VirtualAllocation alloc2 = {666};
UINT64 offset2 = 666;
CHECK_BOOL( FAILED(block->Allocate(&allocDesc, &alloc2, &offset2)) );
CHECK_BOOL( alloc2.AllocHandle == (AllocHandle)0 );
CHECK_BOOL( offset2 == UINT64_MAX );
// # Free the 4 MB block. Now allocation of 8 MB should succeed.
@ -180,7 +187,7 @@ static void TestVirtualBlocks(const TestContext& ctx)
UINT64 alloc2Offset;
CHECK_HR( block->Allocate(&allocDesc, &alloc2, &alloc2Offset) );
CHECK_BOOL( alloc2Offset < blockSize );
CHECK_BOOL( alloc2Offset + 4 * MEGABYTE <= alloc0Info.offset || alloc0Info.offset + 8 * MEGABYTE <= alloc2Offset); // Check if they don't overlap.
CHECK_BOOL( alloc2Offset + 4 * MEGABYTE <= alloc0Info.Offset || alloc0Info.Offset + 8 * MEGABYTE <= alloc2Offset); // Check if they don't overlap.
// # Calculate statistics
@ -237,6 +244,119 @@ static void TestVirtualBlocks(const TestContext& ctx)
//block->Clear();
}
#ifndef D3D12MA_DEBUG_MARGIN
#define D3D12MA_DEBUG_MARGIN (0)
#endif
static void TestDebugMargin(const TestContext& ctx)
{
using namespace D3D12MA;
if(D3D12MA_DEBUG_MARGIN == 0)
{
return;
}
wprintf(L"Test D3D12MA_DEBUG_MARGIN = %u\n", (uint32_t)D3D12MA_DEBUG_MARGIN);
ALLOCATION_DESC allocDesc = {};
D3D12_RESOURCE_DESC resDesc = {};
POOL_DESC poolDesc = {};
poolDesc.HeapProperties.Type = D3D12_HEAP_TYPE_UPLOAD;
for(size_t algorithmIndex = 0; algorithmIndex < 3; ++algorithmIndex)
{
switch(algorithmIndex)
{
case 0: poolDesc.Flags = POOL_FLAG_NONE; break;
case 1: poolDesc.Flags = POOL_FLAG_ALGORITHM_TLSF; break;
case 2: poolDesc.Flags = POOL_FLAG_ALGORITHM_LINEAR; break;
default: assert(0);
}
ComPtr<Pool> pool;
CHECK_HR(ctx.allocator->CreatePool(&poolDesc, &pool));
allocDesc.CustomPool = pool.Get();
// Create few buffers of different size.
const size_t BUF_COUNT = 10;
ComPtr<Allocation> buffers[BUF_COUNT];
for(size_t allocIndex = 0; allocIndex < 10; ++allocIndex)
{
const bool isLast = allocIndex == BUF_COUNT - 1;
FillResourceDescForBuffer(resDesc, (UINT64)(allocIndex + 1) * 0x10000);
CHECK_HR(ctx.allocator->CreateResource(
&allocDesc,
&resDesc,
D3D12_RESOURCE_STATE_GENERIC_READ,
nullptr,
&buffers[allocIndex],
IID_NULL, nullptr));
}
// JSON dump
wchar_t* json = nullptr;
ctx.allocator->BuildStatsString(&json, TRUE);
int I = 1; // Put breakpoint here to manually inspect json in a debugger.
// Check if their offsets preserve margin between them.
std::sort(buffers, buffers + BUF_COUNT, [](const ComPtr<Allocation>& lhs, const ComPtr<Allocation>& rhs) -> bool
{
if(lhs->GetHeap() != rhs->GetHeap())
{
return lhs->GetHeap() < rhs->GetHeap();
}
return lhs->GetOffset() < rhs->GetOffset();
});
for(size_t i = 1; i < BUF_COUNT; ++i)
{
if(buffers[i]->GetHeap() == buffers[i - 1]->GetHeap())
{
CHECK_BOOL(buffers[i]->GetOffset() >=
buffers[i - 1]->GetOffset() + buffers[i - 1]->GetSize() + D3D12MA_DEBUG_MARGIN);
}
}
ctx.allocator->FreeStatsString(json);
}
}
static void TestDebugMarginNotInVirtualAllocator(const TestContext& ctx)
{
wprintf(L"Test D3D12MA_DEBUG_MARGIN not applied to virtual allocator\n");
using namespace D3D12MA;
constexpr size_t ALLOCATION_COUNT = 10;
for(size_t algorithmIndex = 0; algorithmIndex < 3; ++algorithmIndex)
{
VIRTUAL_BLOCK_DESC blockDesc = {};
blockDesc.Size = ALLOCATION_COUNT * MEGABYTE;
switch(algorithmIndex)
{
case 0: blockDesc.Flags = VIRTUAL_BLOCK_FLAG_NONE; break;
case 1: blockDesc.Flags = VIRTUAL_BLOCK_FLAG_ALGORITHM_TLSF; break;
case 2: blockDesc.Flags = VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR; break;
default: assert(0);
}
ComPtr<VirtualBlock> block;
CHECK_HR(CreateVirtualBlock(&blockDesc, &block));
// Fill the entire block
VirtualAllocation allocs[ALLOCATION_COUNT];
for(size_t i = 0; i < ALLOCATION_COUNT; ++i)
{
VIRTUAL_ALLOCATION_DESC allocDesc = {};
allocDesc.Size = 1 * MEGABYTE;
CHECK_HR(block->Allocate(&allocDesc, &allocs[i], nullptr));
}
block->Clear();
}
}
static void TestFrameIndexAndJson(const TestContext& ctx)
{
const UINT64 bufSize = 32ull * 1024;
@ -1741,6 +1861,10 @@ static void TestGroupVirtual(const TestContext& ctx)
static void TestGroupBasics(const TestContext& ctx)
{
#if D3D12MA_DEBUG_MARGIN
TestDebugMargin(ctx);
TestDebugMarginNotInVirtualAllocator(ctx);
#else
TestFrameIndexAndJson(ctx);
TestCommittedResourcesAndJson(ctx);
TestCustomHeapFlags(ctx);
@ -1764,6 +1888,7 @@ static void TestGroupBasics(const TestContext& ctx)
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
TestDevice8(ctx);
#endif
#endif // #if D3D12_DEBUG_MARGIN
}
void Test(const TestContext& ctx)