diff --git a/CHANGELOG.md b/CHANGELOG.md
index 21c20af..e188f0c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,14 @@
-# 1.0.0 (2019-09-02)
+# 2.0.0 (2022-03-25)
+
+So much has changed since the first release that it doesn’t make much sense to compare the differences. Here are the most important features that the library now provides:
+
+- Powerful custom pools, which give an opportunity to not only keep certain resources together, reserve some minimum or limit the maximum amount of memory they can take, but also to pass additional allocation parameters unavailable to simple allocations. Among them, probably the most interesting is `POOL_DESC::HeapProperties`, which allows you to specify parameters of a custom memory type, which may be useful on UMA platforms. Committed allocations can now also be created in custom pools.
+- The API for statistics and budget has been redesigned - see structures `Statistics`, `Budget`, `DetailedStatistics`, `TotalStatistics`.
+- The library exposes its core allocation algorithm via the “virtual allocator” interface. This can be used to allocate pieces of custom memory or whatever you like, even something completely unrelated to graphics.
+- The allocation algorithm has been replaced with the new, more efficient TLSF.
+- Added support for defragmentation.
+- Objects of the library can be used with smart pointers designed for COM objects.
+
+# 1.0.0 (2019-09-02)
First published version.
diff --git a/bin/D3D12Sample_Release_vs2019.exe b/bin/D3D12Sample_Release_vs2019.exe
index 5b0b991..a515894 100644
Binary files a/bin/D3D12Sample_Release_vs2019.exe and b/bin/D3D12Sample_Release_vs2019.exe differ
diff --git a/docs/html/_d3_d12_mem_alloc_8h.html b/docs/html/_d3_d12_mem_alloc_8h.html
index 9492ee2..975b912 100644
--- a/docs/html/_d3_d12_mem_alloc_8h.html
+++ b/docs/html/_d3_d12_mem_alloc_8h.html
@@ -205,14 +205,19 @@ Enumerations
enum D3D12MA::POOL_FLAGS { D3D12MA::POOL_FLAG_NONE = 0
, D3D12MA::POOL_FLAG_ALGORITHM_LINEAR = 0x1
+, D3D12MA::POOL_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED = 0x2
, D3D12MA::POOL_FLAG_ALGORITHM_MASK = POOL_FLAG_ALGORITHM_LINEAR
}
Bit flags to be used with POOL_DESC::Flags. More...
-enum D3D12MA::ALLOCATOR_FLAGS { D3D12MA::ALLOCATOR_FLAG_NONE = 0
+enum D3D12MA::ALLOCATOR_FLAGS {
+ D3D12MA::ALLOCATOR_FLAG_NONE = 0
, D3D12MA::ALLOCATOR_FLAG_SINGLETHREADED = 0x1
, D3D12MA::ALLOCATOR_FLAG_ALWAYS_COMMITTED = 0x2
, D3D12MA::ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED = 0x4
+,
+ D3D12MA::ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED = 0x8
+
}
Bit flags to be used with ALLOCATOR_DESC::Flags. More...
diff --git a/docs/html/configuration.html b/docs/html/configuration.html
index a914bfc..c9a759a 100644
--- a/docs/html/configuration.html
+++ b/docs/html/configuration.html
@@ -101,15 +101,15 @@ Custom CPU memory allocator
-Represents main object of this library initialized for particular ID3D12Device.
Definition: D3D12MemAlloc.h:1055
+Represents main object of this library initialized for particular ID3D12Device.
Definition: D3D12MemAlloc.h:1067
D3D12MA_API HRESULT CreateAllocator(const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)
Creates new main D3D12MA::Allocator object and returns it through ppAllocator.
Custom callbacks to CPU memory allocation functions.
Definition: D3D12MemAlloc.h:187
FREE_FUNC_PTR pFree
Dellocation function.
Definition: D3D12MemAlloc.h:191
ALLOCATE_FUNC_PTR pAllocate
Allocation function.
Definition: D3D12MemAlloc.h:189
-Parameters of created Allocator object. To be used with CreateAllocator().
Definition: D3D12MemAlloc.h:1016
-const ALLOCATION_CALLBACKS * pAllocationCallbacks
Custom CPU memory allocation callbacks. Optional.
Definition: D3D12MemAlloc.h:1036
-IDXGIAdapter * pAdapter
Definition: D3D12MemAlloc.h:1042
-ID3D12Device * pDevice
Definition: D3D12MemAlloc.h:1024
+Parameters of created Allocator object. To be used with CreateAllocator().
Definition: D3D12MemAlloc.h:1028
+const ALLOCATION_CALLBACKS * pAllocationCallbacks
Custom CPU memory allocation callbacks. Optional.
Definition: D3D12MemAlloc.h:1048
+IDXGIAdapter * pAdapter
Definition: D3D12MemAlloc.h:1054
+ID3D12Device * pDevice
Definition: D3D12MemAlloc.h:1036
Debug margins
By default, allocations are laid out in memory blocks next to each other if possible (considering required alignment returned by ID3D12Device::GetResourceAllocationInfo
).
diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html
index 2855492..1909bf0 100644
--- a/docs/html/defragmentation.html
+++ b/docs/html/defragmentation.html
@@ -127,19 +127,19 @@ $(function() {
defragCtx->Release();
void SetResource(ID3D12Resource *pResource)
Releases the resource currently pointed by the allocation (if any), sets it to new one,...
UINT64 GetOffset() const
Returns offset in bytes from the start of memory heap.
-ID3D12Resource * GetResource() const
Returns D3D12 resource associated with this object.
Definition: D3D12MemAlloc.h:493
+ID3D12Resource * GetResource() const
Returns D3D12 resource associated with this object.
Definition: D3D12MemAlloc.h:490
ID3D12Heap * GetHeap() const
Returns memory heap that the resource is created in.
-Represents defragmentation process in progress.
Definition: D3D12MemAlloc.h:773
+Represents defragmentation process in progress.
Definition: D3D12MemAlloc.h:769
HRESULT BeginPass(DEFRAGMENTATION_PASS_MOVE_INFO *pPassInfo)
Starts single defragmentation pass.
HRESULT EndPass(DEFRAGMENTATION_PASS_MOVE_INFO *pPassInfo)
Ends single defragmentation pass.
-@ DEFRAGMENTATION_FLAG_ALGORITHM_FAST
Definition: D3D12MemAlloc.h:653
-Parameters for defragmentation.
Definition: D3D12MemAlloc.h:675
-DEFRAGMENTATION_FLAGS Flags
Flags.
Definition: D3D12MemAlloc.h:677
-Allocation * pSrcAllocation
Allocation that should be moved.
Definition: D3D12MemAlloc.h:711
-Allocation * pDstTmpAllocation
Temporary allocation pointing to destination memory that will replace pSrcAllocation.
Definition: D3D12MemAlloc.h:719
-Parameters for incremental defragmentation steps.
Definition: D3D12MemAlloc.h:727
-DEFRAGMENTATION_MOVE * pMoves
Array of moves to be performed by the user in the current defragmentation pass.
Definition: D3D12MemAlloc.h:751
-UINT32 MoveCount
Number of elements in the pMoves array.
Definition: D3D12MemAlloc.h:729
+@ DEFRAGMENTATION_FLAG_ALGORITHM_FAST
Definition: D3D12MemAlloc.h:649
+Parameters for defragmentation.
Definition: D3D12MemAlloc.h:671
+DEFRAGMENTATION_FLAGS Flags
Flags.
Definition: D3D12MemAlloc.h:673
+Allocation * pSrcAllocation
Allocation that should be moved.
Definition: D3D12MemAlloc.h:707
+Allocation * pDstTmpAllocation
Temporary allocation pointing to destination memory that will replace pSrcAllocation.
Definition: D3D12MemAlloc.h:715
+Parameters for incremental defragmentation steps.
Definition: D3D12MemAlloc.h:723
+DEFRAGMENTATION_MOVE * pMoves
Array of moves to be performed by the user in the current defragmentation pass.
Definition: D3D12MemAlloc.h:747
+UINT32 MoveCount
Number of elements in the pMoves array.
Definition: D3D12MemAlloc.h:725
Although functions like D3D12MA::Allocator::CreateResource() create an allocation and a buffer/texture at once, these are just a shortcut for allocating memory and creating a placed resource. Defragmentation works on memory allocations only. You must handle the rest manually. Defragmentation is an iterative process that should repreat "passes" as long as related functions return S_FALSE
not S_OK
. In each pass:
D3D12MA::DefragmentationContext::BeginPass() function call:
diff --git a/docs/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html
deleted file mode 100644
index 70e1338..0000000
--- a/docs/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-Direct3D 12 Memory Allocator: D:/PROJECTS/D3D12 Memory Allocator/REPO/src Directory Reference
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Direct3D 12 Memory Allocator
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/html/index.html b/docs/html/index.html
index 07c1149..7577405 100644
--- a/docs/html/index.html
+++ b/docs/html/index.html
@@ -65,7 +65,7 @@ $(function() {
-
Version 2.0.0-development (2021-07-26)
+
Version 2.0.0 (2022-03-25)
Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All rights reserved.
License: MIT
Documentation of all members: D3D12MemAlloc.h
diff --git a/docs/html/namespace_d3_d12_m_a.html b/docs/html/namespace_d3_d12_m_a.html
index 3ef2b16..1f72f2f 100644
--- a/docs/html/namespace_d3_d12_m_a.html
+++ b/docs/html/namespace_d3_d12_m_a.html
@@ -185,14 +185,19 @@ Enumerations
enum POOL_FLAGS { POOL_FLAG_NONE = 0
, POOL_FLAG_ALGORITHM_LINEAR = 0x1
+, POOL_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED = 0x2
, POOL_FLAG_ALGORITHM_MASK = POOL_FLAG_ALGORITHM_LINEAR
}
Bit flags to be used with POOL_DESC::Flags. More...
-
enum ALLOCATOR_FLAGS { ALLOCATOR_FLAG_NONE = 0
+enum ALLOCATOR_FLAGS {
+ ALLOCATOR_FLAG_NONE = 0
, ALLOCATOR_FLAG_SINGLETHREADED = 0x1
, ALLOCATOR_FLAG_ALWAYS_COMMITTED = 0x2
, ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED = 0x4
+,
+ ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED = 0x8
+
}
Bit flags to be used with ALLOCATOR_DESC::Flags. More...
@@ -302,8 +307,7 @@ Functions
If new allocation cannot be placed in any of the existing heaps, allocation fails with E_OUTOFMEMORY
error.
You should not use D3D12MA::ALLOCATION_FLAG_COMMITTED and D3D12MA::ALLOCATION_FLAG_NEVER_ALLOCATE at the same time. It makes no sense.
-
ALLOCATION_FLAG_WITHIN_BUDGET Create allocation only if additional memory required for it, if any, won't exceed memory budget. Otherwise return E_OUTOFMEMORY
.
-Warning Currently this feature is not fully implemented yet.
+ ALLOCATION_FLAG_WITHIN_BUDGET Create allocation only if additional memory required for it, if any, won't exceed memory budget. Otherwise return E_OUTOFMEMORY
.
ALLOCATION_FLAG_UPPER_ADDRESS 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.
@@ -353,6 +357,9 @@ Functions
poolDesc.heapFlags |= D3D12_HEAP_FLAG_CREATE_NOT_ZEROED;
Only avaiable if ID3D12Device8
is present. Otherwise, the flag is ignored.
+
ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED Optimization, allocate MSAA textures as committed resources always.
+Specify this flag to create MSAA textures with implicit heaps, as if they were created with flag ALLOCATION_FLAG_COMMITTED. Usage of this flags enables all default pools to create its heaps on smaller alignment not suitable for MSAA textures.
+
@@ -427,6 +434,9 @@ Functions
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 Linear allocation algorithm .
+
POOL_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED Optimization, allocate MSAA textures as committed resources always.
+Specify this flag to create MSAA textures with implicit heaps, as if they were created with flag ALLOCATION_FLAG_COMMITTED. Usage of this flags enables pool to create its heaps on smaller alignment not suitable for MSAA textures.
+
POOL_FLAG_ALGORITHM_MASK
diff --git a/docs/html/namespacemembers.html b/docs/html/namespacemembers.html
index 1a98292..7c0836c 100644
--- a/docs/html/namespacemembers.html
+++ b/docs/html/namespacemembers.html
@@ -81,6 +81,7 @@ $(function() {
ALLOCATION_FLAGS : D3D12MA
ALLOCATOR_FLAG_ALWAYS_COMMITTED : D3D12MA
ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED : D3D12MA
+
ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED : D3D12MA
ALLOCATOR_FLAG_NONE : D3D12MA
ALLOCATOR_FLAG_SINGLETHREADED : D3D12MA
ALLOCATOR_FLAGS : D3D12MA
@@ -115,6 +116,7 @@ $(function() {
- p -
diff --git a/docs/html/namespacemembers_eval.html b/docs/html/namespacemembers_eval.html
index 9447ea3..976b856 100644
--- a/docs/html/namespacemembers_eval.html
+++ b/docs/html/namespacemembers_eval.html
@@ -79,6 +79,7 @@ $(function() {
ALLOCATION_FLAG_WITHIN_BUDGET : D3D12MA
ALLOCATOR_FLAG_ALWAYS_COMMITTED : D3D12MA
ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED : D3D12MA
+
ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED : D3D12MA
ALLOCATOR_FLAG_NONE : D3D12MA
ALLOCATOR_FLAG_SINGLETHREADED : D3D12MA
@@ -98,6 +99,7 @@ $(function() {
- p -
POOL_FLAG_ALGORITHM_LINEAR : D3D12MA
POOL_FLAG_ALGORITHM_MASK : D3D12MA
+POOL_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED : D3D12MA
POOL_FLAG_NONE : D3D12MA
diff --git a/docs/html/namespacemembers_vars.html b/docs/html/namespacemembers_vars.html
deleted file mode 100644
index b789fa4..0000000
--- a/docs/html/namespacemembers_vars.html
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-
Direct3D 12 Memory Allocator: Namespace Members
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Direct3D 12 Memory Allocator
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/html/quick_start.html b/docs/html/quick_start.html
index 6aec9de..e9a2ce8 100644
--- a/docs/html/quick_start.html
+++ b/docs/html/quick_start.html
@@ -90,11 +90,11 @@ Project setup and initialization
-
Represents main object of this library initialized for particular ID3D12Device.
Definition: D3D12MemAlloc.h:1055
+
Represents main object of this library initialized for particular ID3D12Device.
Definition: D3D12MemAlloc.h:1067
D3D12MA_API HRESULT CreateAllocator(const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)
Creates new main D3D12MA::Allocator object and returns it through ppAllocator.
-
Parameters of created Allocator object. To be used with CreateAllocator().
Definition: D3D12MemAlloc.h:1016
-
IDXGIAdapter * pAdapter
Definition: D3D12MemAlloc.h:1042
-
ID3D12Device * pDevice
Definition: D3D12MemAlloc.h:1024
+
Parameters of created Allocator object. To be used with CreateAllocator().
Definition: D3D12MemAlloc.h:1028
+
IDXGIAdapter * pAdapter
Definition: D3D12MemAlloc.h:1054
+
ID3D12Device * pDevice
Definition: D3D12MemAlloc.h:1036
(5.) Right before destroying the D3D12 device, destroy the allocator object.
Objects of this library must be destroyed by calling Release
method. They are somewhat compatible with COM: they implement IUnknown
interface with its virtual methods: AddRef
, Release
, QueryInterface
, and they are reference-counted internally. You can use smart pointers designed for COM with objects of this library - e.g. CComPtr
or Microsoft::WRL::ComPtr
. The reference counter is thread-safe. QueryInterface
method supports only IUnknown
, as classes of this library don't define their own GUIDs.
allocator->Release();
@@ -128,10 +128,10 @@ Creating resources
NULL,
&allocation,
IID_PPV_ARGS(&resource));
-
Represents single memory allocation.
Definition: D3D12MemAlloc.h:464
+
Represents single memory allocation.
Definition: D3D12MemAlloc.h:461
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)
Allocates memory and creates a D3D12 resource (buffer or texture). This is the main allocation functi...
-
Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.
Definition: D3D12MemAlloc.h:280
-
D3D12_HEAP_TYPE HeapType
The type of memory heap where the new allocation should be placed.
Definition: D3D12MemAlloc.h:289
+
Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.
Definition: D3D12MemAlloc.h:277
+
D3D12_HEAP_TYPE HeapType
The type of memory heap where the new allocation should be placed.
Definition: D3D12MemAlloc.h:286
You need to remember both resource and allocation objects and destroy them separately when no longer needed.
allocation->Release();
resource->Release();
diff --git a/docs/html/resource_aliasing.html b/docs/html/resource_aliasing.html
index 9a30e55..9b6d9ec 100644
--- a/docs/html/resource_aliasing.html
+++ b/docs/html/resource_aliasing.html
@@ -144,11 +144,11 @@ $(function() {
res2->Release();
res1->Release();
alloc->Release();
-
Represents single memory allocation.
Definition: D3D12MemAlloc.h:464
+
Represents single memory allocation.
Definition: D3D12MemAlloc.h:461
ID3D12Heap * GetHeap() const
Returns memory heap that the resource is created in.
-
Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.
Definition: D3D12MemAlloc.h:280
-
D3D12_HEAP_FLAGS ExtraHeapFlags
Additional heap flags to be used when allocating memory.
Definition: D3D12MemAlloc.h:305
-
D3D12_HEAP_TYPE HeapType
The type of memory heap where the new allocation should be placed.
Definition: D3D12MemAlloc.h:289
+
Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.
Definition: D3D12MemAlloc.h:277
+
D3D12_HEAP_FLAGS ExtraHeapFlags
Additional heap flags to be used when allocating memory.
Definition: D3D12MemAlloc.h:302
+
D3D12_HEAP_TYPE HeapType
The type of memory heap where the new allocation should be placed.
Definition: D3D12MemAlloc.h:286
Remember that using resouces that alias in memory requires proper synchronization. You need to issue a special barrier of type D3D12_RESOURCE_BARRIER_TYPE_ALIASING
. You also need to treat a resource after aliasing as uninitialized - containing garbage data. For example, if you use res1
and then want to use res2
, you need to first initialize res2
using either Clear, Discard, or Copy to the entire resource.
Additional considerations:
diff --git a/docs/html/search/all_0.js b/docs/html/search/all_0.js
index e8cd098..91fcc20 100644
--- a/docs/html/search/all_0.js
+++ b/docs/html/search/all_0.js
@@ -29,10 +29,10 @@ var searchData=
['allocator_5fdesc_26',['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_27',['ALLOCATOR_FLAG_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb',1,'D3D12MA']]],
['allocator_5fflag_5fdefault_5fpools_5fnot_5fzeroed_28',['ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916ae7dc7ab9168148281ebfe1586f554335',1,'D3D12MA']]],
- ['allocator_5fflag_5fnone_29',['ALLOCATOR_FLAG_NONE',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f',1,'D3D12MA']]],
- ['allocator_5fflag_5fsinglethreaded_30',['ALLOCATOR_FLAG_SINGLETHREADED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52',1,'D3D12MA']]],
- ['allocator_5fflags_31',['ALLOCATOR_FLAGS',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916',1,'D3D12MA']]],
- ['allochandle_32',['AllocHandle',['../struct_d3_d12_m_a_1_1_virtual_allocation.html#a5d3166cf1f284fbbea4d0b169c4dba13',1,'D3D12MA::VirtualAllocation']]],
+ ['allocator_5fflag_5fmsaa_5ftextures_5falways_5fcommitted_29',['ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916adfbfd20d716f2a46f74d6226056fef1e',1,'D3D12MA']]],
+ ['allocator_5fflag_5fnone_30',['ALLOCATOR_FLAG_NONE',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f',1,'D3D12MA']]],
+ ['allocator_5fflag_5fsinglethreaded_31',['ALLOCATOR_FLAG_SINGLETHREADED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52',1,'D3D12MA']]],
+ ['allocator_5fflags_32',['ALLOCATOR_FLAGS',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916',1,'D3D12MA']]],
['allochandle_33',['allocHandle',['../class_d3_d12_m_a_1_1_allocation.html#a5c38846905b1ca0ff228c6081f2fc20c',1,'D3D12MA::Allocation']]],
- ['allochandle_34',['AllocHandle',['../namespace_d3_d12_m_a.html#a15e349adce86a40e0417d405aef1af80',1,'D3D12MA']]]
+ ['allochandle_34',['AllocHandle',['../struct_d3_d12_m_a_1_1_virtual_allocation.html#a5d3166cf1f284fbbea4d0b169c4dba13',1,'D3D12MA::VirtualAllocation::AllocHandle()'],['../namespace_d3_d12_m_a.html#a15e349adce86a40e0417d405aef1af80',1,'D3D12MA::AllocHandle()']]]
];
diff --git a/docs/html/search/all_d.js b/docs/html/search/all_d.js
index d93dac8..18811cb 100644
--- a/docs/html/search/all_d.js
+++ b/docs/html/search/all_d.js
@@ -11,11 +11,12 @@ var searchData=
['pool_5fdesc_8',['POOL_DESC',['../struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html',1,'D3D12MA']]],
['pool_5fflag_5falgorithm_5flinear_9',['POOL_FLAG_ALGORITHM_LINEAR',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aa37a0103f511954ea42a1d0bba286b6a',1,'D3D12MA']]],
['pool_5fflag_5falgorithm_5fmask_10',['POOL_FLAG_ALGORITHM_MASK',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1aec9d4939b8cc5438545b9df840b5f5f7',1,'D3D12MA']]],
- ['pool_5fflag_5fnone_11',['POOL_FLAG_NONE',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02',1,'D3D12MA']]],
- ['pool_5fflags_12',['POOL_FLAGS',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1',1,'D3D12MA']]],
- ['pprivatedata_13',['pPrivateData',['../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#a98173cc9e239a84c2ce369854966e1e3',1,'D3D12MA::ALLOCATION_CALLBACKS::pPrivateData()'],['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ac638dd987f1326e2fdab91892d994d35',1,'D3D12MA::ALLOCATION_DESC::pPrivateData()'],['../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#aa1281297154e3823e98a7cc7e23b5d6b',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::pPrivateData()'],['../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#a05c258ea40ea47667ddcc395b13a47a5',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO::pPrivateData()']]],
- ['pprotectedsession_14',['pProtectedSession',['../struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a475840ec05c19732c8d5aa8bb27270f4',1,'D3D12MA::POOL_DESC']]],
- ['preferredblocksize_15',['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_16',['prev',['../class_d3_d12_m_a_1_1_allocation.html#adc3ac89758a915a409e047f9b89aa160',1,'D3D12MA::Allocation']]],
- ['psrcallocation_17',['pSrcAllocation',['../struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___m_o_v_e.html#a4946b874c958a71c21fac25b515cf5f7',1,'D3D12MA::DEFRAGMENTATION_MOVE']]]
+ ['pool_5fflag_5fmsaa_5ftextures_5falways_5fcommitted_11',['POOL_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1acc379a89755438c0f76667783b778baa',1,'D3D12MA']]],
+ ['pool_5fflag_5fnone_12',['POOL_FLAG_NONE',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02',1,'D3D12MA']]],
+ ['pool_5fflags_13',['POOL_FLAGS',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1',1,'D3D12MA']]],
+ ['pprivatedata_14',['pPrivateData',['../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#a98173cc9e239a84c2ce369854966e1e3',1,'D3D12MA::ALLOCATION_CALLBACKS::pPrivateData()'],['../struct_d3_d12_m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html#ac638dd987f1326e2fdab91892d994d35',1,'D3D12MA::ALLOCATION_DESC::pPrivateData()'],['../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#aa1281297154e3823e98a7cc7e23b5d6b',1,'D3D12MA::VIRTUAL_ALLOCATION_DESC::pPrivateData()'],['../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#a05c258ea40ea47667ddcc395b13a47a5',1,'D3D12MA::VIRTUAL_ALLOCATION_INFO::pPrivateData()']]],
+ ['pprotectedsession_15',['pProtectedSession',['../struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html#a475840ec05c19732c8d5aa8bb27270f4',1,'D3D12MA::POOL_DESC']]],
+ ['preferredblocksize_16',['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_17',['prev',['../class_d3_d12_m_a_1_1_allocation.html#adc3ac89758a915a409e047f9b89aa160',1,'D3D12MA::Allocation']]],
+ ['psrcallocation_18',['pSrcAllocation',['../struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___m_o_v_e.html#a4946b874c958a71c21fac25b515cf5f7',1,'D3D12MA::DEFRAGMENTATION_MOVE']]]
];
diff --git a/docs/html/search/enumvalues_0.js b/docs/html/search/enumvalues_0.js
index ac4038d..8b1ee43 100644
--- a/docs/html/search/enumvalues_0.js
+++ b/docs/html/search/enumvalues_0.js
@@ -14,6 +14,7 @@ var searchData=
['allocation_5fflag_5fwithin_5fbudget_11',['ALLOCATION_FLAG_WITHIN_BUDGET',['../namespace_d3_d12_m_a.html#abbad31a7e0b3d09d77f3fb704b77645eab374417c1f22a833ead268a6c21424e6',1,'D3D12MA']]],
['allocator_5fflag_5falways_5fcommitted_12',['ALLOCATOR_FLAG_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a068863dc0538ff4ea153b046b31e94fb',1,'D3D12MA']]],
['allocator_5fflag_5fdefault_5fpools_5fnot_5fzeroed_13',['ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916ae7dc7ab9168148281ebfe1586f554335',1,'D3D12MA']]],
- ['allocator_5fflag_5fnone_14',['ALLOCATOR_FLAG_NONE',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f',1,'D3D12MA']]],
- ['allocator_5fflag_5fsinglethreaded_15',['ALLOCATOR_FLAG_SINGLETHREADED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52',1,'D3D12MA']]]
+ ['allocator_5fflag_5fmsaa_5ftextures_5falways_5fcommitted_14',['ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916adfbfd20d716f2a46f74d6226056fef1e',1,'D3D12MA']]],
+ ['allocator_5fflag_5fnone_15',['ALLOCATOR_FLAG_NONE',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a2fb30967b492c27823a80b5de3aea26f',1,'D3D12MA']]],
+ ['allocator_5fflag_5fsinglethreaded_16',['ALLOCATOR_FLAG_SINGLETHREADED',['../namespace_d3_d12_m_a.html#ad5ae5a5e42b878f2e18ab5d1fbfb9916a1b06bb21df006f76a9ed1bc41838bc52',1,'D3D12MA']]]
];
diff --git a/docs/html/search/enumvalues_2.js b/docs/html/search/enumvalues_2.js
index 6e3a53d..10b4213 100644
--- a/docs/html/search/enumvalues_2.js
+++ b/docs/html/search/enumvalues_2.js
@@ -2,5 +2,6 @@ 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_5fnone_2',['POOL_FLAG_NONE',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02',1,'D3D12MA']]]
+ ['pool_5fflag_5fmsaa_5ftextures_5falways_5fcommitted_2',['POOL_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1acc379a89755438c0f76667783b778baa',1,'D3D12MA']]],
+ ['pool_5fflag_5fnone_3',['POOL_FLAG_NONE',['../namespace_d3_d12_m_a.html#a919d8545365d6b7209a964f2b99936d1a5d8dc91add3423140809a550c7224d02',1,'D3D12MA']]]
];
diff --git a/docs/html/search/variables_0.js b/docs/html/search/variables_0.js
index 733f671..6a95675 100644
--- a/docs/html/search/variables_0.js
+++ b/docs/html/search/variables_0.js
@@ -6,6 +6,6 @@ var searchData=
['allocationsizemax_3',['AllocationSizeMax',['../struct_d3_d12_m_a_1_1_detailed_statistics.html#a2f47015bebf9a30ce221aef88fe11991',1,'D3D12MA::DetailedStatistics']]],
['allocationsizemin_4',['AllocationSizeMin',['../struct_d3_d12_m_a_1_1_detailed_statistics.html#a187e5562265c3daa87c15d54f1396a6a',1,'D3D12MA::DetailedStatistics']]],
['allocationsmoved_5',['AllocationsMoved',['../struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___s_t_a_t_s.html#a708fa1b14c35da8d5d6abd4a457ef0c2',1,'D3D12MA::DEFRAGMENTATION_STATS']]],
- ['allochandle_6',['AllocHandle',['../struct_d3_d12_m_a_1_1_virtual_allocation.html#a5d3166cf1f284fbbea4d0b169c4dba13',1,'D3D12MA::VirtualAllocation']]],
- ['allochandle_7',['allocHandle',['../class_d3_d12_m_a_1_1_allocation.html#a5c38846905b1ca0ff228c6081f2fc20c',1,'D3D12MA::Allocation']]]
+ ['allochandle_6',['allocHandle',['../class_d3_d12_m_a_1_1_allocation.html#a5c38846905b1ca0ff228c6081f2fc20c',1,'D3D12MA::Allocation']]],
+ ['allochandle_7',['AllocHandle',['../struct_d3_d12_m_a_1_1_virtual_allocation.html#a5d3166cf1f284fbbea4d0b169c4dba13',1,'D3D12MA::VirtualAllocation']]]
];
diff --git a/docs/html/statistics.html b/docs/html/statistics.html
index cece1fb..b88f1ba 100644
--- a/docs/html/statistics.html
+++ b/docs/html/statistics.html
@@ -85,9 +85,9 @@ Numeric statistics
printf("D3D12 reports total usage %llu B with budget %llu B.\n" ,
-Statistics of current memory usage and available budget for a specific memory segment group.
Definition: D3D12MemAlloc.h:415
-UINT64 BudgetBytes
Estimated amount of memory available to the program.
Definition: D3D12MemAlloc.h:438
-UINT64 UsageBytes
Estimated current memory usage of the program.
Definition: D3D12MemAlloc.h:427
+Statistics of current memory usage and available budget for a specific memory segment group.
Definition: D3D12MemAlloc.h:412
+UINT64 BudgetBytes
Estimated amount of memory available to the program.
Definition: D3D12MemAlloc.h:435
+UINT64 UsageBytes
Estimated current memory usage of the program.
Definition: D3D12MemAlloc.h:424
You can query for more detailed statistics per heap type, memory segment group, and totals, including minimum and maximum allocation size and unused range size, by calling function D3D12MA::Allocator::CalculateStatistics() and inspecting structure D3D12MA::TotalStatistics . This function is slower though, as it has to traverse all the internal data structures, so it should be used only for debugging purposes.
You can query for statistics of a custom pool using function D3D12MA::Pool::GetStatistics() or D3D12MA::Pool::CalculateStatistics() .
You can query for information about a specific allocation using functions of the D3D12MA::Allocation class, e.g. GetSize()
, GetOffset()
, GetHeap()
.
diff --git a/docs/html/struct_d3_d12_m_a_1_1_stat_info-members.html b/docs/html/struct_d3_d12_m_a_1_1_stat_info-members.html
deleted file mode 100644
index e59ab58..0000000
--- a/docs/html/struct_d3_d12_m_a_1_1_stat_info-members.html
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-Direct3D 12 Memory Allocator: Member List
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Direct3D 12 Memory Allocator
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
This is the complete list of members for D3D12MA::StatInfo , including all inherited members.
-
-
-
-
-
diff --git a/docs/html/struct_d3_d12_m_a_1_1_stat_info.html b/docs/html/struct_d3_d12_m_a_1_1_stat_info.html
deleted file mode 100644
index c410c75..0000000
--- a/docs/html/struct_d3_d12_m_a_1_1_stat_info.html
+++ /dev/null
@@ -1,287 +0,0 @@
-
-
-
-
-
-
-
-Direct3D 12 Memory Allocator: D3D12MA::StatInfo Struct Reference
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Direct3D 12 Memory Allocator
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Calculated statistics of memory usage in entire allocator.
- More...
-
-
#include <D3D12MemAlloc.h>
-
-
-
Calculated statistics of memory usage in entire allocator.
-
-
-
◆ AllocationCount
-
-
-
-
-
- UINT D3D12MA::StatInfo::AllocationCount
-
-
-
-
-
-
◆ AllocationSizeAvg
-
-
-
-
-
- UINT64 D3D12MA::StatInfo::AllocationSizeAvg
-
-
-
-
-
-
-
-
◆ AllocationSizeMax
-
-
-
-
-
- UINT64 D3D12MA::StatInfo::AllocationSizeMax
-
-
-
-
-
-
-
-
◆ AllocationSizeMin
-
-
-
-
-
- UINT64 D3D12MA::StatInfo::AllocationSizeMin
-
-
-
-
-
-
-
-
◆ BlockCount
-
-
-
-
-
- UINT D3D12MA::StatInfo::BlockCount
-
-
-
-
-
Number of memory blocks (heaps) allocated.
-
-
-
-
-
◆ UnusedBytes
-
-
-
-
-
- UINT64 D3D12MA::StatInfo::UnusedBytes
-
-
-
-
-
Total number of bytes occupied by unused ranges.
-
-
-
-
-
◆ UnusedRangeCount
-
-
-
-
-
- UINT D3D12MA::StatInfo::UnusedRangeCount
-
-
-
-
-
Number of free ranges of memory between allocations.
-
-
-
-
-
◆ UnusedRangeSizeAvg
-
-
-
-
-
- UINT64 D3D12MA::StatInfo::UnusedRangeSizeAvg
-
-
-
-
-
-
-
-
◆ UnusedRangeSizeMax
-
-
-
-
-
- UINT64 D3D12MA::StatInfo::UnusedRangeSizeMax
-
-
-
-
-
-
-
-
◆ UnusedRangeSizeMin
-
-
-
-
-
- UINT64 D3D12MA::StatInfo::UnusedRangeSizeMin
-
-
-
-
-
-
-
-
◆ UsedBytes
-
-
-
-
-
- UINT64 D3D12MA::StatInfo::UsedBytes
-
-
-
-
-
Total number of bytes occupied by all allocations.
-
-
-
-
The documentation for this struct was generated from the following file:
-
-
-
-
-
diff --git a/docs/html/struct_d3_d12_m_a_1_1_stats-members.html b/docs/html/struct_d3_d12_m_a_1_1_stats-members.html
deleted file mode 100644
index 7bdab15..0000000
--- a/docs/html/struct_d3_d12_m_a_1_1_stats-members.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-Direct3D 12 Memory Allocator: Member List
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Direct3D 12 Memory Allocator
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
This is the complete list of members for D3D12MA::Stats , including all inherited members.
-
-
-
-
-
diff --git a/docs/html/struct_d3_d12_m_a_1_1_stats.html b/docs/html/struct_d3_d12_m_a_1_1_stats.html
deleted file mode 100644
index 6b0c2d6..0000000
--- a/docs/html/struct_d3_d12_m_a_1_1_stats.html
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-
-
-
-
-Direct3D 12 Memory Allocator: D3D12MA::Stats Struct Reference
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Direct3D 12 Memory Allocator
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
General statistics from the current state of the allocator.
- More...
-
-
#include <D3D12MemAlloc.h>
-
-
-
General statistics from the current state of the allocator.
-
-
-
◆ HeapType
-
-
-
-
One StatInfo for each type of heap located at the following indices: 0 - DEFAULT, 1 - UPLOAD, 2 - READBACK, 3 - CUSTOM.
-
-
-
-
-
◆ Total
-
-
-
-
-
Total statistics from all heap types.
-
-
-
-
The documentation for this struct was generated from the following file:
-
-
-
-
-
diff --git a/docs/html/virtual_allocator.html b/docs/html/virtual_allocator.html
index f3c4a59..237e283 100644
--- a/docs/html/virtual_allocator.html
+++ b/docs/html/virtual_allocator.html
@@ -83,10 +83,10 @@ Creating virtual block
-Represents pure allocation algorithm and a data structure with allocations in some memory block,...
Definition: D3D12MemAlloc.h:1405
+Represents pure allocation algorithm and a data structure with allocations in some memory block,...
Definition: D3D12MemAlloc.h:1418
D3D12MA_API HRESULT CreateVirtualBlock(const VIRTUAL_BLOCK_DESC *pDesc, VirtualBlock **ppVirtualBlock)
Creates new D3D12MA::VirtualBlock object and returns it through ppVirtualBlock.
-Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock().
Definition: D3D12MemAlloc.h:1311
-UINT64 Size
Total size of the block.
Definition: D3D12MemAlloc.h:1319
+Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock().
Definition: D3D12MemAlloc.h:1324
+UINT64 Size
Total size of the block.
Definition: D3D12MemAlloc.h:1332
Making virtual allocations
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. 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.
@@ -111,9 +111,9 @@ Making virtual allocations
}
HRESULT Allocate(const VIRTUAL_ALLOCATION_DESC *pDesc, VirtualAllocation *pAllocation, UINT64 *pOffset)
Creates new allocation.
-Parameters of created virtual allocation to be passed to VirtualBlock::Allocate().
Definition: D3D12MemAlloc.h:1356
-UINT64 Size
Size of the allocation.
Definition: D3D12MemAlloc.h:1363
-Represents single memory allocation done inside VirtualBlock.
Definition: D3D12MemAlloc.h:444
+Parameters of created virtual allocation to be passed to VirtualBlock::Allocate().
Definition: D3D12MemAlloc.h:1369
+UINT64 Size
Size of the allocation.
Definition: D3D12MemAlloc.h:1376
+Represents single memory allocation done inside VirtualBlock.
Definition: D3D12MemAlloc.h:441
Deallocation
When no longer needed, an allocation can be freed by calling D3D12MA::VirtualBlock::FreeAllocation .
@@ -150,7 +150,7 @@ Alignment and units
UINT64 allocOffset;
hr = block->
Allocate (&allocDesc, &alloc, &allocOffset);
-UINT64 Alignment
Required alignment of the allocation.
Definition: D3D12MemAlloc.h:1368
+UINT64 Alignment
Required alignment of the allocation.
Definition: D3D12MemAlloc.h:1381
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 sizeof(MyDataStruct)
, 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:
D3D12MA::VIRTUAL_BLOCK_DESC::Size
@@ -165,9 +165,9 @@ Statistics
printf("My virtual block has %llu bytes used by %u virtual allocations\n" ,
void GetStatistics(Statistics *pStats) const
Retrieves basic statistics of the virtual block that are fast to calculate.
-Calculated statistics of memory usage e.g. in a specific memory heap type, memory segment group,...
Definition: D3D12MemAlloc.h:323
-UINT64 AllocationBytes
Total number of bytes occupied by all D3D12MA::Allocation objects.
Definition: D3D12MemAlloc.h:341
-UINT AllocationCount
Number of D3D12MA::Allocation objects allocated.
Definition: D3D12MemAlloc.h:331
+Calculated statistics of memory usage e.g. in a specific memory heap type, memory segment group,...
Definition: D3D12MemAlloc.h:320
+UINT64 AllocationBytes
Total number of bytes occupied by all D3D12MA::Allocation objects.
Definition: D3D12MemAlloc.h:338
+UINT AllocationCount
Number of D3D12MA::Allocation objects allocated.
Definition: D3D12MemAlloc.h:328
More detailed statistics can be obtained using function D3D12MA::VirtualBlock::CalculateStatistics() , but they are slower to calculate.
You can also request a full list of allocations and free regions as a string in JSON format by calling D3D12MA::VirtualBlock::BuildStatsString . Returned string must be later freed using D3D12MA::VirtualBlock::FreeStatsString . The format of this string may differ from the one returned by the main D3D12 allocator, but it is similar.
diff --git a/include/D3D12MemAlloc.h b/include/D3D12MemAlloc.h
index 95c5cc2..7640a11 100644
--- a/include/D3D12MemAlloc.h
+++ b/include/D3D12MemAlloc.h
@@ -24,7 +24,7 @@
/** \mainpage D3D12 Memory Allocator
-Version 2.0.0-development (2021-07-26)
+Version 2.0.0 (2022-03-25)
Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All rights reserved. \n
License: MIT
@@ -226,8 +226,6 @@ enum ALLOCATION_FLAGS
/** Create allocation only if additional memory required for it, if any, won't exceed
memory budget. Otherwise return `E_OUTOFMEMORY`.
-
- \warning Currently this feature is not fully implemented yet.
*/
ALLOCATION_FLAG_WITHIN_BUDGET = 0x4,