Updated CHANGELOG.md in preparation for v3.0.0 Rebuilt the docs.
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f8271d..efe0a12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md
@@ -1,3 +1,31 @@ +# 3.0.0 (2025-??-??) + +It has been a long time since the previous official release, so hopefully everyone has been using the latest code from "master" branch, which is always maintained in a good state, not the old version. For completeness, here is the list of changes since v2.0.1. The major version number has changed, so there are some compatibility-breaking changes, but the basic API stays the same and is mostly backward-compatible. + +- Added helper structs: `CALLOCATION_DESC`, `CPOOL_DESC`, `CVIRTUAL_BLOCK_DESC`, `CVIRTUAL_ALLOCATION_DESC`. +- Added macros: `D3D12MA_RECOMMENDED_ALLOCATOR_FLAGS`, `D3D12MA_RECOMMENDED_HEAP_FLAGS`, `D3D12MA_RECOMMENDED_POOL_FLAGS`. +- Added functions: `Allocator::CreateResource3`, `CreateAliasingResource2`. + - They support parameters: `D3D12_BARRIER_LAYOUT InitialLayout`, `const DXGI_FORMAT* pCastableFormats`. + - They require recent DirectX 12 Agility SDK. To use them, `ID3D12Device10` must be available. + To use non-empty list of castable formats, `ID3D12Device12` must be available. +- Added support for GPU Upload Heaps (`D3D12_HEAP_TYPE_GPU_UPLOAD`). + - Requires recent DirectX 12 Agility SDK. Support on the user's machine is available only when supported by the motherboard, GPU, drivers, and enabled as "Resizable BAR" in UEFI settings. It can be queried using new `Allocator::IsGPUUploadHeapSupported` function. + - `TotalStatistics::HeapType` array was extended from 4 to 5 elements. +- Added missing function `Allocator::CreateAliasingResource1`. +- Added `POOL_DESC::ResidencyPriority` member. +- Removed `Allocation::WasZeroInitialized` function. It wasn't fully implemented anyway. +- Added `POOL_FLAG_ALWAYS_COMMITTED`. +- Added a heuristic that prefers creating small buffers as committed to save memory. + - It is enabled by default. It can be disabled by new flag `ALLOCATOR_FLAG_DONT_PREFER_SMALL_BUFFERS_COMMITTED`. +- Macro `D3D12MA_OPTIONS16_SUPPORTED` is no longer exposed in the header or Cmake script. + It is defined automatically based on the Agility SDK version. +- Added macro `D3D12MA_DEBUG_LOG`, which can be used to log unfreed allocations. +- Many improvements in the documentation, including new chapters: "Frequently asked questions", "Optimal resource allocation". +- Countless fixes and improvements, including performance optimizations, compatibility with various compilers, tests. +- Major changes in the Cmake script. +- Fixes in "GpuMemDumpVis.py" script. + + # 2.0.1 (2022-04-05) A maintenance release with some bug fixes and improvements. There are no changes in the library API.
diff --git a/docs/html/class_d3_d12_m_a_1_1_allocator-members.html b/docs/html/class_d3_d12_m_a_1_1_allocator-members.html index 5634ccf..b18c32c 100644 --- a/docs/html/class_d3_d12_m_a_1_1_allocator-members.html +++ b/docs/html/class_d3_d12_m_a_1_1_allocator-members.html
@@ -100,12 +100,12 @@ <tr class="odd"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a99db00df909963573a976c203b107d22">CalculateStatistics</a>(TotalStatistics *pStats)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#ab45536f92410aedb7be44ea36b1b4717">CreateAliasingResource</a>(Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riidResource, void **ppvResource)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> <tr class="odd"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#ad3b83cc5707cb4ed92bc277069c4ddd6">CreateAliasingResource1</a>(Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riidResource, void **ppvResource)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a562cbaa71cbd333cade09cd67ed82453">CreateAliasingResource2</a>(Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, DXGI_FORMAT *pCastableFormats, REFIID riidResource, void **ppvResource)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> + <tr class="even"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a8af77401efadf6b81f0b50bdb7d0475a">CreateAliasingResource2</a>(Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, const DXGI_FORMAT *pCastableFormats, REFIID riidResource, void **ppvResource)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> <tr class="odd"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a6e114ef3b4a791a3bf2e3109a3971559">CreateAllocator</a>(const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"><span class="mlabel">friend</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#aac7b1f6bf53cbf4c4ce2264cb72ca515">CreatePool</a>(const POOL_DESC *pPoolDesc, Pool **ppPool)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> <tr class="odd"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#aa37d6b9fe8ea0864f7a35b9d68e8345a">CreateResource</a>(const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, Allocation **ppAllocation, REFIID riidResource, void **ppvResource)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a7a1c79c79a7a573c438aa45c4a531b96">CreateResource2</a>(const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, Allocation **ppAllocation, REFIID riidResource, void **ppvResource)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> - <tr class="odd"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a323b2af320b01d0fdecfc515c75db747">CreateResource3</a>(const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, DXGI_FORMAT *pCastableFormats, Allocation **ppAllocation, REFIID riidResource, void **ppvResource)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> + <tr class="odd"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#ab34796ba12e0aa05f4db80d8be5989a5">CreateResource3</a>(const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, const DXGI_FORMAT *pCastableFormats, Allocation **ppAllocation, REFIID riidResource, void **ppvResource)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a968f13f23d03e50cc50b87835b6d5a85">D3D12MA_DELETE</a>(const ALLOCATION_CALLBACKS &, T *)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"><span class="mlabel">friend</span></td></tr> <tr class="odd"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a8392663494384c16d8bfa12b827b4f9c">FreeStatsString</a>(WCHAR *pStatsString) const</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a1ac113daec5f6ef28ecb1786cf544144">GetBudget</a>(Budget *pLocalBudget, Budget *pNonLocalBudget)</td><td class="entry"><a class="el" href="class_d3_d12_m_a_1_1_allocator.html">D3D12MA::Allocator</a></td><td class="entry"></td></tr>
diff --git a/docs/html/class_d3_d12_m_a_1_1_allocator.html b/docs/html/class_d3_d12_m_a_1_1_allocator.html index fd2e159..12f4ca4 100644 --- a/docs/html/class_d3_d12_m_a_1_1_allocator.html +++ b/docs/html/class_d3_d12_m_a_1_1_allocator.html
@@ -129,9 +129,9 @@ <tr class="memitem:a7a1c79c79a7a573c438aa45c4a531b96" id="r_a7a1c79c79a7a573c438aa45c4a531b96"><td class="memItemLeft" align="right" valign="top">HRESULT </td><td class="memItemRight" valign="bottom"><a class="el" href="#a7a1c79c79a7a573c438aa45c4a531b96">CreateResource2</a> (const <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">ALLOCATION_DESC</a> *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, <a class="el" href="class_d3_d12_m_a_1_1_allocation.html">Allocation</a> **ppAllocation, REFIID riidResource, void **ppvResource)</td></tr> <tr class="memdesc:a7a1c79c79a7a573c438aa45c4a531b96"><td class="mdescLeft"> </td><td class="mdescRight">Similar to <a class="el" href="#aa37d6b9fe8ea0864f7a35b9d68e8345a" title="Allocates memory and creates a D3D12 resource (buffer or texture). This is the main allocation functi...">Allocator::CreateResource</a>, but supports new structure <code>D3D12_RESOURCE_DESC1</code>. <br /></td></tr> <tr class="separator:a7a1c79c79a7a573c438aa45c4a531b96"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a323b2af320b01d0fdecfc515c75db747" id="r_a323b2af320b01d0fdecfc515c75db747"><td class="memItemLeft" align="right" valign="top">HRESULT </td><td class="memItemRight" valign="bottom"><a class="el" href="#a323b2af320b01d0fdecfc515c75db747">CreateResource3</a> (const <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">ALLOCATION_DESC</a> *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, DXGI_FORMAT *pCastableFormats, <a class="el" href="class_d3_d12_m_a_1_1_allocation.html">Allocation</a> **ppAllocation, REFIID riidResource, void **ppvResource)</td></tr> -<tr class="memdesc:a323b2af320b01d0fdecfc515c75db747"><td class="mdescLeft"> </td><td class="mdescRight">Similar to <a class="el" href="#a7a1c79c79a7a573c438aa45c4a531b96" title="Similar to Allocator::CreateResource, but supports new structure D3D12_RESOURCE_DESC1.">Allocator::CreateResource2</a>, but there are initial layout instead of state and castable formats list. <br /></td></tr> -<tr class="separator:a323b2af320b01d0fdecfc515c75db747"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:ab34796ba12e0aa05f4db80d8be5989a5" id="r_ab34796ba12e0aa05f4db80d8be5989a5"><td class="memItemLeft" align="right" valign="top">HRESULT </td><td class="memItemRight" valign="bottom"><a class="el" href="#ab34796ba12e0aa05f4db80d8be5989a5">CreateResource3</a> (const <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">ALLOCATION_DESC</a> *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, const DXGI_FORMAT *pCastableFormats, <a class="el" href="class_d3_d12_m_a_1_1_allocation.html">Allocation</a> **ppAllocation, REFIID riidResource, void **ppvResource)</td></tr> +<tr class="memdesc:ab34796ba12e0aa05f4db80d8be5989a5"><td class="mdescLeft"> </td><td class="mdescRight">Similar to <a class="el" href="#a7a1c79c79a7a573c438aa45c4a531b96" title="Similar to Allocator::CreateResource, but supports new structure D3D12_RESOURCE_DESC1.">Allocator::CreateResource2</a>, but there are initial layout instead of state and castable formats list. <br /></td></tr> +<tr class="separator:ab34796ba12e0aa05f4db80d8be5989a5"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:acb8a10a5ea30171ce60128286aec5ee2" id="r_acb8a10a5ea30171ce60128286aec5ee2"><td class="memItemLeft" align="right" valign="top">HRESULT </td><td class="memItemRight" valign="bottom"><a class="el" href="#acb8a10a5ea30171ce60128286aec5ee2">AllocateMemory</a> (const <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">ALLOCATION_DESC</a> *pAllocDesc, const D3D12_RESOURCE_ALLOCATION_INFO *pAllocInfo, <a class="el" href="class_d3_d12_m_a_1_1_allocation.html">Allocation</a> **ppAllocation)</td></tr> <tr class="memdesc:acb8a10a5ea30171ce60128286aec5ee2"><td class="mdescLeft"> </td><td class="mdescRight">Allocates memory without creating any resource placed in it. <br /></td></tr> <tr class="separator:acb8a10a5ea30171ce60128286aec5ee2"><td class="memSeparator" colspan="2"> </td></tr> @@ -141,9 +141,9 @@ <tr class="memitem:ad3b83cc5707cb4ed92bc277069c4ddd6" id="r_ad3b83cc5707cb4ed92bc277069c4ddd6"><td class="memItemLeft" align="right" valign="top">HRESULT </td><td class="memItemRight" valign="bottom"><a class="el" href="#ad3b83cc5707cb4ed92bc277069c4ddd6">CreateAliasingResource1</a> (<a class="el" href="class_d3_d12_m_a_1_1_allocation.html">Allocation</a> *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riidResource, void **ppvResource)</td></tr> <tr class="memdesc:ad3b83cc5707cb4ed92bc277069c4ddd6"><td class="mdescLeft"> </td><td class="mdescRight">Similar to <a class="el" href="#ab45536f92410aedb7be44ea36b1b4717" title="Creates a new resource in place of an existing allocation. This is useful for memory aliasing.">Allocator::CreateAliasingResource</a>, but supports new structure <code>D3D12_RESOURCE_DESC1</code>. <br /></td></tr> <tr class="separator:ad3b83cc5707cb4ed92bc277069c4ddd6"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a562cbaa71cbd333cade09cd67ed82453" id="r_a562cbaa71cbd333cade09cd67ed82453"><td class="memItemLeft" align="right" valign="top">HRESULT </td><td class="memItemRight" valign="bottom"><a class="el" href="#a562cbaa71cbd333cade09cd67ed82453">CreateAliasingResource2</a> (<a class="el" href="class_d3_d12_m_a_1_1_allocation.html">Allocation</a> *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, DXGI_FORMAT *pCastableFormats, REFIID riidResource, void **ppvResource)</td></tr> -<tr class="memdesc:a562cbaa71cbd333cade09cd67ed82453"><td class="mdescLeft"> </td><td class="mdescRight">Similar to <a class="el" href="#ad3b83cc5707cb4ed92bc277069c4ddd6" title="Similar to Allocator::CreateAliasingResource, but supports new structure D3D12_RESOURCE_DESC1.">Allocator::CreateAliasingResource1</a>, but there are initial layout instead of state and castable formats list. <br /></td></tr> -<tr class="separator:a562cbaa71cbd333cade09cd67ed82453"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a8af77401efadf6b81f0b50bdb7d0475a" id="r_a8af77401efadf6b81f0b50bdb7d0475a"><td class="memItemLeft" align="right" valign="top">HRESULT </td><td class="memItemRight" valign="bottom"><a class="el" href="#a8af77401efadf6b81f0b50bdb7d0475a">CreateAliasingResource2</a> (<a class="el" href="class_d3_d12_m_a_1_1_allocation.html">Allocation</a> *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, const DXGI_FORMAT *pCastableFormats, REFIID riidResource, void **ppvResource)</td></tr> +<tr class="memdesc:a8af77401efadf6b81f0b50bdb7d0475a"><td class="mdescLeft"> </td><td class="mdescRight">Similar to <a class="el" href="#ad3b83cc5707cb4ed92bc277069c4ddd6" title="Similar to Allocator::CreateAliasingResource, but supports new structure D3D12_RESOURCE_DESC1.">Allocator::CreateAliasingResource1</a>, but there are initial layout instead of state and castable formats list. <br /></td></tr> +<tr class="separator:a8af77401efadf6b81f0b50bdb7d0475a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aac7b1f6bf53cbf4c4ce2264cb72ca515" id="r_aac7b1f6bf53cbf4c4ce2264cb72ca515"><td class="memItemLeft" align="right" valign="top">HRESULT </td><td class="memItemRight" valign="bottom"><a class="el" href="#aac7b1f6bf53cbf4c4ce2264cb72ca515">CreatePool</a> (const <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">POOL_DESC</a> *pPoolDesc, <a class="el" href="class_d3_d12_m_a_1_1_pool.html">Pool</a> **ppPool)</td></tr> <tr class="memdesc:aac7b1f6bf53cbf4c4ce2264cb72ca515"><td class="mdescLeft"> </td><td class="mdescRight">Creates custom pool. <br /></td></tr> <tr class="separator:aac7b1f6bf53cbf4c4ce2264cb72ca515"><td class="memSeparator" colspan="2"> </td></tr> @@ -396,8 +396,8 @@ </div> </div> -<a id="a562cbaa71cbd333cade09cd67ed82453" name="a562cbaa71cbd333cade09cd67ed82453"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a562cbaa71cbd333cade09cd67ed82453">◆ </a></span>CreateAliasingResource2()</h2> +<a id="a8af77401efadf6b81f0b50bdb7d0475a" name="a8af77401efadf6b81f0b50bdb7d0475a"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a8af77401efadf6b81f0b50bdb7d0475a">◆ </a></span>CreateAliasingResource2()</h2> <div class="memitem"> <div class="memproto"> @@ -435,7 +435,7 @@ <tr> <td class="paramkey"></td> <td></td> - <td class="paramtype">DXGI_FORMAT *</td> <td class="paramname"><span class="paramname"><em>pCastableFormats</em></span>, </td> + <td class="paramtype">const DXGI_FORMAT *</td> <td class="paramname"><span class="paramname"><em>pCastableFormats</em></span>, </td> </tr> <tr> <td class="paramkey"></td> @@ -452,7 +452,7 @@ <p>Similar to <a class="el" href="#ad3b83cc5707cb4ed92bc277069c4ddd6" title="Similar to Allocator::CreateAliasingResource, but supports new structure D3D12_RESOURCE_DESC1.">Allocator::CreateAliasingResource1</a>, but there are initial layout instead of state and castable formats list. </p> <p>It internally uses <code>ID3D12Device10::CreatePlacedResource2</code>.</p> -<p>To work correctly, <code>ID3D12Device10</code> interface must be available in the current system. Otherwise, <code>E_NOINTERFACE</code> is returned. </p> +<p>To work correctly, <code>ID3D12Device10</code> interface must be available in the current system. Otherwise, <code>E_NOINTERFACE</code> is returned. If you use <code>pCastableFormats</code>, <code>ID3D12Device12</code> must albo be available. </p> </div> </div> @@ -593,8 +593,8 @@ </div> </div> -<a id="a323b2af320b01d0fdecfc515c75db747" name="a323b2af320b01d0fdecfc515c75db747"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a323b2af320b01d0fdecfc515c75db747">◆ </a></span>CreateResource3()</h2> +<a id="ab34796ba12e0aa05f4db80d8be5989a5" name="ab34796ba12e0aa05f4db80d8be5989a5"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ab34796ba12e0aa05f4db80d8be5989a5">◆ </a></span>CreateResource3()</h2> <div class="memitem"> <div class="memproto"> @@ -627,7 +627,7 @@ <tr> <td class="paramkey"></td> <td></td> - <td class="paramtype">DXGI_FORMAT *</td> <td class="paramname"><span class="paramname"><em>pCastableFormats</em></span>, </td> + <td class="paramtype">const DXGI_FORMAT *</td> <td class="paramname"><span class="paramname"><em>pCastableFormats</em></span>, </td> </tr> <tr> <td class="paramkey"></td> @@ -649,7 +649,7 @@ <p>Similar to <a class="el" href="#a7a1c79c79a7a573c438aa45c4a531b96" title="Similar to Allocator::CreateResource, but supports new structure D3D12_RESOURCE_DESC1.">Allocator::CreateResource2</a>, but there are initial layout instead of state and castable formats list. </p> <p>It internally uses <code>ID3D12Device10::CreateCommittedResource3</code> or <code>ID3D12Device10::CreatePlacedResource2</code>.</p> -<p>To work correctly, <code>ID3D12Device10</code> interface must be available in the current system. Otherwise, <code>E_NOINTERFACE</code> is returned. </p> +<p>To work correctly, <code>ID3D12Device10</code> interface must be available in the current system. Otherwise, <code>E_NOINTERFACE</code> is returned. If you use <code>pCastableFormats</code>, <code>ID3D12Device12</code> must albo be available. </p> </div> </div>
diff --git a/docs/html/doxygen_crawl.html b/docs/html/doxygen_crawl.html index 4abdf1d..29ca473 100644 --- a/docs/html/doxygen_crawl.html +++ b/docs/html/doxygen_crawl.html
@@ -52,20 +52,20 @@ <a href="class_d3_d12_m_a_1_1_allocator.html#a08e1468f1dbb63ce3bf6680e592b2143"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a1ac113daec5f6ef28ecb1786cf544144"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a29716b3084916abed7793bf2ec4b65db"/> -<a href="class_d3_d12_m_a_1_1_allocator.html#a323b2af320b01d0fdecfc515c75db747"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a3f3fd1e88cf2cd02257fe272e08a273c"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a434ae3147209953253da26687bfd62dc"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a468ba0c93121eaaee402b08775f1dd11"/> -<a href="class_d3_d12_m_a_1_1_allocator.html#a562cbaa71cbd333cade09cd67ed82453"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a6e114ef3b4a791a3bf2e3109a3971559"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a7a1c79c79a7a573c438aa45c4a531b96"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a8392663494384c16d8bfa12b827b4f9c"/> +<a href="class_d3_d12_m_a_1_1_allocator.html#a8af77401efadf6b81f0b50bdb7d0475a"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a968f13f23d03e50cc50b87835b6d5a85"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a99db00df909963573a976c203b107d22"/> <a href="class_d3_d12_m_a_1_1_allocator.html#a9e742884bd45dd7f01193d13fcd05af0"/> <a href="class_d3_d12_m_a_1_1_allocator.html#aa37d6b9fe8ea0864f7a35b9d68e8345a"/> <a href="class_d3_d12_m_a_1_1_allocator.html#aaa45caad0db0173735281fcdf9aa5e8b"/> <a href="class_d3_d12_m_a_1_1_allocator.html#aac7b1f6bf53cbf4c4ce2264cb72ca515"/> +<a href="class_d3_d12_m_a_1_1_allocator.html#ab34796ba12e0aa05f4db80d8be5989a5"/> <a href="class_d3_d12_m_a_1_1_allocator.html#ab45536f92410aedb7be44ea36b1b4717"/> <a href="class_d3_d12_m_a_1_1_allocator.html#acb8a10a5ea30171ce60128286aec5ee2"/> <a href="class_d3_d12_m_a_1_1_allocator.html#ad3b83cc5707cb4ed92bc277069c4ddd6"/>
diff --git a/docs/html/functions.html b/docs/html/functions.html index a5084eb..e65aff8 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html
@@ -121,12 +121,12 @@ <li>CPOOL_DESC() : <a class="el" href="struct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c.html#afc1fdbbf07c54943a70b95f122adb0d2">D3D12MA::CPOOL_DESC</a></li> <li>CreateAliasingResource() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#ab45536f92410aedb7be44ea36b1b4717">D3D12MA::Allocator</a></li> <li>CreateAliasingResource1() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#ad3b83cc5707cb4ed92bc277069c4ddd6">D3D12MA::Allocator</a></li> -<li>CreateAliasingResource2() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a562cbaa71cbd333cade09cd67ed82453">D3D12MA::Allocator</a></li> +<li>CreateAliasingResource2() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a8af77401efadf6b81f0b50bdb7d0475a">D3D12MA::Allocator</a></li> <li>CreateAllocator : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a6e114ef3b4a791a3bf2e3109a3971559">D3D12MA::Allocator</a></li> <li>CreatePool() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#aac7b1f6bf53cbf4c4ce2264cb72ca515">D3D12MA::Allocator</a></li> <li>CreateResource() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#aa37d6b9fe8ea0864f7a35b9d68e8345a">D3D12MA::Allocator</a></li> <li>CreateResource2() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a7a1c79c79a7a573c438aa45c4a531b96">D3D12MA::Allocator</a></li> -<li>CreateResource3() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a323b2af320b01d0fdecfc515c75db747">D3D12MA::Allocator</a></li> +<li>CreateResource3() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#ab34796ba12e0aa05f4db80d8be5989a5">D3D12MA::Allocator</a></li> <li>CreateVirtualBlock : <a class="el" href="class_d3_d12_m_a_1_1_virtual_block.html#ae5650809a150e3283abd307c88ee45bb">D3D12MA::VirtualBlock</a></li> <li>CustomPool : <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#ab06b85f3cf3254f855b29264477e3934">D3D12MA::ALLOCATION_DESC</a></li> <li>CVIRTUAL_ALLOCATION_DESC() : <a class="el" href="struct_d3_d12_m_a_1_1_c_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#af7262b9e3178bb70416603aa32d4e8c6">D3D12MA::CVIRTUAL_ALLOCATION_DESC</a></li>
diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index a4748d4..53490c0 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html
@@ -106,11 +106,11 @@ <li>CPOOL_DESC() : <a class="el" href="struct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c.html#afc1fdbbf07c54943a70b95f122adb0d2">D3D12MA::CPOOL_DESC</a></li> <li>CreateAliasingResource() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#ab45536f92410aedb7be44ea36b1b4717">D3D12MA::Allocator</a></li> <li>CreateAliasingResource1() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#ad3b83cc5707cb4ed92bc277069c4ddd6">D3D12MA::Allocator</a></li> -<li>CreateAliasingResource2() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a562cbaa71cbd333cade09cd67ed82453">D3D12MA::Allocator</a></li> +<li>CreateAliasingResource2() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a8af77401efadf6b81f0b50bdb7d0475a">D3D12MA::Allocator</a></li> <li>CreatePool() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#aac7b1f6bf53cbf4c4ce2264cb72ca515">D3D12MA::Allocator</a></li> <li>CreateResource() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#aa37d6b9fe8ea0864f7a35b9d68e8345a">D3D12MA::Allocator</a></li> <li>CreateResource2() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a7a1c79c79a7a573c438aa45c4a531b96">D3D12MA::Allocator</a></li> -<li>CreateResource3() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a323b2af320b01d0fdecfc515c75db747">D3D12MA::Allocator</a></li> +<li>CreateResource3() : <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#ab34796ba12e0aa05f4db80d8be5989a5">D3D12MA::Allocator</a></li> <li>CVIRTUAL_ALLOCATION_DESC() : <a class="el" href="struct_d3_d12_m_a_1_1_c_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#af7262b9e3178bb70416603aa32d4e8c6">D3D12MA::CVIRTUAL_ALLOCATION_DESC</a></li> <li>CVIRTUAL_BLOCK_DESC() : <a class="el" href="struct_d3_d12_m_a_1_1_c_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a2871293dd04cadc9e8f10b5a5acb9b0c">D3D12MA::CVIRTUAL_BLOCK_DESC</a></li> </ul>
diff --git a/docs/html/index.html b/docs/html/index.html index ad11257..2f86e9c 100644 --- a/docs/html/index.html +++ b/docs/html/index.html
@@ -87,7 +87,7 @@ <div class="headertitle"><div class="title">D3D12 Memory Allocator </div></div> </div><!--header--> <div class="contents"> -<div class="textblock"><p><b>Version 2.1.0-development</b> (2024-07-05)</p> +<div class="textblock"><p><b>Version 3.0.0-development</b> (2025-??-??)</p> <p>Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved. <br /> License: MIT</p> <p>Documentation of all members: <a class="el" href="_d3_d12_mem_alloc_8h.html">D3D12MemAlloc.h</a></p>
diff --git a/docs/html/optimal_allocation.html b/docs/html/optimal_allocation.html index 79ef3ce..bb918cd 100644 --- a/docs/html/optimal_allocation.html +++ b/docs/html/optimal_allocation.html
@@ -166,8 +166,8 @@ <div class="ttc" id="a_d3_d12_mem_alloc_8h_html_ac3d50f134ad24c58df4a934b87847653"><div class="ttname"><a href="_d3_d12_mem_alloc_8h.html#ac3d50f134ad24c58df4a934b87847653">D3D12MA_RECOMMENDED_HEAP_FLAGS</a></div><div class="ttdeci">#define D3D12MA_RECOMMENDED_HEAP_FLAGS</div><div class="ttdoc">Set of flags recommended for use in D3D12MA::POOL_DESC::HeapFlags for optimal performance.</div><div class="ttdef"><b>Definition</b> D3D12MemAlloc.h:136</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:523</div></div> <div class="ttc" id="aclass_d3_d12_m_a_1_1_pool_html"><div class="ttname"><a href="class_d3_d12_m_a_1_1_pool.html">D3D12MA::Pool</a></div><div class="ttdoc">Custom memory pool.</div><div class="ttdef"><b>Definition</b> D3D12MemAlloc.h:992</div></div> -<div class="ttc" id="astruct_d3_d12_m_a_1_1_c_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_c_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::CALLOCATION_DESC</a></div><div class="ttdoc">Helper structure that helps with complete and conscise initialization of the D3D12MA::ALLOCATION_DESC...</div><div class="ttdef"><b>Definition</b> D3D12MemAlloc.h:1657</div></div> -<div class="ttc" id="astruct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c.html">D3D12MA::CPOOL_DESC</a></div><div class="ttdoc">Helper structure that helps with complete and conscise initialization of the D3D12MA::POOL_DESC struc...</div><div class="ttdef"><b>Definition</b> D3D12MemAlloc.h:1693</div></div> +<div class="ttc" id="astruct_d3_d12_m_a_1_1_c_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_c_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::CALLOCATION_DESC</a></div><div class="ttdoc">Helper structure that helps with complete and conscise initialization of the D3D12MA::ALLOCATION_DESC...</div><div class="ttdef"><b>Definition</b> D3D12MemAlloc.h:1659</div></div> +<div class="ttc" id="astruct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c_html"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c.html">D3D12MA::CPOOL_DESC</a></div><div class="ttdoc">Helper structure that helps with complete and conscise initialization of the D3D12MA::POOL_DESC struc...</div><div class="ttdef"><b>Definition</b> D3D12MemAlloc.h:1695</div></div> <div class="ttc" id="astruct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c_html_a2e6074af8c8ff7b957fe8d4b5036a5e6"><div class="ttname"><a href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a2e6074af8c8ff7b957fe8d4b5036a5e6">D3D12MA::POOL_DESC::ResidencyPriority</a></div><div class="ttdeci">D3D12_RESIDENCY_PRIORITY ResidencyPriority</div><div class="ttdoc">Residency priority to be set for all allocations made in this pool. Optional.</div><div class="ttdef"><b>Definition</b> D3D12MemAlloc.h:980</div></div> </div><!-- fragment --><p>When you have a committed allocation created, you can also set the residency priority of its resource using the D3D12 function:</p> <div class="fragment"><div class="line"><a class="code hl_class" href="class_d3_d12_m_a_1_1_allocation.html">D3D12MA::Allocation</a>* committedAlloc = ...</div>
diff --git a/docs/html/quick_start.html b/docs/html/quick_start.html index 83bd0e2..681260e 100644 --- a/docs/html/quick_start.html +++ b/docs/html/quick_start.html
@@ -286,7 +286,7 @@ <div class="line">HRESULT hr = allocator-><a class="code hl_function" href="class_d3_d12_m_a_1_1_allocator.html#aa37d6b9fe8ea0864f7a35b9d68e8345a">CreateResource</a>(&allocDesc, &resDesc,</div> <div class="line"> D3D12_RESOURCE_STATE_COMMON, NULL, &alloc, IID_PPV_ARGS(&res));</div> <div class="line"><span class="comment">// Check hr...</span></div> -<div class="ttc" id="astruct_d3_d12_m_a_1_1_c_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_c_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::CALLOCATION_DESC</a></div><div class="ttdoc">Helper structure that helps with complete and conscise initialization of the D3D12MA::ALLOCATION_DESC...</div><div class="ttdef"><b>Definition</b> D3D12MemAlloc.h:1657</div></div> +<div class="ttc" id="astruct_d3_d12_m_a_1_1_c_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_c_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html">D3D12MA::CALLOCATION_DESC</a></div><div class="ttdoc">Helper structure that helps with complete and conscise initialization of the D3D12MA::ALLOCATION_DESC...</div><div class="ttdef"><b>Definition</b> D3D12MemAlloc.h:1659</div></div> </div><!-- fragment --> </div></div><!-- contents --> </div><!-- PageDoc --> <!-- start footer part -->
diff --git a/docs/html/search/all_2.js b/docs/html/search/all_2.js index b2e6d90..3f36103 100644 --- a/docs/html/search/all_2.js +++ b/docs/html/search/all_2.js
@@ -13,12 +13,12 @@ ['cpu_20memory_20allocator_10',['Custom CPU memory allocator',['../configuration.html#custom_memory_allocator',1,'']]], ['createaliasingresource_11',['CreateAliasingResource',['../class_d3_d12_m_a_1_1_allocator.html#ab45536f92410aedb7be44ea36b1b4717',1,'D3D12MA::Allocator']]], ['createaliasingresource1_12',['CreateAliasingResource1',['../class_d3_d12_m_a_1_1_allocator.html#ad3b83cc5707cb4ed92bc277069c4ddd6',1,'D3D12MA::Allocator']]], - ['createaliasingresource2_13',['CreateAliasingResource2',['../class_d3_d12_m_a_1_1_allocator.html#a562cbaa71cbd333cade09cd67ed82453',1,'D3D12MA::Allocator']]], + ['createaliasingresource2_13',['CreateAliasingResource2',['../class_d3_d12_m_a_1_1_allocator.html#a8af77401efadf6b81f0b50bdb7d0475a',1,'D3D12MA::Allocator']]], ['createallocator_14',['CreateAllocator',['../class_d3_d12_m_a_1_1_allocator.html#a6e114ef3b4a791a3bf2e3109a3971559',1,'D3D12MA::Allocator::CreateAllocator()'],['../namespace_d3_d12_m_a.html#ab7a1cd1683986d75ce1488b0920f4cb0',1,'D3D12MA::CreateAllocator()']]], ['createpool_15',['CreatePool',['../class_d3_d12_m_a_1_1_allocator.html#aac7b1f6bf53cbf4c4ce2264cb72ca515',1,'D3D12MA::Allocator']]], ['createresource_16',['CreateResource',['../class_d3_d12_m_a_1_1_allocator.html#aa37d6b9fe8ea0864f7a35b9d68e8345a',1,'D3D12MA::Allocator']]], ['createresource2_17',['CreateResource2',['../class_d3_d12_m_a_1_1_allocator.html#a7a1c79c79a7a573c438aa45c4a531b96',1,'D3D12MA::Allocator']]], - ['createresource3_18',['CreateResource3',['../class_d3_d12_m_a_1_1_allocator.html#a323b2af320b01d0fdecfc515c75db747',1,'D3D12MA::Allocator']]], + ['createresource3_18',['CreateResource3',['../class_d3_d12_m_a_1_1_allocator.html#ab34796ba12e0aa05f4db80d8be5989a5',1,'D3D12MA::Allocator']]], ['createvirtualblock_19',['CreateVirtualBlock',['../class_d3_d12_m_a_1_1_virtual_block.html#ae5650809a150e3283abd307c88ee45bb',1,'D3D12MA::VirtualBlock::CreateVirtualBlock()'],['../namespace_d3_d12_m_a.html#ab024647ae85ee63e2fa2c1c4beac6d98',1,'D3D12MA::CreateVirtualBlock()']]], ['creating_20resources_20',['Creating resources',['../quick_start.html#quick_start_creating_resources',1,'']]], ['creating_20virtual_20block_21',['Creating virtual block',['../virtual_allocator.html#virtual_allocator_creating_virtual_block',1,'']]],
diff --git a/docs/html/search/functions_2.js b/docs/html/search/functions_2.js index 460101e..b844eae 100644 --- a/docs/html/search/functions_2.js +++ b/docs/html/search/functions_2.js
@@ -6,12 +6,12 @@ ['cpool_5fdesc_3',['CPOOL_DESC',['../struct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c.html#afc1fdbbf07c54943a70b95f122adb0d2',1,'D3D12MA::CPOOL_DESC::CPOOL_DESC()=default'],['../struct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c.html#ab2310e41ea92aa64dfab4a3366a60cc3',1,'D3D12MA::CPOOL_DESC::CPOOL_DESC(const POOL_DESC &o) noexcept'],['../struct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c.html#a5de61391fddfd37d91a0ec5cb7e84c1b',1,'D3D12MA::CPOOL_DESC::CPOOL_DESC(D3D12_HEAP_TYPE heapType, D3D12_HEAP_FLAGS heapFlags, POOL_FLAGS flags=D3D12MA_RECOMMENDED_POOL_FLAGS, UINT64 blockSize=0, UINT minBlockCount=0, UINT maxBlockCount=UINT_MAX, D3D12_RESIDENCY_PRIORITY residencyPriority=D3D12_RESIDENCY_PRIORITY_NORMAL) noexcept'],['../struct_d3_d12_m_a_1_1_c_p_o_o_l___d_e_s_c.html#a0d1e436a90bb4a07c55a5ecf60618be3',1,'D3D12MA::CPOOL_DESC::CPOOL_DESC(const D3D12_HEAP_PROPERTIES heapProperties, D3D12_HEAP_FLAGS heapFlags, POOL_FLAGS flags=D3D12MA_RECOMMENDED_POOL_FLAGS, UINT64 blockSize=0, UINT minBlockCount=0, UINT maxBlockCount=UINT_MAX, D3D12_RESIDENCY_PRIORITY residencyPriority=D3D12_RESIDENCY_PRIORITY_NORMAL) noexcept']]], ['createaliasingresource_4',['CreateAliasingResource',['../class_d3_d12_m_a_1_1_allocator.html#ab45536f92410aedb7be44ea36b1b4717',1,'D3D12MA::Allocator']]], ['createaliasingresource1_5',['CreateAliasingResource1',['../class_d3_d12_m_a_1_1_allocator.html#ad3b83cc5707cb4ed92bc277069c4ddd6',1,'D3D12MA::Allocator']]], - ['createaliasingresource2_6',['CreateAliasingResource2',['../class_d3_d12_m_a_1_1_allocator.html#a562cbaa71cbd333cade09cd67ed82453',1,'D3D12MA::Allocator']]], + ['createaliasingresource2_6',['CreateAliasingResource2',['../class_d3_d12_m_a_1_1_allocator.html#a8af77401efadf6b81f0b50bdb7d0475a',1,'D3D12MA::Allocator']]], ['createallocator_7',['CreateAllocator',['../namespace_d3_d12_m_a.html#ab7a1cd1683986d75ce1488b0920f4cb0',1,'D3D12MA']]], ['createpool_8',['CreatePool',['../class_d3_d12_m_a_1_1_allocator.html#aac7b1f6bf53cbf4c4ce2264cb72ca515',1,'D3D12MA::Allocator']]], ['createresource_9',['CreateResource',['../class_d3_d12_m_a_1_1_allocator.html#aa37d6b9fe8ea0864f7a35b9d68e8345a',1,'D3D12MA::Allocator']]], ['createresource2_10',['CreateResource2',['../class_d3_d12_m_a_1_1_allocator.html#a7a1c79c79a7a573c438aa45c4a531b96',1,'D3D12MA::Allocator']]], - ['createresource3_11',['CreateResource3',['../class_d3_d12_m_a_1_1_allocator.html#a323b2af320b01d0fdecfc515c75db747',1,'D3D12MA::Allocator']]], + ['createresource3_11',['CreateResource3',['../class_d3_d12_m_a_1_1_allocator.html#ab34796ba12e0aa05f4db80d8be5989a5',1,'D3D12MA::Allocator']]], ['createvirtualblock_12',['CreateVirtualBlock',['../namespace_d3_d12_m_a.html#ab024647ae85ee63e2fa2c1c4beac6d98',1,'D3D12MA']]], ['cvirtual_5fallocation_5fdesc_13',['CVIRTUAL_ALLOCATION_DESC',['../struct_d3_d12_m_a_1_1_c_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#af7262b9e3178bb70416603aa32d4e8c6',1,'D3D12MA::CVIRTUAL_ALLOCATION_DESC::CVIRTUAL_ALLOCATION_DESC()=default'],['../struct_d3_d12_m_a_1_1_c_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#abc6429b119b65f7cd3ed5c5bd4d36d85',1,'D3D12MA::CVIRTUAL_ALLOCATION_DESC::CVIRTUAL_ALLOCATION_DESC(const VIRTUAL_ALLOCATION_DESC &o) noexcept'],['../struct_d3_d12_m_a_1_1_c_v_i_r_t_u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#af72d9f4003fc6b86f76268aa8529d43a',1,'D3D12MA::CVIRTUAL_ALLOCATION_DESC::CVIRTUAL_ALLOCATION_DESC(UINT64 size, UINT64 alignment, VIRTUAL_ALLOCATION_FLAGS flags=VIRTUAL_ALLOCATION_FLAG_NONE, void *privateData=NULL) noexcept']]], ['cvirtual_5fblock_5fdesc_14',['CVIRTUAL_BLOCK_DESC',['../struct_d3_d12_m_a_1_1_c_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a2871293dd04cadc9e8f10b5a5acb9b0c',1,'D3D12MA::CVIRTUAL_BLOCK_DESC::CVIRTUAL_BLOCK_DESC()=default'],['../struct_d3_d12_m_a_1_1_c_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a223f6535756a128b7fe86f0aa10de9af',1,'D3D12MA::CVIRTUAL_BLOCK_DESC::CVIRTUAL_BLOCK_DESC(const VIRTUAL_BLOCK_DESC &o) noexcept'],['../struct_d3_d12_m_a_1_1_c_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html#a2984a0b07b432ed8baf387d5230b7112',1,'D3D12MA::CVIRTUAL_BLOCK_DESC::CVIRTUAL_BLOCK_DESC(UINT64 size, VIRTUAL_BLOCK_FLAGS flags=VIRTUAL_BLOCK_FLAG_NONE, const ALLOCATION_CALLBACKS *allocationCallbacks=NULL) noexcept']]]
diff --git a/docs/html/virtual_allocator.html b/docs/html/virtual_allocator.html index b3a8ad1..522c3c3 100644 --- a/docs/html/virtual_allocator.html +++ b/docs/html/virtual_allocator.html
@@ -105,9 +105,9 @@ <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 = CreateVirtualBlock(&blockDesc, &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:1575</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:1481</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:1489</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:1577</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:1483</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:1491</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. 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> @@ -132,8 +132,8 @@ <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:1526</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:1533</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:1528</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:1535</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:503</div></div> </div><!-- fragment --><h1><a class="anchor" id="virtual_allocator_deallocation"></a> Deallocation</h1> @@ -171,7 +171,7 @@ <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-><a class="code hl_function" href="class_d3_d12_m_a_1_1_virtual_block.html#a9281daf76e888ea1bd5247d5732e8179">Allocate</a>(&allocDesc, &alloc, &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:1538</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_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:1540</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>
diff --git a/include/D3D12MemAlloc.h b/include/D3D12MemAlloc.h index 8763305..97d9a46 100644 --- a/include/D3D12MemAlloc.h +++ b/include/D3D12MemAlloc.h
@@ -24,7 +24,7 @@ /** \mainpage D3D12 Memory Allocator -<b>Version 2.1.0-development</b> (2024-07-05) +<b>Version 3.0.0-development</b> (2025-??-??) Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved. \n License: MIT