You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improved the logic so that D3D12_HEAP_FLAG_CREATE_NOT_ZEROED can always allocate from default pools
Worst case, it will end up in a heap that was zeroed on creation.
Also made D3D12_HEAP_FLAG_CREATE_NOT_ZEROED the default in CALLOCATION_DESC constructor.
Rebuilt the docs.
<trclass="memdesc:aa623643886b8481adb32017e5c748b50"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Define this macro to 0 to disable usage of DXGI 1.4 (which is used for IDXGIAdapter3 and query for memory budget). <br/></td></tr>
190
+
<trclass="memdesc:aa623643886b8481adb32017e5c748b50"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Define this macro to 0 to disable usage of DXGI 1.4 (which is used for <code>IDXGIAdapter3</code> and query for memory budget). <br/></td></tr>
<trclass="memdesc:a6df70df4d9e792713418dd4062b07c3a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">This macro is defined to 0 or 1 automatically. Define it to 0 to disable support for <code>D3D12_HEAP_FLAG_CREATE_NOT_ZEROED</code>. <br/></td></tr>
<trclass="memdesc:ad04069a2e2bbc53b7d65f85a04a2dcbc"><tdclass="mdescLeft"> </td><tdclass="mdescRight">When defined to value other than 0, the library will try to use <code>D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT</code> or <code>D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT</code> for created textures when possible, which can save memory because some small textures may get their alignment 4 KB and their size a multiply of 4 KB instead of 64 KB. <br/></td></tr>
@@ -198,6 +199,7 @@
198
199
<trclass="memdesc:accfbeae642feeacf353ce695e91a5e73"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set of flags recommended for use in <aclass="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html#ad8abad7c80ea0d8df27c85243ce720f3" title="Flags for the entire allocator.">D3D12MA::ALLOCATOR_DESC::Flags</a> for optimal performance. <br/></td></tr>
<trclass="memdesc:ac3d50f134ad24c58df4a934b87847653"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set of flags recommended for use in <aclass="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a3795956e4fbfe7c3a23546e02e5d28dc" title="Heap flags to be used when allocating heaps of this pool.">D3D12MA::POOL_DESC::HeapFlags</a> for optimal performance. <br/></td></tr>
<trclass="memdesc:a2679d8c9f6d900168bb45450bc88998b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set of flags recommended for use in <aclass="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#ac4ed93b0191344d68c0b4ac1a4822ff4" title="Flags for the heap.">D3D12MA::POOL_DESC::Flags</a> for optimal performance. <br/></td></tr>
<p>Set of flags recommended for use in <aclass="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a3795956e4fbfe7c3a23546e02e5d28dc" title="Heap flags to be used when allocating heaps of this pool.">D3D12MA::POOL_DESC::HeapFlags</a> for optimal performance. </p>
Copy file name to clipboardExpand all lines: docs/html/class_d3_d12_m_a_1_1_allocation.html
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@
121
121
<trclass="memdesc:ad00308118252f82d8f803c623c67bf18"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns D3D12 resource associated with this object. <br/></td></tr>
<trclass="memdesc:a414a088c22bae0f29b1038f5f9346d14"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Releases the resource currently pointed by the allocation (if any), sets it to new one, incrementing its reference counter (if not null). <br/></td></tr>
124
+
<trclass="memdesc:a414a088c22bae0f29b1038f5f9346d14"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Releases the resource currently pointed by the allocation (if not null), sets it to new one, incrementing its reference counter (if not null). <br/></td></tr>
<trclass="memdesc:adca8d5a82bed492fe7265fcda6e53da2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns memory heap that the resource is created in. <br/></td></tr>
<p>Releases the resource currently pointed by the allocation (if any), sets it to new one, incrementing its reference counter (if not null). </p>
396
+
<p>Releases the resource currently pointed by the allocation (if not null), sets it to new one, incrementing its reference counter (if not null). </p>
397
+
<dlclass="section warning"><dt>Warning</dt><dd>This is an advanced feature that should be used only in special cases, e.g. during <aclass="el" href="defragmentation.html">Defragmentation</a>. Typically, an allocation object should reference the resource that was created together with it. If you swap it to another resource of different size, <aclass="el" href="statistics.html">Statistics</a> and budgets can be calculated incorrectly. </dd></dl>
<divclass="ttc" id="a_d3_d12_mem_alloc_8h_html_accfbeae642feeacf353ce695e91a5e73"><divclass="ttname"><ahref="_d3_d12_mem_alloc_8h.html#accfbeae642feeacf353ce695e91a5e73">D3D12MA_RECOMMENDED_ALLOCATOR_FLAGS</a></div><divclass="ttdeci">#define D3D12MA_RECOMMENDED_ALLOCATOR_FLAGS</div><divclass="ttdoc">Set of flags recommended for use in D3D12MA::ALLOCATOR_DESC::Flags for optimal performance.</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:126</div></div>
129
-
<divclass="ttc" id="aclass_d3_d12_m_a_1_1_allocator_html"><divclass="ttname"><ahref="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></div><divclass="ttdoc">Represents main object of this library initialized for particular ID3D12Device.</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:1155</div></div>
128
+
<divclass="ttc" id="a_d3_d12_mem_alloc_8h_html_accfbeae642feeacf353ce695e91a5e73"><divclass="ttname"><ahref="_d3_d12_mem_alloc_8h.html#accfbeae642feeacf353ce695e91a5e73">D3D12MA_RECOMMENDED_ALLOCATOR_FLAGS</a></div><divclass="ttdeci">#define D3D12MA_RECOMMENDED_ALLOCATOR_FLAGS</div><divclass="ttdoc">Set of flags recommended for use in D3D12MA::ALLOCATOR_DESC::Flags for optimal performance.</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:127</div></div>
129
+
<divclass="ttc" id="aclass_d3_d12_m_a_1_1_allocator_html"><divclass="ttname"><ahref="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></div><divclass="ttdoc">Represents main object of this library initialized for particular ID3D12Device.</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:1162</div></div>
130
130
<divclass="ttc" id="anamespace_d3_d12_m_a_html_ab7a1cd1683986d75ce1488b0920f4cb0"><divclass="ttname"><ahref="namespace_d3_d12_m_a.html#ab7a1cd1683986d75ce1488b0920f4cb0">D3D12MA::CreateAllocator</a></div><divclass="ttdeci">D3D12MA_API HRESULT CreateAllocator(const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)</div><divclass="ttdoc">Creates new main D3D12MA::Allocator object and returns it through ppAllocator.</div></div>
131
-
<divclass="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html"><divclass="ttname"><ahref="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><divclass="ttdoc">Parameters of created Allocator object. To be used with CreateAllocator().</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:1113</div></div>
<divclass="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_ad8abad7c80ea0d8df27c85243ce720f3"><divclass="ttname"><ahref="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::Flags</a></div><divclass="ttdeci">ALLOCATOR_FLAGS Flags</div><divclass="ttdoc">Flags for the entire allocator.</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:1118</div></div>
<divclass="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html"><divclass="ttname"><ahref="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><divclass="ttdoc">Parameters of created Allocator object. To be used with CreateAllocator().</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:1120</div></div>
<divclass="ttc" id="astruct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c_html_ad8abad7c80ea0d8df27c85243ce720f3"><divclass="ttname"><ahref="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::Flags</a></div><divclass="ttdeci">ALLOCATOR_FLAGS Flags</div><divclass="ttdoc">Flags for the entire allocator.</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:1125</div></div>
</div><!-- fragment --><h1><aclass="anchor" id="debug_margins"></a>
137
137
Debug margins</h1>
138
138
<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>
<divclass="ttc" id="a_d3_d12_mem_alloc_8h_html_a2679d8c9f6d900168bb45450bc88998b"><divclass="ttname"><ahref="_d3_d12_mem_alloc_8h.html#a2679d8c9f6d900168bb45450bc88998b">D3D12MA_RECOMMENDED_POOL_FLAGS</a></div><divclass="ttdeci">#define D3D12MA_RECOMMENDED_POOL_FLAGS</div><divclass="ttdoc">Set of flags recommended for use in D3D12MA::POOL_DESC::Flags for optimal performance.</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:140</div></div>
<divclass="ttc" id="a_d3_d12_mem_alloc_8h_html_a2679d8c9f6d900168bb45450bc88998b"><divclass="ttname"><ahref="_d3_d12_mem_alloc_8h.html#a2679d8c9f6d900168bb45450bc88998b">D3D12MA_RECOMMENDED_POOL_FLAGS</a></div><divclass="ttdeci">#define D3D12MA_RECOMMENDED_POOL_FLAGS</div><divclass="ttdoc">Set of flags recommended for use in D3D12MA::POOL_DESC::Flags for optimal performance.</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:141</div></div>
106
+
<divclass="ttc" id="a_d3_d12_mem_alloc_8h_html_ac3d50f134ad24c58df4a934b87847653"><divclass="ttname"><ahref="_d3_d12_mem_alloc_8h.html#ac3d50f134ad24c58df4a934b87847653">D3D12MA_RECOMMENDED_HEAP_FLAGS</a></div><divclass="ttdeci">#define D3D12MA_RECOMMENDED_HEAP_FLAGS</div><divclass="ttdoc">Set of flags recommended for use in D3D12MA::POOL_DESC::HeapFlags for optimal performance.</div><divclass="ttdef"><b>Definition</b> D3D12MemAlloc.h:135</div></div>
107
107
</div><!-- fragment --><p>To allocate resources out of a custom pool, only set member <aclass="el" href="struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ab06b85f3cf3254f855b29264477e3934" title="Custom pool to place the new resource in. Optional.">D3D12MA::ALLOCATION_DESC::CustomPool</a>. Example:</p>
0 commit comments