diff --git a/.gitignore b/.gitignore index d01ec3a..3722ac6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ build/ -docs/html/ diff --git a/README.md b/README.md index 49d9ec3..6ef4331 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Easy to integrate memory allocation library for Direct3D 12. +**Documentation:** See [D3D12 Memory Allocator](https://gpuopen-librariesandsdks.github.io/D3D12MemoryAllocator/html/) (generated from Doxygen-style comments in [src/D3D12MemAlloc.h](src/D3D12MemAlloc.h)) + **License:** MIT. See [LICENSE.txt](LICENSE.txt) **Changelog:** See [CHANGELOG.md](CHANGELOG.md) @@ -87,15 +89,6 @@ With this one function call: The release comes with precompiled binary executable for "D3D12Sample" application which contains test suite. It is compiled using Visual Studio 2019, so it requires appropriate libraries to work, including "MSVCP140.dll", "VCRUNTIME140.dll", "VCRUNTIME140_1.dll". If its launch fails with error message telling about those files missing, please download and install [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads), "x64" version. -# Documentation - -Documentation is provided together with the library in form of Doxygen-style comments inside the code, in file "src/D3D12MemAlloc.h". They can be read directly or turned into HTML and other convenient to read formats. Unfortunately we can't provide pregenerated version browseable online. You can generate it on your own by following these steps: - -1. Install [Doxygen](http://www.doxygen.nl/). -2. Open command line and enter "src" directory. -3. Type command: `doxygen` -4. Open following file in a web browser: "docs/html/index.html". - # Copyright notice This software package uses third party software: diff --git a/docs/html/_d3_d12_mem_alloc_8h.html b/docs/html/_d3_d12_mem_alloc_8h.html new file mode 100644 index 0000000..103e065 --- /dev/null +++ b/docs/html/_d3_d12_mem_alloc_8h.html @@ -0,0 +1,219 @@ + + +
+ + + + +
+ Direct3D 12 Memory Allocator
+
+ |
+
#include <d3d12.h>
#include <dxgi1_4.h>
Go to the source code of this file.
++Classes | |
struct | D3D12MA::ALLOCATION_CALLBACKS |
Custom callbacks to CPU memory allocation functions. More... | |
struct | D3D12MA::ALLOCATION_DESC |
Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource. More... | |
class | D3D12MA::Allocation |
Represents single memory allocation. More... | |
struct | D3D12MA::POOL_DESC |
Parameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool. More... | |
class | D3D12MA::Pool |
Custom memory pool. More... | |
struct | D3D12MA::ALLOCATOR_DESC |
Parameters of created Allocator object. To be used with CreateAllocator(). More... | |
struct | D3D12MA::StatInfo |
Calculated statistics of memory usage in entire allocator. More... | |
struct | D3D12MA::Stats |
General statistics from the current state of the allocator. More... | |
struct | D3D12MA::Budget |
Statistics of current memory usage and available budget, in bytes, for GPU or CPU memory. More... | |
class | D3D12MA::Allocator |
Represents main object of this library initialized for particular ID3D12Device . More... | |
struct | D3D12MA::VIRTUAL_BLOCK_DESC |
Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock(). More... | |
struct | D3D12MA::VIRTUAL_ALLOCATION_DESC |
Parameters of created virtual allocation to be passed to VirtualBlock::Allocate(). More... | |
struct | D3D12MA::VIRTUAL_ALLOCATION_INFO |
Parameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo(). More... | |
class | D3D12MA::VirtualBlock |
Represents pure allocation algorithm and a data structure with allocations in some memory block, without actually allocating any GPU memory. More... | |
+Namespaces | |
D3D12MA | |
+Macros | |
#define | D3D12MA_DXGI_1_4 0 |
#define | D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT 1 |
+Typedefs | |
typedef void *(* | D3D12MA::ALLOCATE_FUNC_PTR) (size_t Size, size_t Alignment, void *pUserData) |
Pointer to custom callback function that allocates CPU memory. More... | |
typedef void(* | D3D12MA::FREE_FUNC_PTR) (void *pMemory, void *pUserData) |
Pointer to custom callback function that deallocates CPU memory. More... | |
typedef enum D3D12MA::ALLOCATION_FLAGS | D3D12MA::ALLOCATION_FLAGS |
Bit flags to be used with ALLOCATION_DESC::Flags. More... | |
typedef enum D3D12MA::ALLOCATOR_FLAGS | D3D12MA::ALLOCATOR_FLAGS |
Bit flags to be used with ALLOCATOR_DESC::Flags. More... | |
+Enumerations | |
enum | D3D12MA::ALLOCATION_FLAGS { D3D12MA::ALLOCATION_FLAG_NONE = 0 +, D3D12MA::ALLOCATION_FLAG_COMMITTED = 0x1 +, D3D12MA::ALLOCATION_FLAG_NEVER_ALLOCATE = 0x2 +, D3D12MA::ALLOCATION_FLAG_WITHIN_BUDGET = 0x4 + } |
Bit flags to be used with ALLOCATION_DESC::Flags. More... | |
enum | D3D12MA::ALLOCATOR_FLAGS { D3D12MA::ALLOCATOR_FLAG_NONE = 0 +, D3D12MA::ALLOCATOR_FLAG_SINGLETHREADED = 0x1 +, D3D12MA::ALLOCATOR_FLAG_ALWAYS_COMMITTED = 0x2 + } |
Bit flags to be used with ALLOCATOR_DESC::Flags. More... | |
+Functions | |
HRESULT | D3D12MA::CreateAllocator (const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator) |
Creates new main D3D12MA::Allocator object and returns it through ppAllocator . More... | |
HRESULT | D3D12MA::CreateVirtualBlock (const VIRTUAL_BLOCK_DESC *pDesc, VirtualBlock **ppVirtualBlock) |
Creates new D3D12MA::VirtualBlock object and returns it through ppVirtualBlock . More... | |
+Variables | |
const UINT | D3D12MA::HEAP_TYPE_COUNT = 4 |
Number of D3D12 memory heap types supported. More... | |
#define D3D12MA_DXGI_1_4 0 | +
#define D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT 1 | +
+ Direct3D 12 Memory Allocator
+
+ |
+
+ Direct3D 12 Memory Allocator
+
+ |
+
▼ND3D12MA | |
CALLOCATION_CALLBACKS | Custom callbacks to CPU memory allocation functions |
CALLOCATION_DESC | Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource |
CAllocation | Represents single memory allocation |
CPOOL_DESC | Parameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool |
CPool | Custom memory pool |
CALLOCATOR_DESC | Parameters of created Allocator object. To be used with CreateAllocator() |
CStatInfo | Calculated statistics of memory usage in entire allocator |
CStats | General statistics from the current state of the allocator |
CBudget | Statistics of current memory usage and available budget, in bytes, for GPU or CPU memory |
CAllocator | Represents main object of this library initialized for particular ID3D12Device |
CVIRTUAL_BLOCK_DESC | Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock() |
CVIRTUAL_ALLOCATION_DESC | Parameters of created virtual allocation to be passed to VirtualBlock::Allocate() |
CVIRTUAL_ALLOCATION_INFO | Parameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo() |
CVirtualBlock | Represents pure allocation algorithm and a data structure with allocations in some memory block, without actually allocating any GPU memory |
+ Direct3D 12 Memory Allocator
+
+ |
+
This is the complete list of members for D3D12MA::Allocation, including all inherited members.
+block | D3D12MA::Allocation | |
D3D12MA_DELETE(const ALLOCATION_CALLBACKS &, T *) | D3D12MA::Allocation | friend |
GetHeap() const | D3D12MA::Allocation | |
GetName() const | D3D12MA::Allocation | inline |
GetOffset() const | D3D12MA::Allocation | |
GetResource() const | D3D12MA::Allocation | inline |
GetSize() const | D3D12MA::Allocation | inline |
heap | D3D12MA::Allocation | |
list | D3D12MA::Allocation | |
m_Committed | D3D12MA::Allocation | |
m_Heap | D3D12MA::Allocation | |
m_Placed | D3D12MA::Allocation | |
next | D3D12MA::Allocation | |
offset | D3D12MA::Allocation | |
prev | D3D12MA::Allocation | |
Release() | D3D12MA::Allocation | |
SetName(LPCWSTR Name) | D3D12MA::Allocation | |
WasZeroInitialized() const | D3D12MA::Allocation | inline |
+ Direct3D 12 Memory Allocator
+
+ |
+
Represents single memory allocation. + More...
+ +#include <D3D12MemAlloc.h>
+Public Member Functions | |
void | Release () |
Deletes this object. More... | |
UINT64 | GetOffset () const |
Returns offset in bytes from the start of memory heap. More... | |
UINT64 | GetSize () const |
Returns size in bytes of the allocation. More... | |
ID3D12Resource * | GetResource () const |
Returns D3D12 resource associated with this object. More... | |
ID3D12Heap * | GetHeap () const |
Returns memory heap that the resource is created in. More... | |
void | SetName (LPCWSTR Name) |
Associates a name with the allocation object. This name is for use in debug diagnostics and tools. More... | |
LPCWSTR | GetName () const |
Returns the name associated with the allocation object. More... | |
BOOL | WasZeroInitialized () const |
Returns TRUE if the memory of the allocation was filled with zeros when the allocation was created. More... | |
Represents single memory allocation.
+It may be either implicit memory heap dedicated to a single resource or a specific region of a bigger heap plus unique offset.
+To create such object, fill structure D3D12MA::ALLOCATION_DESC and call function Allocator::CreateResource.
+The object remembers size and some other information. To retrieve this information, use methods of this class.
+The object also remembers ID3D12Resource
and "owns" a reference to it, so it calls Release()
on the resource when destroyed.
ID3D12Heap* D3D12MA::Allocation::GetHeap | +( | +) | +const | +
Returns memory heap that the resource is created in.
+If the Allocation represents committed resource with implicit heap, returns NULL.
+ +
+
|
+ +inline | +
Returns the name associated with the allocation object.
+Returned string points to an internal copy.
+If no name was associated with the allocation, returns null.
+ +UINT64 D3D12MA::Allocation::GetOffset | +( | +) | +const | +
Returns offset in bytes from the start of memory heap.
+You usually don't need to use this offset. If you create a buffer or a texture together with the allocation using function D3D12MA::Allocator::CreateResource, functions that operate on that resource refer to the beginning of the resource, not entire memory heap.
+If the Allocation represents committed resource with implicit heap, returns 0.
+ +
+
|
+ +inline | +
Returns D3D12 resource associated with this object.
+Calling this method doesn't increment resource's reference counter.
+ +
+
|
+ +inline | +
Returns size in bytes of the allocation.
+ID3D12Device::GetResourceAllocationInfo
.ID3D12Resource::GetGPUVirtualAddress()
+ Allocation::GetSize() to overlap in memory and still work correctly. void D3D12MA::Allocation::Release | +( | +) | ++ |
Deletes this object.
+This function must be used instead of destructor, which is private. There is no reference counting involved.
+ +void D3D12MA::Allocation::SetName | +( | +LPCWSTR | +Name | ) | ++ |
Associates a name with the allocation object. This name is for use in debug diagnostics and tools.
+Internal copy of the string is made, so the memory pointed by the argument can be changed of freed immediately after this call.
+Name
can be null.
+
|
+ +inline | +
Returns TRUE
if the memory of the allocation was filled with zeros when the allocation was created.
Returns TRUE
only if the allocator is sure that the entire memory where the allocation was created was filled with zeros at the moment the allocation was made.
Returns FALSE
if the memory could potentially contain garbage data. If it's a render-target or depth-stencil texture, it then needs proper initialization with ClearRenderTargetView
, ClearDepthStencilView
, DiscardResource
, or a copy operation, as described on page: ID3D12Device::CreatePlacedResource method - Notes on the required resource initialization. Please note that rendering a fullscreen triangle or quad to the texture as a render target is not a proper way of initialization!
See also articles: "Coming to DirectX 12: More control over memory allocation", "Initializing DX12 Textures After Allocation and Aliasing".
+ +NormalBlock* D3D12MA::Allocation::block | +
ID3D12Heap* D3D12MA::Allocation::heap | +
CommittedAllocationList* D3D12MA::Allocation::list | +
struct { ... } D3D12MA::Allocation::m_Committed | +
struct { ... } D3D12MA::Allocation::m_Heap | +
struct { ... } D3D12MA::Allocation::m_Placed | +
Allocation* D3D12MA::Allocation::next | +
UINT64 D3D12MA::Allocation::offset | +
Allocation* D3D12MA::Allocation::prev | +
+ Direct3D 12 Memory Allocator
+
+ |
+
This is the complete list of members for D3D12MA::Allocator, including all inherited members.
+AllocateMemory(const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_ALLOCATION_INFO *pAllocInfo, Allocation **ppAllocation) | D3D12MA::Allocator | |
AllocateMemory1(const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_ALLOCATION_INFO *pAllocInfo, ID3D12ProtectedResourceSession *pProtectedSession, Allocation **ppAllocation) | D3D12MA::Allocator | |
BuildStatsString(WCHAR **ppStatsString, BOOL DetailedMap) const | D3D12MA::Allocator | |
CalculateStats(Stats *pStats) | D3D12MA::Allocator | |
CreateAliasingResource(Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riidResource, void **ppvResource) | D3D12MA::Allocator | |
CreateAllocator(const ALLOCATOR_DESC *, Allocator **) | D3D12MA::Allocator | friend |
CreatePool(const POOL_DESC *pPoolDesc, Pool **ppPool) | D3D12MA::Allocator | |
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) | D3D12MA::Allocator | |
CreateResource1(const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, ID3D12ProtectedResourceSession *pProtectedSession, Allocation **ppAllocation, REFIID riidResource, void **ppvResource) | D3D12MA::Allocator | |
CreateResource2(const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, ID3D12ProtectedResourceSession *pProtectedSession, Allocation **ppAllocation, REFIID riidResource, void **ppvResource) | D3D12MA::Allocator | |
D3D12MA_DELETE(const ALLOCATION_CALLBACKS &, T *) | D3D12MA::Allocator | friend |
FreeStatsString(WCHAR *pStatsString) const | D3D12MA::Allocator | |
GetBudget(Budget *pGpuBudget, Budget *pCpuBudget) | D3D12MA::Allocator | |
GetD3D12Options() const | D3D12MA::Allocator | |
IsCacheCoherentUMA() const | D3D12MA::Allocator | |
IsUMA() const | D3D12MA::Allocator | |
Release() | D3D12MA::Allocator | |
SetCurrentFrameIndex(UINT frameIndex) | D3D12MA::Allocator |
+ Direct3D 12 Memory Allocator
+
+ |
+
Represents main object of this library initialized for particular ID3D12Device
.
+ More...
#include <D3D12MemAlloc.h>
+Public Member Functions | |
void | Release () |
Deletes this object. More... | |
const D3D12_FEATURE_DATA_D3D12_OPTIONS & | GetD3D12Options () const |
Returns cached options retrieved from D3D12 device. More... | |
BOOL | IsUMA () const |
Returns true if D3D12_FEATURE_DATA_ARCHITECTURE1::UMA was found to be true. More... | |
BOOL | IsCacheCoherentUMA () const |
Returns true if D3D12_FEATURE_DATA_ARCHITECTURE1::CacheCoherentUMA was found to be true. More... | |
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 function. More... | |
HRESULT | CreateResource1 (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, ID3D12ProtectedResourceSession *pProtectedSession, Allocation **ppAllocation, REFIID riidResource, void **ppvResource) |
Similar to Allocator::CreateResource, but supports additional parameter pProtectedSession . More... | |
HRESULT | CreateResource2 (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, ID3D12ProtectedResourceSession *pProtectedSession, Allocation **ppAllocation, REFIID riidResource, void **ppvResource) |
Similar to Allocator::CreateResource1, but supports new structure D3D12_RESOURCE_DESC1 . More... | |
HRESULT | AllocateMemory (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_ALLOCATION_INFO *pAllocInfo, Allocation **ppAllocation) |
Allocates memory without creating any resource placed in it. More... | |
HRESULT | AllocateMemory1 (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_ALLOCATION_INFO *pAllocInfo, ID3D12ProtectedResourceSession *pProtectedSession, Allocation **ppAllocation) |
Similar to Allocator::AllocateMemory, but supports additional parameter pProtectedSession . More... | |
HRESULT | CreateAliasingResource (Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riidResource, void **ppvResource) |
Creates a new resource in place of an existing allocation. This is useful for memory aliasing. More... | |
HRESULT | CreatePool (const POOL_DESC *pPoolDesc, Pool **ppPool) |
Creates custom pool. More... | |
void | SetCurrentFrameIndex (UINT frameIndex) |
Sets the index of the current frame. More... | |
void | CalculateStats (Stats *pStats) |
Retrieves statistics from the current state of the allocator. More... | |
void | GetBudget (Budget *pGpuBudget, Budget *pCpuBudget) |
Retrieves information about current memory budget. More... | |
void | BuildStatsString (WCHAR **ppStatsString, BOOL DetailedMap) const |
Builds and returns statistics as a string in JSON format. More... | |
void | FreeStatsString (WCHAR *pStatsString) const |
Frees memory of a string returned from Allocator::BuildStatsString. More... | |
Represents main object of this library initialized for particular ID3D12Device
.
Fill structure D3D12MA::ALLOCATOR_DESC and call function CreateAllocator() to create it. Call method Allocator::Release to destroy it.
+It is recommended to create just one object of this type per ID3D12Device
object, right after Direct3D 12 is initialized and keep it alive until before Direct3D device is destroyed.
HRESULT D3D12MA::Allocator::AllocateMemory | +( | +const ALLOCATION_DESC * | +pAllocDesc, | +
+ | + | const D3D12_RESOURCE_ALLOCATION_INFO * | +pAllocInfo, | +
+ | + | Allocation ** | +ppAllocation | +
+ | ) | ++ |
Allocates memory without creating any resource placed in it.
+This function is similar to ID3D12Device::CreateHeap
, but it may really assign part of a larger, existing heap to the allocation.
pAllocDesc->heapFlags
should contain one of these values, depending on type of resources you are going to create in this memory: D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS
, D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES
, D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES
. Except if you validate that ResourceHeapTier = 2 - then heapFlags
may be D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES
= 0. Additional flags in heapFlags
are allowed as well.
pAllocInfo->SizeInBytes
must be multiply of 64KB. pAllocInfo->Alignment
must be one of the legal values as described in documentation of D3D12_HEAP_DESC
.
If you use D3D12MA::ALLOCATION_FLAG_COMMITTED you will get a separate memory block - a heap that always has offset 0.
+ +HRESULT D3D12MA::Allocator::AllocateMemory1 | +( | +const ALLOCATION_DESC * | +pAllocDesc, | +
+ | + | const D3D12_RESOURCE_ALLOCATION_INFO * | +pAllocInfo, | +
+ | + | ID3D12ProtectedResourceSession * | +pProtectedSession, | +
+ | + | Allocation ** | +ppAllocation | +
+ | ) | ++ |
Similar to Allocator::AllocateMemory, but supports additional parameter pProtectedSession
.
If pProtectedSession
is not null, current implementation always creates separate heap using ID3D12Device4::CreateHeap1
.
To work correctly, ID3D12Device4
interface must be available in the current system. Otherwise, E_NOINTERFACE
is returned.
void D3D12MA::Allocator::BuildStatsString | +( | +WCHAR ** | +ppStatsString, | +
+ | + | BOOL | +DetailedMap | +
+ | ) | +const | +
Builds and returns statistics as a string in JSON format.
+[out] | ppStatsString | Must be freed using Allocator::FreeStatsString. |
DetailedMap | TRUE to include full list of allocations (can make the string quite long), FALSE to only return statistics. |
void D3D12MA::Allocator::CalculateStats | +( | +Stats * | +pStats | ) | ++ |
Retrieves statistics from the current state of the allocator.
+ +HRESULT D3D12MA::Allocator::CreateAliasingResource | +( | +Allocation * | +pAllocation, | +
+ | + | UINT64 | +AllocationLocalOffset, | +
+ | + | const D3D12_RESOURCE_DESC * | +pResourceDesc, | +
+ | + | D3D12_RESOURCE_STATES | +InitialResourceState, | +
+ | + | const D3D12_CLEAR_VALUE * | +pOptimizedClearValue, | +
+ | + | REFIID | +riidResource, | +
+ | + | void ** | +ppvResource | +
+ | ) | ++ |
Creates a new resource in place of an existing allocation. This is useful for memory aliasing.
+pAllocation | Existing allocation indicating the memory where the new resource should be created. It can be created using D3D12MA::Allocator::CreateResource and already have a resource bound to it, or can be a raw memory allocated with D3D12MA::Allocator::AllocateMemory. It must not be created as committed so that ID3D12Heap is available and not implicit. | |
AllocationLocalOffset | Additional offset in bytes to be applied when allocating the resource. Local from the start of pAllocation , not the beginning of the whole ID3D12Heap ! If the new resource should start from the beginning of the pAllocation it should be 0. | |
pResourceDesc | Description of the new resource to be created. | |
InitialResourceState | ||
pOptimizedClearValue | ||
riidResource | ||
[out] | ppvResource | Returns pointer to the new resource. The resource is not bound with pAllocation . This pointer must not be null - you must get the resource pointer and Release it when no longer needed. |
Memory requirements of the new resource are checked for validation. If its size exceeds the end of pAllocation
or required alignment is not fulfilled considering pAllocation->GetOffset() + AllocationLocalOffset
, the function returns E_INVALIDARG
.
HRESULT D3D12MA::Allocator::CreatePool | +( | +const POOL_DESC * | +pPoolDesc, | +
+ | + | Pool ** | +ppPool | +
+ | ) | ++ |
Creates custom pool.
+ +HRESULT D3D12MA::Allocator::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 function.
+The function is similar to ID3D12Device::CreateCommittedResource
, but it may really call ID3D12Device::CreatePlacedResource
to assign part of a larger, existing memory heap to the new resource, which is the main purpose of this whole library.
If ppvResource
is null, you receive only ppAllocation
object from this function. It holds pointer to ID3D12Resource
that can be queried using function D3D12MA::Allocation::GetResource(). Reference count of the resource object is 1. It is automatically destroyed when you destroy the allocation object.
If ppvResource
is not null, you receive pointer to the resource next to allocation object. Reference count of the resource object is then increased by calling QueryInterface
, so you need to manually Release
it along with the allocation.
pAllocDesc | Parameters of the allocation. | |
pResourceDesc | Description of created resource. | |
InitialResourceState | Initial resource state. | |
pOptimizedClearValue | Optional. Either null or optimized clear value. | |
[out] | ppAllocation | Filled with pointer to new allocation object created. |
riidResource | IID of a resource to be returned via ppvResource . | |
[out] | ppvResource | Optional. If not null, filled with pointer to new resouce created. |
HRESULT D3D12MA::Allocator::CreateResource1 | +( | +const ALLOCATION_DESC * | +pAllocDesc, | +
+ | + | const D3D12_RESOURCE_DESC * | +pResourceDesc, | +
+ | + | D3D12_RESOURCE_STATES | +InitialResourceState, | +
+ | + | const D3D12_CLEAR_VALUE * | +pOptimizedClearValue, | +
+ | + | ID3D12ProtectedResourceSession * | +pProtectedSession, | +
+ | + | Allocation ** | +ppAllocation, | +
+ | + | REFIID | +riidResource, | +
+ | + | void ** | +ppvResource | +
+ | ) | ++ |
Similar to Allocator::CreateResource, but supports additional parameter pProtectedSession
.
If pProtectedSession
is not null, current implementation always creates the resource as committed using ID3D12Device4::CreateCommittedResource1
.
To work correctly, ID3D12Device4
interface must be available in the current system. Otherwise, E_NOINTERFACE
is returned.
HRESULT D3D12MA::Allocator::CreateResource2 | +( | +const ALLOCATION_DESC * | +pAllocDesc, | +
+ | + | const D3D12_RESOURCE_DESC1 * | +pResourceDesc, | +
+ | + | D3D12_RESOURCE_STATES | +InitialResourceState, | +
+ | + | const D3D12_CLEAR_VALUE * | +pOptimizedClearValue, | +
+ | + | ID3D12ProtectedResourceSession * | +pProtectedSession, | +
+ | + | Allocation ** | +ppAllocation, | +
+ | + | REFIID | +riidResource, | +
+ | + | void ** | +ppvResource | +
+ | ) | ++ |
Similar to Allocator::CreateResource1, but supports new structure D3D12_RESOURCE_DESC1
.
It internally uses ID3D12Device8::CreateCommittedResource2
or ID3D12Device8::CreatePlacedResource1
.
To work correctly, ID3D12Device8
interface must be available in the current system. Otherwise, E_NOINTERFACE
is returned.
void D3D12MA::Allocator::FreeStatsString | +( | +WCHAR * | +pStatsString | ) | +const | +
Frees memory of a string returned from Allocator::BuildStatsString.
+ +void D3D12MA::Allocator::GetBudget | +( | +Budget * | +pGpuBudget, | +
+ | + | Budget * | +pCpuBudget | +
+ | ) | ++ |
Retrieves information about current memory budget.
+[out] | pGpuBudget | Optional, can be null. |
[out] | pCpuBudget | Optional, can be null. |
This function is called "get" not "calculate" because it is very fast, suitable to be called every frame or every allocation. For more detailed statistics use CalculateStats().
+Note that when using allocator from multiple threads, returned information may immediately become outdated.
+ +const D3D12_FEATURE_DATA_D3D12_OPTIONS& D3D12MA::Allocator::GetD3D12Options | +( | +) | +const | +
Returns cached options retrieved from D3D12 device.
+ +BOOL D3D12MA::Allocator::IsCacheCoherentUMA | +( | +) | +const | +
Returns true if D3D12_FEATURE_DATA_ARCHITECTURE1::CacheCoherentUMA
was found to be true.
For more information about how to use it, see articles in Microsoft Docs:
+ +BOOL D3D12MA::Allocator::IsUMA | +( | +) | +const | +
Returns true if D3D12_FEATURE_DATA_ARCHITECTURE1::UMA
was found to be true.
For more information about how to use it, see articles in Microsoft Docs:
+ +void D3D12MA::Allocator::Release | +( | +) | ++ |
Deletes this object.
+This function must be used instead of destructor, which is private. There is no reference counting involved.
+ +void D3D12MA::Allocator::SetCurrentFrameIndex | +( | +UINT | +frameIndex | ) | ++ |
Sets the index of the current frame.
+This function is used to set the frame index in the allocator when a new game frame begins.
+ +
+ Direct3D 12 Memory Allocator
+
+ |
+
This is the complete list of members for D3D12MA::Pool, including all inherited members.
+CalculateStats(StatInfo *pStats) | D3D12MA::Pool | |
D3D12MA_DELETE(const ALLOCATION_CALLBACKS &, T *) | D3D12MA::Pool | friend |
GetDesc() const | D3D12MA::Pool | |
GetName() const | D3D12MA::Pool | |
Release() | D3D12MA::Pool | |
SetName(LPCWSTR Name) | D3D12MA::Pool |
+ Direct3D 12 Memory Allocator
+
+ |
+
Custom memory pool. + More...
+ +#include <D3D12MemAlloc.h>
+Public Member Functions | |
void | Release () |
Deletes pool object, frees D3D12 heaps (memory blocks) managed by it. Allocations and resources must already be released! More... | |
POOL_DESC | GetDesc () const |
Returns copy of parameters of the pool. More... | |
void | CalculateStats (StatInfo *pStats) |
Retrieves statistics from the current state of this pool. More... | |
void | SetName (LPCWSTR Name) |
Associates a name with the pool. This name is for use in debug diagnostics and tools. More... | |
LPCWSTR | GetName () const |
Returns the name associated with the pool object. More... | |
Custom memory pool.
+Represents a separate set of heaps (memory blocks) that can be used to create D3D12MA::Allocation-s and resources in it. Usually there is no need to create custom pools - creating resources in default pool is sufficient.
+To create custom pool, fill D3D12MA::POOL_DESC and call D3D12MA::Allocator::CreatePool.
+void D3D12MA::Pool::CalculateStats | +( | +StatInfo * | +pStats | ) | ++ |
Retrieves statistics from the current state of this pool.
+ +POOL_DESC D3D12MA::Pool::GetDesc | +( | +) | +const | +
Returns copy of parameters of the pool.
+These are the same parameters as passed to D3D12MA::Allocator::CreatePool.
+ +LPCWSTR D3D12MA::Pool::GetName | +( | +) | +const | +
Returns the name associated with the pool object.
+Returned string points to an internal copy.
+If no name was associated with the allocation, returns NULL.
+ +void D3D12MA::Pool::Release | +( | +) | ++ |
Deletes pool object, frees D3D12 heaps (memory blocks) managed by it. Allocations and resources must already be released!
+It doesn't delete allocations and resources created in this pool. They must be all released before calling this function!
+ +void D3D12MA::Pool::SetName | +( | +LPCWSTR | +Name | ) | ++ |
Associates a name with the pool. This name is for use in debug diagnostics and tools.
+Internal copy of the string is made, so the memory pointed by the argument can be changed of freed immediately after this call.
+Name
can be NULL.
+ Direct3D 12 Memory Allocator
+
+ |
+
This is the complete list of members for D3D12MA::VirtualBlock, including all inherited members.
+Allocate(const VIRTUAL_ALLOCATION_DESC *pDesc, UINT64 *pOffset) | D3D12MA::VirtualBlock | |
BuildStatsString(WCHAR **ppStatsString) const | D3D12MA::VirtualBlock | |
CalculateStats(StatInfo *pInfo) const | D3D12MA::VirtualBlock | |
Clear() | D3D12MA::VirtualBlock | |
CreateVirtualBlock(const VIRTUAL_BLOCK_DESC *, VirtualBlock **) | D3D12MA::VirtualBlock | friend |
D3D12MA_DELETE(const ALLOCATION_CALLBACKS &, T *) | D3D12MA::VirtualBlock | friend |
FreeAllocation(UINT64 offset) | D3D12MA::VirtualBlock | |
FreeStatsString(WCHAR *pStatsString) const | D3D12MA::VirtualBlock | |
GetAllocationInfo(UINT64 offset, VIRTUAL_ALLOCATION_INFO *pInfo) const | D3D12MA::VirtualBlock | |
IsEmpty() const | D3D12MA::VirtualBlock | |
Release() | D3D12MA::VirtualBlock | |
SetAllocationUserData(UINT64 offset, void *pUserData) | D3D12MA::VirtualBlock |
+ Direct3D 12 Memory Allocator
+
+ |
+
Represents pure allocation algorithm and a data structure with allocations in some memory block, without actually allocating any GPU memory. + More...
+ +#include <D3D12MemAlloc.h>
+Public Member Functions | |
void | Release () |
Destroys this object and frees it from memory. More... | |
BOOL | IsEmpty () const |
Returns true if the block is empty - contains 0 allocations. More... | |
void | GetAllocationInfo (UINT64 offset, VIRTUAL_ALLOCATION_INFO *pInfo) const |
Returns information about an allocation at given offset - its size and custom pointer. More... | |
HRESULT | Allocate (const VIRTUAL_ALLOCATION_DESC *pDesc, UINT64 *pOffset) |
Creates new allocation. More... | |
void | FreeAllocation (UINT64 offset) |
Frees the allocation at given offset. More... | |
void | Clear () |
Frees all the allocations. More... | |
void | SetAllocationUserData (UINT64 offset, void *pUserData) |
Changes custom pointer for an allocation at given offset to a new value. More... | |
void | CalculateStats (StatInfo *pInfo) const |
Retrieves statistics from the current state of the block. More... | |
void | BuildStatsString (WCHAR **ppStatsString) const |
Builds and returns statistics as a string in JSON format, including the list of allocations with their parameters. More... | |
void | FreeStatsString (WCHAR *pStatsString) const |
Frees memory of a string returned from VirtualBlock::BuildStatsString. More... | |
Represents pure allocation algorithm and a data structure with allocations in some memory block, without actually allocating any GPU memory.
+This class allows to use the core algorithm of the library custom allocations e.g. CPU memory or sub-allocation regions inside a single GPU buffer.
+To create this object, fill in D3D12MA::VIRTUAL_BLOCK_DESC and call CreateVirtualBlock(). To destroy it, call its method VirtualBlock::Release().
+HRESULT D3D12MA::VirtualBlock::Allocate | +( | +const VIRTUAL_ALLOCATION_DESC * | +pDesc, | +
+ | + | UINT64 * | +pOffset | +
+ | ) | ++ |
Creates new allocation.
+pDesc | ||
[out] | pOffset | Offset of the new allocation, which can also be treated as an unique identifier of the allocation within this block. UINT64_MAX if allocation failed. |
S_OK
if allocation succeeded, E_OUTOFMEMORY
if it failed. void D3D12MA::VirtualBlock::BuildStatsString | +( | +WCHAR ** | +ppStatsString | ) | +const | +
Builds and returns statistics as a string in JSON format, including the list of allocations with their parameters.
+[out] | ppStatsString | Must be freed using VirtualBlock::FreeStatsString. |
void D3D12MA::VirtualBlock::CalculateStats | +( | +StatInfo * | +pInfo | ) | +const | +
Retrieves statistics from the current state of the block.
+ +void D3D12MA::VirtualBlock::Clear | +( | +) | ++ |
Frees all the allocations.
+ +void D3D12MA::VirtualBlock::FreeAllocation | +( | +UINT64 | +offset | ) | ++ |
Frees the allocation at given offset.
+ +void D3D12MA::VirtualBlock::FreeStatsString | +( | +WCHAR * | +pStatsString | ) | +const | +
Frees memory of a string returned from VirtualBlock::BuildStatsString.
+ +void D3D12MA::VirtualBlock::GetAllocationInfo | +( | +UINT64 | +offset, | +
+ | + | VIRTUAL_ALLOCATION_INFO * | +pInfo | +
+ | ) | +const | +
Returns information about an allocation at given offset - its size and custom pointer.
+ +BOOL D3D12MA::VirtualBlock::IsEmpty | +( | +) | +const | +
Returns true if the block is empty - contains 0 allocations.
+ +void D3D12MA::VirtualBlock::Release | +( | +) | ++ |
Destroys this object and frees it from memory.
+You need to free all the allocations within this block or call Clear() before destroying it.
+ +void D3D12MA::VirtualBlock::SetAllocationUserData | +( | +UINT64 | +offset, | +
+ | + | void * | +pUserData | +
+ | ) | ++ |
Changes custom pointer for an allocation at given offset to a new value.
+ +
+ Direct3D 12 Memory Allocator
+
+ |
+
+ Direct3D 12 Memory Allocator
+
+ |
+
Please check file D3D12MemAlloc.cpp
lines between "Configuration Begin" and "Configuration End" to find macros that you can define to change the behavior of the library, primarily for debugging purposes.
If you use custom allocator for CPU memory rather than default C++ operator new
and delete
or malloc
and free
functions, you can make this library using your allocator as well by filling structure D3D12MA::ALLOCATION_CALLBACKS and passing it as optional member D3D12MA::ALLOCATOR_DESC::pAllocationCallbacks. Functions pointed there will be used by the library to make any CPU-side allocations. Example:
+ Direct3D 12 Memory Allocator
+
+ |
+
A "pool" is a collection of memory blocks that share certain properties. Allocator creates 3 default pools: for D3D12_HEAP_TYPE_DEFAULT
, UPLOAD
, READBACK
. A default pool automatically grows in size. Size of allocated blocks is also variable and managed automatically. Typical allocations are created in these pools. You can also create custom pools.
To create a custom pool, fill in structure D3D12MA::POOL_DESC and call function D3D12MA::Allocator::CreatePool to obtain object D3D12MA::Pool. Example:
+To allocate resources out of a custom pool, only set member D3D12MA::ALLOCATION_DESC::CustomPool. Example:
+All allocations must be released before releasing the pool. The pool must be released before relasing the allocator.
+While it is recommended to use default pools whenever possible for simplicity and to give the allocator more opportunities for internal optimizations, custom pools may be useful in following cases:
+ID3D12Heap
). To set it, use member D3D12MA::POOL_DESC::BlockSize. When set to 0, the library uses automatically determined, variable block sizes.D3D12_HEAP_TYPE_DEFAULT
, UPLOAD
, READBACK
, a custom pool may use non-standard D3D12_HEAP_PROPERTIES
(member D3D12MA::POOL_DESC::HeapProperties) and D3D12_HEAP_FLAGS
(D3D12MA::POOL_DESC::HeapFlags), which is useful e.g. for cross-adapter sharing or UMA (see also D3D12MA::Allocator::IsUMA).New versions of this library support creating committed allocations in custom pools. It is supported only when D3D12MA::POOL_DESC::BlockSize = 0. To use this feature, set D3D12MA::ALLOCATION_DESC::CustomPool to the pointer to your custom pool and D3D12MA::ALLOCATION_DESC::Flags to D3D12MA::ALLOCATION_FLAG_COMMITTED. Example:
+This feature may seem unnecessary, but creating committed allocations from custom pools may be useful in some cases, e.g. to have separate memory usage statistics for some group of resources or to use extended allocation parameters, like custom D3D12_HEAP_PROPERTIES
, which are available only in custom pools.
+ Direct3D 12 Memory Allocator
+
+ |
+
D3D12MemAlloc.h |
+ Direct3D 12 Memory Allocator
+
+ |
+
+ Direct3D 12 Memory Allocator
+
+ |
+
+ Direct3D 12 Memory Allocator
+
+ |
+
+ Direct3D 12 Memory Allocator
+
+ |
+
+ Direct3D 12 Memory Allocator
+
+ |
+
ID3D12Device
is enough.Features planned for future releases:
+Near future: feature parity with Vulkan Memory Allocator, including:
+ID3D12Device1::SetResidencyPriority
Later:
+Features deliberately excluded from the scope of this library:
+D3D12_HEAP_TYPE_CUSTOM
. Only the default heap types are supported: UPLOAD
, DEFAULT
, READBACK
.ID3D12Device::Evict
and MakeResident
. We don't recommend using them.
+ Direct3D 12 Memory Allocator
+
+ |
+
+ Direct3D 12 Memory Allocator
+
+ |
+
+ Direct3D 12 Memory Allocator
+
+ |
+
Version 2.0.0-development (2021-06-18)
+Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All rights reserved.
+License: MIT
Documentation of all members: D3D12MemAlloc.h
+
+ Direct3D 12 Memory Allocator
+
+ |
+
+Classes | |
struct | ALLOCATION_CALLBACKS |
Custom callbacks to CPU memory allocation functions. More... | |
struct | ALLOCATION_DESC |
Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource. More... | |
class | Allocation |
Represents single memory allocation. More... | |
struct | POOL_DESC |
Parameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool. More... | |
class | Pool |
Custom memory pool. More... | |
struct | ALLOCATOR_DESC |
Parameters of created Allocator object. To be used with CreateAllocator(). More... | |
struct | StatInfo |
Calculated statistics of memory usage in entire allocator. More... | |
struct | Stats |
General statistics from the current state of the allocator. More... | |
struct | Budget |
Statistics of current memory usage and available budget, in bytes, for GPU or CPU memory. More... | |
class | Allocator |
Represents main object of this library initialized for particular ID3D12Device . More... | |
struct | VIRTUAL_BLOCK_DESC |
Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock(). More... | |
struct | VIRTUAL_ALLOCATION_DESC |
Parameters of created virtual allocation to be passed to VirtualBlock::Allocate(). More... | |
struct | VIRTUAL_ALLOCATION_INFO |
Parameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo(). More... | |
class | VirtualBlock |
Represents pure allocation algorithm and a data structure with allocations in some memory block, without actually allocating any GPU memory. More... | |
+Typedefs | |
typedef void *(* | ALLOCATE_FUNC_PTR) (size_t Size, size_t Alignment, void *pUserData) |
Pointer to custom callback function that allocates CPU memory. More... | |
typedef void(* | FREE_FUNC_PTR) (void *pMemory, void *pUserData) |
Pointer to custom callback function that deallocates CPU memory. More... | |
typedef enum D3D12MA::ALLOCATION_FLAGS | ALLOCATION_FLAGS |
Bit flags to be used with ALLOCATION_DESC::Flags. More... | |
typedef enum D3D12MA::ALLOCATOR_FLAGS | ALLOCATOR_FLAGS |
Bit flags to be used with ALLOCATOR_DESC::Flags. More... | |
+Enumerations | |
enum | ALLOCATION_FLAGS { ALLOCATION_FLAG_NONE = 0 +, ALLOCATION_FLAG_COMMITTED = 0x1 +, ALLOCATION_FLAG_NEVER_ALLOCATE = 0x2 +, ALLOCATION_FLAG_WITHIN_BUDGET = 0x4 + } |
Bit flags to be used with ALLOCATION_DESC::Flags. More... | |
enum | ALLOCATOR_FLAGS { ALLOCATOR_FLAG_NONE = 0 +, ALLOCATOR_FLAG_SINGLETHREADED = 0x1 +, ALLOCATOR_FLAG_ALWAYS_COMMITTED = 0x2 + } |
Bit flags to be used with ALLOCATOR_DESC::Flags. More... | |
+Functions | |
HRESULT | CreateAllocator (const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator) |
Creates new main D3D12MA::Allocator object and returns it through ppAllocator . More... | |
HRESULT | CreateVirtualBlock (const VIRTUAL_BLOCK_DESC *pDesc, VirtualBlock **ppVirtualBlock) |
Creates new D3D12MA::VirtualBlock object and returns it through ppVirtualBlock . More... | |
+Variables | |
const UINT | HEAP_TYPE_COUNT = 4 |
Number of D3D12 memory heap types supported. More... | |
typedef void*(* D3D12MA::ALLOCATE_FUNC_PTR) (size_t Size, size_t Alignment, void *pUserData) | +
Pointer to custom callback function that allocates CPU memory.
+ +typedef enum D3D12MA::ALLOCATION_FLAGS D3D12MA::ALLOCATION_FLAGS | +
Bit flags to be used with ALLOCATION_DESC::Flags.
+ +typedef enum D3D12MA::ALLOCATOR_FLAGS D3D12MA::ALLOCATOR_FLAGS | +
Bit flags to be used with ALLOCATOR_DESC::Flags.
+ +typedef void(* D3D12MA::FREE_FUNC_PTR) (void *pMemory, void *pUserData) | +
Pointer to custom callback function that deallocates CPU memory.
+pMemory = null
should be accepted and ignored.
enum D3D12MA::ALLOCATION_FLAGS | +
Bit flags to be used with ALLOCATION_DESC::Flags.
+Enumerator | |
---|---|
ALLOCATION_FLAG_NONE | Zero. + |
ALLOCATION_FLAG_COMMITTED | Set this flag if the allocation should have its own dedicated memory allocation (committed resource with implicit heap). +Use it for special, big resources, like fullscreen textures used as render targets. + |
ALLOCATION_FLAG_NEVER_ALLOCATE | Set this flag to only try to allocate from existing memory heaps and never create new such heap. +If new allocation cannot be placed in any of the existing heaps, allocation fails with 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 |
enum D3D12MA::ALLOCATOR_FLAGS | +
Bit flags to be used with ALLOCATOR_DESC::Flags.
+Enumerator | |
---|---|
ALLOCATOR_FLAG_NONE | Zero. + |
ALLOCATOR_FLAG_SINGLETHREADED | Allocator and all objects created from it will not be synchronized internally, so you must guarantee they are used from only one thread at a time or synchronized by you. +Using this flag may increase performance because internal mutexes are not used. + |
ALLOCATOR_FLAG_ALWAYS_COMMITTED | Every allocation will have its own memory block. To be used for debugging purposes. + |
HRESULT D3D12MA::CreateAllocator | +( | +const ALLOCATOR_DESC * | +pDesc, | +
+ | + | Allocator ** | +ppAllocator | +
+ | ) | ++ |
Creates new main D3D12MA::Allocator object and returns it through ppAllocator
.
You normally only need to call it once and keep a single Allocator object for your ID3D12Device
.
HRESULT D3D12MA::CreateVirtualBlock | +( | +const VIRTUAL_BLOCK_DESC * | +pDesc, | +
+ | + | VirtualBlock ** | +ppVirtualBlock | +
+ | ) | ++ |
Creates new D3D12MA::VirtualBlock object and returns it through ppVirtualBlock
.
Note you don't need to create D3D12MA::Allocator to use virtual blocks.
+ +const UINT D3D12MA::HEAP_TYPE_COUNT = 4 | +
Number of D3D12 memory heap types supported.
+ +