Skip to content

Commit 0fa62ed

Browse files
authored
Merge pull request #87 from sawickiap/master
New updates to D3D12 Memory Allocator (v3.1.0)
2 parents c06cd9a + 4615099 commit 0fa62ed

File tree

99 files changed

+745
-651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+745
-651
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 3.1.0 (2026-02-23)
2+
3+
- Added supported for resource tight alignment (feature added in Agility SDK 1.618.1). It is used automatically when available.
4+
- Added function `Allocator::IsTightAlignmentSupported`.
5+
- Added `ALLOCATOR_FLAG_DONT_USE_TIGHT_ALIGNMENT`.
6+
- Fixes and improvements in the internal function `AllocatorPimpl::GetResourceAllocationInfo` (which decides when to use small alignment or tight alignment), including:
7+
- Added support for 1D and 3D textures when `D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT = 2` (#78, #79).
8+
- Fix for cases when `D3D12_TEXTURE_LAYOUT_64KB_*_SWIZZLE` is used (#86).
9+
- Fixes for build errors in MinGW (#77).
10+
- Fixes and improvements in documentation and tests.
11+
112
# 3.0.1 (2025-05-08)
213

314
- Fixed macros `D3D12MA_RECOMMENDED_ALLOCATOR_FLAGS`, `D3D12MA_RECOMMENDED_POOL_FLAGS` (#73).

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.25)
22

3-
project(D3D12MemoryAllocator VERSION 3.0.2)
3+
project(D3D12MemoryAllocator VERSION 3.1.0)
44

55
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
66

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
1+
Copyright (c) 2019-2026 Advanced Micro Devices, Inc. All rights reserved.
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

bin/D3D12Sample.exe

-300 KB
Binary file not shown.

docs/html/_d3_d12_mem_alloc_8h.html

Lines changed: 56 additions & 56 deletions
Large diffs are not rendered by default.

docs/html/annotated.html

Lines changed: 27 additions & 27 deletions
Large diffs are not rendered by default.

docs/html/class_d3_d12_m_a_1_1_allocation-members.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
55
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
6-
<meta name="generator" content="Doxygen 1.14.0"/>
6+
<meta name="generator" content="Doxygen 1.16.1"/>
77
<meta name="viewport" content="width=device-width, initial-scale=1"/>
88
<title>D3D12 Memory Allocator: Member List</title>
99
<link href="tabs.css" rel="stylesheet" type="text/css"/>
@@ -31,7 +31,7 @@
3131
</table>
3232
</div>
3333
<!-- end header part -->
34-
<!-- Generated by Doxygen 1.14.0 -->
34+
<!-- Generated by Doxygen 1.16.1 -->
3535
<script type="text/javascript">
3636
var searchBox = new SearchBox("searchBox", "search/",'.html');
3737
</script>
@@ -104,7 +104,7 @@
104104
</table></div><!-- contents -->
105105
<!-- start footer part -->
106106
<hr class="footer"/><address class="footer"><small>
107-
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.14.0
107+
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.16.1
108108
</small></address>
109109
</div><!-- doc-content -->
110110
</body>

docs/html/class_d3_d12_m_a_1_1_allocation.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
55
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
6-
<meta name="generator" content="Doxygen 1.14.0"/>
6+
<meta name="generator" content="Doxygen 1.16.1"/>
77
<meta name="viewport" content="width=device-width, initial-scale=1"/>
88
<title>D3D12 Memory Allocator: D3D12MA::Allocation Class Reference</title>
99
<link href="tabs.css" rel="stylesheet" type="text/css"/>
@@ -31,7 +31,7 @@
3131
</table>
3232
</div>
3333
<!-- end header part -->
34-
<!-- Generated by Doxygen 1.14.0 -->
34+
<!-- Generated by Doxygen 1.16.1 -->
3535
<script type="text/javascript">
3636
var searchBox = new SearchBox("searchBox", "search/",'.html');
3737
</script>
@@ -95,25 +95,25 @@
9595
<table class="memberdecls">
9696
<tr class="heading"><td colspan="2"><h2 id="header-pub-methods" class="groupheader"><a id="pub-methods" name="pub-methods"></a>
9797
Public Member Functions</h2></td></tr>
98-
<tr class="memitem:a47be9557d441797b65de177a3d5cdf60" id="r_a47be9557d441797b65de177a3d5cdf60"><td class="memItemLeft" align="right" valign="top">UINT64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a47be9557d441797b65de177a3d5cdf60">GetOffset</a> () const</td></tr>
98+
<tr class="memitem:a47be9557d441797b65de177a3d5cdf60" id="r_a47be9557d441797b65de177a3d5cdf60"><td class="memItemLeft">UINT64&#160;</td><td class="memItemRight"><a class="el" href="#a47be9557d441797b65de177a3d5cdf60">GetOffset</a> () const</td></tr>
9999
<tr class="memdesc:a47be9557d441797b65de177a3d5cdf60"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns offset in bytes from the start of memory heap. <br /></td></tr>
100-
<tr class="memitem:a0acdc6b31e957b6d83762bdaace6d255" id="r_a0acdc6b31e957b6d83762bdaace6d255"><td class="memItemLeft" align="right" valign="top">UINT64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0acdc6b31e957b6d83762bdaace6d255">GetAlignment</a> () const</td></tr>
100+
<tr class="memitem:a0acdc6b31e957b6d83762bdaace6d255" id="r_a0acdc6b31e957b6d83762bdaace6d255"><td class="memItemLeft">UINT64&#160;</td><td class="memItemRight"><a class="el" href="#a0acdc6b31e957b6d83762bdaace6d255">GetAlignment</a> () const</td></tr>
101101
<tr class="memdesc:a0acdc6b31e957b6d83762bdaace6d255"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns alignment that resource was created with. <br /></td></tr>
102-
<tr class="memitem:a92c2fb6f22b28817eb83a59407d7dd30" id="r_a92c2fb6f22b28817eb83a59407d7dd30"><td class="memItemLeft" align="right" valign="top">UINT64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a92c2fb6f22b28817eb83a59407d7dd30">GetSize</a> () const</td></tr>
102+
<tr class="memitem:a92c2fb6f22b28817eb83a59407d7dd30" id="r_a92c2fb6f22b28817eb83a59407d7dd30"><td class="memItemLeft">UINT64&#160;</td><td class="memItemRight"><a class="el" href="#a92c2fb6f22b28817eb83a59407d7dd30">GetSize</a> () const</td></tr>
103103
<tr class="memdesc:a92c2fb6f22b28817eb83a59407d7dd30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns size in bytes of the allocation. <br /></td></tr>
104-
<tr class="memitem:ad00308118252f82d8f803c623c67bf18" id="r_ad00308118252f82d8f803c623c67bf18"><td class="memItemLeft" align="right" valign="top">ID3D12Resource *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad00308118252f82d8f803c623c67bf18">GetResource</a> () const</td></tr>
104+
<tr class="memitem:ad00308118252f82d8f803c623c67bf18" id="r_ad00308118252f82d8f803c623c67bf18"><td class="memItemLeft">ID3D12Resource *&#160;</td><td class="memItemRight"><a class="el" href="#ad00308118252f82d8f803c623c67bf18">GetResource</a> () const</td></tr>
105105
<tr class="memdesc:ad00308118252f82d8f803c623c67bf18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns D3D12 resource associated with this object. <br /></td></tr>
106-
<tr class="memitem:a414a088c22bae0f29b1038f5f9346d14" id="r_a414a088c22bae0f29b1038f5f9346d14"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a414a088c22bae0f29b1038f5f9346d14">SetResource</a> (ID3D12Resource *pResource)</td></tr>
106+
<tr class="memitem:a414a088c22bae0f29b1038f5f9346d14" id="r_a414a088c22bae0f29b1038f5f9346d14"><td class="memItemLeft">void&#160;</td><td class="memItemRight"><a class="el" href="#a414a088c22bae0f29b1038f5f9346d14">SetResource</a> (ID3D12Resource *pResource)</td></tr>
107107
<tr class="memdesc:a414a088c22bae0f29b1038f5f9346d14"><td class="mdescLeft">&#160;</td><td class="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>
108-
<tr class="memitem:adca8d5a82bed492fe7265fcda6e53da2" id="r_adca8d5a82bed492fe7265fcda6e53da2"><td class="memItemLeft" align="right" valign="top">ID3D12Heap *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adca8d5a82bed492fe7265fcda6e53da2">GetHeap</a> () const</td></tr>
108+
<tr class="memitem:adca8d5a82bed492fe7265fcda6e53da2" id="r_adca8d5a82bed492fe7265fcda6e53da2"><td class="memItemLeft">ID3D12Heap *&#160;</td><td class="memItemRight"><a class="el" href="#adca8d5a82bed492fe7265fcda6e53da2">GetHeap</a> () const</td></tr>
109109
<tr class="memdesc:adca8d5a82bed492fe7265fcda6e53da2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns memory heap that the resource is created in. <br /></td></tr>
110-
<tr class="memitem:a6f209094455dd876b6d9f84076ee1436" id="r_a6f209094455dd876b6d9f84076ee1436"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6f209094455dd876b6d9f84076ee1436">SetPrivateData</a> (void *pPrivateData)</td></tr>
110+
<tr class="memitem:a6f209094455dd876b6d9f84076ee1436" id="r_a6f209094455dd876b6d9f84076ee1436"><td class="memItemLeft">void&#160;</td><td class="memItemRight"><a class="el" href="#a6f209094455dd876b6d9f84076ee1436">SetPrivateData</a> (void *pPrivateData)</td></tr>
111111
<tr class="memdesc:a6f209094455dd876b6d9f84076ee1436"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes custom pointer for an allocation to a new value. <br /></td></tr>
112-
<tr class="memitem:ae45eed901de5d16afe179f883028c5ee" id="r_ae45eed901de5d16afe179f883028c5ee"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae45eed901de5d16afe179f883028c5ee">GetPrivateData</a> () const</td></tr>
112+
<tr class="memitem:ae45eed901de5d16afe179f883028c5ee" id="r_ae45eed901de5d16afe179f883028c5ee"><td class="memItemLeft">void *&#160;</td><td class="memItemRight"><a class="el" href="#ae45eed901de5d16afe179f883028c5ee">GetPrivateData</a> () const</td></tr>
113113
<tr class="memdesc:ae45eed901de5d16afe179f883028c5ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get custom pointer associated with the allocation. <br /></td></tr>
114-
<tr class="memitem:af9e643276b577aa7f21937f75d4b82ac" id="r_af9e643276b577aa7f21937f75d4b82ac"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af9e643276b577aa7f21937f75d4b82ac">SetName</a> (LPCWSTR Name)</td></tr>
114+
<tr class="memitem:af9e643276b577aa7f21937f75d4b82ac" id="r_af9e643276b577aa7f21937f75d4b82ac"><td class="memItemLeft">void&#160;</td><td class="memItemRight"><a class="el" href="#af9e643276b577aa7f21937f75d4b82ac">SetName</a> (LPCWSTR Name)</td></tr>
115115
<tr class="memdesc:af9e643276b577aa7f21937f75d4b82ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Associates a name with the allocation object. This name is for use in debug diagnostics and tools. <br /></td></tr>
116-
<tr class="memitem:a65fab0c479df1b6b72c9300e68dc6770" id="r_a65fab0c479df1b6b72c9300e68dc6770"><td class="memItemLeft" align="right" valign="top">LPCWSTR&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a65fab0c479df1b6b72c9300e68dc6770">GetName</a> () const</td></tr>
116+
<tr class="memitem:a65fab0c479df1b6b72c9300e68dc6770" id="r_a65fab0c479df1b6b72c9300e68dc6770"><td class="memItemLeft">LPCWSTR&#160;</td><td class="memItemRight"><a class="el" href="#a65fab0c479df1b6b72c9300e68dc6770">GetName</a> () const</td></tr>
117117
<tr class="memdesc:a65fab0c479df1b6b72c9300e68dc6770"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the name associated with the allocation object. <br /></td></tr>
118118
</table>
119119
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
@@ -371,7 +371,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a414a088c22bae0f29b1038f5
371371
</div><div class="memdoc">
372372

373373
<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>
374-
<dl class="section warning"><dt>Warning</dt><dd>This is an advanced feature that should be used only in special cases, e.g. during <a class="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, <a class="el" href="statistics.html">Statistics</a> and budgets can be calculated incorrectly. </dd></dl>
374+
<dl class="section warning"><dt>Warning</dt><dd>This is an advanced feature that should be used only in special cases, e.g. during <a class="el" href="defragmentation.html" title="Defragmentation">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, <a class="el" href="statistics.html" title="Statistics">Statistics</a> and budgets can be calculated incorrectly. </dd></dl>
375375

376376
</div>
377377
</div>
@@ -481,7 +481,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a6f31560bc71451410a2a907b
481481
<div class="memproto">
482482
<table class="memname">
483483
<tr>
484-
<td class="memname"><a class="el" href="class_d3_d12_m_a_1_1_allocation.html">Allocation</a>* D3D12MA::Allocation::next</td>
484+
<td class="memname">Allocation* D3D12MA::Allocation::next</td>
485485
</tr>
486486
</table>
487487
</div><div class="memdoc">
@@ -495,7 +495,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#adc3ac89758a915a409e047f9
495495
<div class="memproto">
496496
<table class="memname">
497497
<tr>
498-
<td class="memname"><a class="el" href="class_d3_d12_m_a_1_1_allocation.html">Allocation</a>* D3D12MA::Allocation::prev</td>
498+
<td class="memname">Allocation* D3D12MA::Allocation::prev</td>
499499
</tr>
500500
</table>
501501
</div><div class="memdoc">
@@ -508,7 +508,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#adc3ac89758a915a409e047f9
508508
</div><!-- contents -->
509509
<!-- start footer part -->
510510
<hr class="footer"/><address class="footer"><small>
511-
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.14.0
511+
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.16.1
512512
</small></address>
513513
</div><!-- doc-content -->
514514
</body>

docs/html/class_d3_d12_m_a_1_1_allocator-members.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
55
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
6-
<meta name="generator" content="Doxygen 1.14.0"/>
6+
<meta name="generator" content="Doxygen 1.16.1"/>
77
<meta name="viewport" content="width=device-width, initial-scale=1"/>
88
<title>D3D12 Memory Allocator: Member List</title>
99
<link href="tabs.css" rel="stylesheet" type="text/css"/>
@@ -31,7 +31,7 @@
3131
</table>
3232
</div>
3333
<!-- end header part -->
34-
<!-- Generated by Doxygen 1.14.0 -->
34+
<!-- Generated by Doxygen 1.16.1 -->
3535
<script type="text/javascript">
3636
var searchBox = new SearchBox("searchBox", "search/",'.html');
3737
</script>
@@ -106,7 +106,7 @@
106106
</table></div><!-- contents -->
107107
<!-- start footer part -->
108108
<hr class="footer"/><address class="footer"><small>
109-
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.14.0
109+
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.16.1
110110
</small></address>
111111
</div><!-- doc-content -->
112112
</body>

0 commit comments

Comments
 (0)