diff --git a/docs/html/_d3_d12_mem_alloc_8h.html b/docs/html/_d3_d12_mem_alloc_8h.html index fe23899..f89f5fc 100644 --- a/docs/html/_d3_d12_mem_alloc_8h.html +++ b/docs/html/_d3_d12_mem_alloc_8h.html @@ -3,12 +3,14 @@ - + Direct3D 12 Memory Allocator: D:/PROJECTS/D3D12 Memory Allocator/REPO/include/D3D12MemAlloc.h File Reference + + @@ -29,7 +31,7 @@ - + @@ -154,31 +156,31 @@ Classes - +

Namespaces

namespace  D3D12MA
namespace  D3D12MA
 
- + - +

Macros

#define D3D12MA_DXGI_1_4   0
#define D3D12MA_DXGI_1_4   0
 
#define D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT   1
#define D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT   1
 
- + - - - - - - + + + + + +

Typedefs

typedef UINT64 D3D12MA::AllocHandle
typedef UINT64 D3D12MA::AllocHandle
 Unique identifier of single allocation done inside the memory heap.
 
using D3D12MA::ALLOCATE_FUNC_PTR = void *(*)(size_t Size, size_t Alignment, void *pPrivateData)
 Pointer to custom callback function that allocates CPU memory.
 
using D3D12MA::FREE_FUNC_PTR = void(*)(void *pMemory, void *pPrivateData)
 Pointer to custom callback function that deallocates CPU memory.
 
using D3D12MA::ALLOCATE_FUNC_PTR = void* (*)(size_t Size, size_t Alignment, void* pPrivateData)
 Pointer to custom callback function that allocates CPU memory.
 
using D3D12MA::FREE_FUNC_PTR = void (*)(void* pMemory, void* pPrivateData)
 Pointer to custom callback function that deallocates CPU memory.
 
- } - - - - - -

Enumerations

enum  D3D12MA::ALLOCATION_FLAGS {
+
enum  D3D12MA::ALLOCATION_FLAGS {
  D3D12MA::ALLOCATION_FLAG_NONE = 0 , D3D12MA::ALLOCATION_FLAG_COMMITTED = 0x1 , D3D12MA::ALLOCATION_FLAG_NEVER_ALLOCATE = 0x2 @@ -197,44 +199,45 @@ Enumerations
 Bit flags to be used with ALLOCATION_DESC::Flags. More...
 
enum  D3D12MA::DEFRAGMENTATION_FLAGS { D3D12MA::DEFRAGMENTATION_FLAG_ALGORITHM_FAST = 0x1 +
enum  D3D12MA::DEFRAGMENTATION_FLAGS { D3D12MA::DEFRAGMENTATION_FLAG_ALGORITHM_FAST = 0x1 , D3D12MA::DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED = 0x2 , D3D12MA::DEFRAGMENTATION_FLAG_ALGORITHM_FULL = 0x4 , D3D12MA::DEFRAGMENTATION_FLAG_ALGORITHM_MASK }
 Flags to be passed as DEFRAGMENTATION_DESC::Flags. More...
 
enum  D3D12MA::DEFRAGMENTATION_MOVE_OPERATION { D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_COPY = 0 +
enum  D3D12MA::DEFRAGMENTATION_MOVE_OPERATION { D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_COPY = 0 , D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_IGNORE = 1 , D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_DESTROY = 2 }
 Operation performed on single defragmentation move. More...
 
enum  D3D12MA::POOL_FLAGS { D3D12MA::POOL_FLAG_NONE = 0 +
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 {
+
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 +, D3D12MA::ALLOCATOR_FLAG_DONT_PREFER_SMALL_BUFFERS_COMMITTED = 0x10
}
 Bit flags to be used with ALLOCATOR_DESC::Flags. More...
 
enum  D3D12MA::VIRTUAL_BLOCK_FLAGS { D3D12MA::VIRTUAL_BLOCK_FLAG_NONE = 0 +
enum  D3D12MA::VIRTUAL_BLOCK_FLAGS { D3D12MA::VIRTUAL_BLOCK_FLAG_NONE = 0 , D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR = POOL_FLAG_ALGORITHM_LINEAR , D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK = POOL_FLAG_ALGORITHM_MASK }
 Bit flags to be used with VIRTUAL_BLOCK_DESC::Flags. More...
 
enum  D3D12MA::VIRTUAL_ALLOCATION_FLAGS {
+
enum  D3D12MA::VIRTUAL_ALLOCATION_FLAGS {
  D3D12MA::VIRTUAL_ALLOCATION_FLAG_NONE = 0 , D3D12MA::VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS = ALLOCATION_FLAG_UPPER_ADDRESS , D3D12MA::VIRTUAL_ALLOCATION_FLAG_STRATEGY_MIN_MEMORY = ALLOCATION_FLAG_STRATEGY_MIN_MEMORY @@ -249,10 +252,10 @@ Enumerations
- + - +

Functions

D3D12MA_API HRESULT D3D12MA::CreateAllocator (const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)
D3D12MA_API HRESULT D3D12MA::CreateAllocator (const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)
 Creates new main D3D12MA::Allocator object and returns it through ppAllocator.
 
D3D12MA_API HRESULT D3D12MA::CreateVirtualBlock (const VIRTUAL_BLOCK_DESC *pDesc, VirtualBlock **ppVirtualBlock)
D3D12MA_API HRESULT D3D12MA::CreateVirtualBlock (const VIRTUAL_BLOCK_DESC *pDesc, VirtualBlock **ppVirtualBlock)
 Creates new D3D12MA::VirtualBlock object and returns it through ppVirtualBlock.
 
@@ -288,7 +291,7 @@ Functions diff --git a/docs/html/annotated.html b/docs/html/annotated.html index bbdb808..b9ed743 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -3,12 +3,14 @@ - + Direct3D 12 Memory Allocator: Class List + + @@ -29,7 +31,7 @@ - + @@ -73,8 +75,8 @@ $(function() {
Here are the classes, structs, unions and interfaces with brief descriptions:
-
[detail level 12]
- +
[detail level 12]
 ND3D12MA
+ @@ -101,7 +103,7 @@ $(function() { diff --git a/docs/html/class_d3_d12_m_a_1_1_allocation-members.html b/docs/html/class_d3_d12_m_a_1_1_allocation-members.html index 54124d8..0e0838e 100644 --- a/docs/html/class_d3_d12_m_a_1_1_allocation-members.html +++ b/docs/html/class_d3_d12_m_a_1_1_allocation-members.html @@ -3,12 +3,14 @@ - +Direct3D 12 Memory Allocator: Member List + + @@ -29,7 +31,7 @@
 ND3D12MA
 CAllocationRepresents single memory allocation
 CALLOCATION_CALLBACKSCustom callbacks to CPU memory allocation functions
 CALLOCATION_DESCParameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource
- + @@ -103,7 +105,7 @@ $(function() {
diff --git a/docs/html/class_d3_d12_m_a_1_1_allocation.html b/docs/html/class_d3_d12_m_a_1_1_allocation.html index a13d897..01c630a 100644 --- a/docs/html/class_d3_d12_m_a_1_1_allocation.html +++ b/docs/html/class_d3_d12_m_a_1_1_allocation.html @@ -3,12 +3,14 @@ - + Direct3D 12 Memory Allocator: D3D12MA::Allocation Class Reference + + @@ -29,7 +31,7 @@ - + @@ -74,7 +76,6 @@ $(function() {
-Classes | Public Member Functions | List of all members
D3D12MA::Allocation Class Reference
@@ -82,7 +83,7 @@ $(function() {

Represents single memory allocation. - More...

+ More...

#include <D3D12MemAlloc.h>

@@ -94,37 +95,37 @@ Inheritance diagram for D3D12MA::Allocation:
- + - + - + - + - + - + - + - + - + - + - +

Public Member Functions

UINT64 GetOffset () const
UINT64 GetOffset () const
 Returns offset in bytes from the start of memory heap.
 
UINT64 GetAlignment () const
UINT64 GetAlignment () const
 Returns alignment that resource was created with.
 
UINT64 GetSize () const
UINT64 GetSize () const
 Returns size in bytes of the allocation.
 
ID3D12Resource * GetResource () const
ID3D12Resource * GetResource () const
 Returns D3D12 resource associated with this object.
 
void SetResource (ID3D12Resource *pResource)
void SetResource (ID3D12Resource *pResource)
 Releases the resource currently pointed by the allocation (if any), sets it to new one, incrementing its reference counter (if not null).
 
ID3D12Heap * GetHeap () const
ID3D12Heap * GetHeap () const
 Returns memory heap that the resource is created in.
 
void SetPrivateData (void *pPrivateData)
void SetPrivateData (void *pPrivateData)
 Changes custom pointer for an allocation to a new value.
 
void * GetPrivateData () const
void * GetPrivateData () const
 Get custom pointer associated with the allocation.
 
void SetName (LPCWSTR Name)
void SetName (LPCWSTR Name)
 Associates a name with the allocation object. This name is for use in debug diagnostics and tools.
 
LPCWSTR GetName () const
LPCWSTR GetName () const
 Returns the name associated with the allocation object.
 
BOOL WasZeroInitialized () const
BOOL WasZeroInitialized () const
 Returns TRUE if the memory of the allocation was filled with zeros when the allocation was created.
 
@@ -147,7 +148,7 @@ Public Member Functions UINT64 D3D12MA::Allocation::GetAlignment ( - ) + ) const @@ -171,7 +172,7 @@ Public Member Functions ID3D12Heap * D3D12MA::Allocation::GetHeap ( - ) + ) const @@ -194,7 +195,7 @@ Public Member Functions LPCWSTR D3D12MA::Allocation::GetName ( - ) + ) const @@ -220,7 +221,7 @@ Public Member Functions UINT64 D3D12MA::Allocation::GetOffset ( - ) + ) const @@ -244,7 +245,7 @@ Public Member Functions void * D3D12MA::Allocation::GetPrivateData ( - ) + ) const @@ -271,7 +272,7 @@ Public Member Functions ID3D12Resource * D3D12MA::Allocation::GetResource ( - ) + ) const @@ -299,7 +300,7 @@ Public Member Functions UINT64 D3D12MA::Allocation::GetSize ( - ) + ) const @@ -314,7 +315,7 @@ Public Member Functions
@@ -328,8 +329,7 @@ Public Member Functions void D3D12MA::Allocation::SetName ( - LPCWSTR  - Name) + LPCWSTR Name) @@ -353,8 +353,7 @@ Public Member Functions void D3D12MA::Allocation::SetPrivateData ( - void *  - pPrivateData) + void * pPrivateData) @@ -378,8 +377,7 @@ Public Member Functions void D3D12MA::Allocation::SetResource ( - ID3D12Resource *  - pResource) + ID3D12Resource * pResource) @@ -401,7 +399,7 @@ Public Member Functions BOOL D3D12MA::Allocation::WasZeroInitialized ( - ) + ) const @@ -473,7 +471,7 @@ Public Member Functions
- +
CommittedAllocationList* D3D12MA::Allocation::listCommittedAllocationList* D3D12MA::Allocation::list
@@ -481,7 +479,7 @@ Public Member Functions
-

◆ 

+

◆ [struct]

@@ -495,7 +493,7 @@ Public Member Functions
-

◆ 

+

◆ [struct]

@@ -509,7 +507,7 @@ Public Member Functions
-

◆ 

+

◆ [struct]

@@ -556,7 +554,7 @@ Public Member Functions
diff --git a/docs/html/class_d3_d12_m_a_1_1_allocation.png b/docs/html/class_d3_d12_m_a_1_1_allocation.png index 127b1af..57188b3 100644 Binary files a/docs/html/class_d3_d12_m_a_1_1_allocation.png and b/docs/html/class_d3_d12_m_a_1_1_allocation.png differ diff --git a/docs/html/class_d3_d12_m_a_1_1_allocator-members.html b/docs/html/class_d3_d12_m_a_1_1_allocator-members.html index 2534d48..9211af4 100644 --- a/docs/html/class_d3_d12_m_a_1_1_allocator-members.html +++ b/docs/html/class_d3_d12_m_a_1_1_allocator-members.html @@ -3,12 +3,14 @@ - + Direct3D 12 Memory Allocator: Member List + + @@ -29,7 +31,7 @@
- + @@ -102,7 +104,7 @@ $(function() { diff --git a/docs/html/class_d3_d12_m_a_1_1_allocator.html b/docs/html/class_d3_d12_m_a_1_1_allocator.html index 9e4fa2d..e71636d 100644 --- a/docs/html/class_d3_d12_m_a_1_1_allocator.html +++ b/docs/html/class_d3_d12_m_a_1_1_allocator.html @@ -3,12 +3,14 @@ - + Direct3D 12 Memory Allocator: D3D12MA::Allocator Class Reference + + @@ -29,7 +31,7 @@ - + @@ -81,7 +83,7 @@ $(function() {

Represents main object of this library initialized for particular ID3D12Device. - More...

+ More...

#include <D3D12MemAlloc.h>

@@ -93,64 +95,64 @@ Inheritance diagram for D3D12MA::Allocator:
- + - + - + - + - + - - + + - - + + - + - + - - + + - - + + - + - + - + - + - + - - + + - +

Public Member Functions

const D3D12_FEATURE_DATA_D3D12_OPTIONS & GetD3D12Options () const
const D3D12_FEATURE_DATA_D3D12_OPTIONS & GetD3D12Options () const
 Returns cached options retrieved from D3D12 device.
 
BOOL IsUMA () const
BOOL IsUMA () const
 Returns true if D3D12_FEATURE_DATA_ARCHITECTURE1::UMA was found to be true.
 
BOOL IsCacheCoherentUMA () const
BOOL IsCacheCoherentUMA () const
 Returns true if D3D12_FEATURE_DATA_ARCHITECTURE1::CacheCoherentUMA was found to be true.
 
UINT64 GetMemoryCapacity (UINT memorySegmentGroup) const
UINT64 GetMemoryCapacity (UINT memorySegmentGroup) const
 Returns total amount of memory of specific segment group, in bytes.
 
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)
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.
 
HRESULT CreateResource2 (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, Allocation **ppAllocation, REFIID riidResource, void **ppvResource)
 Similar to Allocator::CreateResource, but supports new structure D3D12_RESOURCE_DESC1.
HRESULT CreateResource2 (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, Allocation **ppAllocation, REFIID riidResource, void **ppvResource)
 Similar to Allocator::CreateResource, but supports new structure D3D12_RESOURCE_DESC1.
 
HRESULT CreateResource3 (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, DXGI_FORMAT *pCastableFormats, Allocation **ppAllocation, REFIID riidResource, void **ppvResource)
 Similar to Allocator::CreateResource2, but there are initial layout instead of state and castable formats list.
HRESULT CreateResource3 (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, DXGI_FORMAT *pCastableFormats, Allocation **ppAllocation, REFIID riidResource, void **ppvResource)
 Similar to Allocator::CreateResource2, but there are initial layout instead of state and castable formats list.
 
HRESULT AllocateMemory (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_ALLOCATION_INFO *pAllocInfo, Allocation **ppAllocation)
HRESULT AllocateMemory (const ALLOCATION_DESC *pAllocDesc, const D3D12_RESOURCE_ALLOCATION_INFO *pAllocInfo, Allocation **ppAllocation)
 Allocates memory without creating any resource placed in it.
 
HRESULT CreateAliasingResource (Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riidResource, void **ppvResource)
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.
 
HRESULT CreateAliasingResource1 (Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riidResource, void **ppvResource)
 Similar to Allocator::CreateAliasingResource, but supports new structure D3D12_RESOURCE_DESC1.
HRESULT CreateAliasingResource1 (Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riidResource, void **ppvResource)
 Similar to Allocator::CreateAliasingResource, but supports new structure D3D12_RESOURCE_DESC1.
 
HRESULT CreateAliasingResource2 (Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, DXGI_FORMAT *pCastableFormats, REFIID riidResource, void **ppvResource)
 Similar to Allocator::CreateAliasingResource1, but there are initial layout instead of state and castable formats list.
HRESULT CreateAliasingResource2 (Allocation *pAllocation, UINT64 AllocationLocalOffset, const D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_BARRIER_LAYOUT InitialLayout, const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, DXGI_FORMAT *pCastableFormats, REFIID riidResource, void **ppvResource)
 Similar to Allocator::CreateAliasingResource1, but there are initial layout instead of state and castable formats list.
 
HRESULT CreatePool (const POOL_DESC *pPoolDesc, Pool **ppPool)
HRESULT CreatePool (const POOL_DESC *pPoolDesc, Pool **ppPool)
 Creates custom pool.
 
void SetCurrentFrameIndex (UINT frameIndex)
void SetCurrentFrameIndex (UINT frameIndex)
 Sets the index of the current frame.
 
void GetBudget (Budget *pLocalBudget, Budget *pNonLocalBudget)
void GetBudget (Budget *pLocalBudget, Budget *pNonLocalBudget)
 Retrieves information about current memory usage and budget.
 
void CalculateStatistics (TotalStatistics *pStats)
void CalculateStatistics (TotalStatistics *pStats)
 Retrieves statistics from current state of the allocator.
 
void BuildStatsString (WCHAR **ppStatsString, BOOL DetailedMap) const
void BuildStatsString (WCHAR **ppStatsString, BOOL DetailedMap) const
 Builds and returns statistics as a string in JSON format.
 
void FreeStatsString (WCHAR *pStatsString) const
 Frees memory of a string returned from Allocator::BuildStatsString.
void FreeStatsString (WCHAR *pStatsString) const
 Frees memory of a string returned from Allocator::BuildStatsString.
 
void BeginDefragmentation (const DEFRAGMENTATION_DESC *pDesc, DefragmentationContext **ppContext)
void BeginDefragmentation (const DEFRAGMENTATION_DESC *pDesc, DefragmentationContext **ppContext)
 Begins defragmentation process of the default pools.
 

Detailed Description

Represents main object of this library initialized for particular ID3D12Device.

-

Fill structure D3D12MA::ALLOCATOR_DESC and call function CreateAllocator() to create it. Call method Release() to destroy it.

+

Fill structure D3D12MA::ALLOCATOR_DESC and call function CreateAllocator() to create it. Call method 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.

Member Function Documentation

@@ -162,25 +164,17 @@ Public Member Functions HRESULT D3D12MA::Allocator::AllocateMemory ( - const ALLOCATION_DESC *  - pAllocDesc, + const ALLOCATION_DESC * pAllocDesc, - const D3D12_RESOURCE_ALLOCATION_INFO *  - pAllocInfo, + const D3D12_RESOURCE_ALLOCATION_INFO * pAllocInfo, - Allocation **  - ppAllocation  - - - - ) - + Allocation ** ppAllocation )
@@ -202,19 +196,12 @@ Public Member Functions void D3D12MA::Allocator::BeginDefragmentation ( - const DEFRAGMENTATION_DESC *  - pDesc, + const DEFRAGMENTATION_DESC * pDesc, - DefragmentationContext **  - ppContext  - - - - ) - + DefragmentationContext ** ppContext )
@@ -240,19 +227,12 @@ Public Member Functions void D3D12MA::Allocator::BuildStatsString ( - WCHAR **  - ppStatsString, + WCHAR ** ppStatsString, - BOOL  - DetailedMap  - - - - ) - const + BOOL DetailedMap ) const
@@ -260,7 +240,7 @@ Public Member Functions

Builds and returns statistics as a string in JSON format.

Parameters
- +
[out]ppStatsStringMust be freed using Allocator::FreeStatsString.
[out]ppStatsStringMust be freed using Allocator::FreeStatsString.
DetailedMapTRUE to include full list of allocations (can make the string quite long), FALSE to only return statistics.
@@ -277,15 +257,14 @@ Public Member Functions void D3D12MA::Allocator::CalculateStatistics ( - TotalStatistics *  - pStats) + TotalStatistics * pStats)

Retrieves statistics from current state of the allocator.

-

This function is called "calculate" not "get" because it has to traverse all internal data structures, so it may be quite slow. Use it for debugging purposes. For faster but more brief statistics suitable to be called every frame or every allocation, use GetBudget().

+

This function is called "calculate" not "get" because it has to traverse all internal data structures, so it may be quite slow. Use it for debugging purposes. For faster but more brief statistics suitable to be called every frame or every allocation, use GetBudget().

Note that when using allocator from multiple threads, returned information may immediately become outdated.

@@ -299,49 +278,37 @@ Public Member Functions HRESULT D3D12MA::Allocator::CreateAliasingResource ( - Allocation *  - pAllocation, + Allocation * pAllocation, - UINT64  - AllocationLocalOffset, + UINT64 AllocationLocalOffset, - const D3D12_RESOURCE_DESC *  - pResourceDesc, + const D3D12_RESOURCE_DESC * pResourceDesc, - D3D12_RESOURCE_STATES  - InitialResourceState, + D3D12_RESOURCE_STATES InitialResourceState, - const D3D12_CLEAR_VALUE *  - pOptimizedClearValue, + const D3D12_CLEAR_VALUE * pOptimizedClearValue, - REFIID  - riidResource, + REFIID riidResource, - void **  - ppvResource  - - - - ) - + void ** ppvResource )
@@ -349,7 +316,7 @@ Public Member Functions

Creates a new resource in place of an existing allocation. This is useful for memory aliasing.

Parameters
- + @@ -372,54 +339,42 @@ Public Member Functions - - + - - + - - + - - + - - + - - + - - - - - - - +
pAllocationExisting 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.
pAllocationExisting 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.
AllocationLocalOffsetAdditional 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.
pResourceDescDescription of the new resource to be created.
InitialResourceState
HRESULT D3D12MA::Allocator::CreateAliasingResource1 (AllocationpAllocation, Allocation * pAllocation,
UINT64 AllocationLocalOffset, UINT64 AllocationLocalOffset,
const D3D12_RESOURCE_DESC1 * pResourceDesc, const D3D12_RESOURCE_DESC1 * pResourceDesc,
D3D12_RESOURCE_STATES InitialResourceState, D3D12_RESOURCE_STATES InitialResourceState,
const D3D12_CLEAR_VALUE * pOptimizedClearValue, const D3D12_CLEAR_VALUE * pOptimizedClearValue,
REFIID riidResource, REFIID riidResource,
void ** ppvResource 
)void ** ppvResource )
-

Similar to Allocator::CreateAliasingResource, but supports new structure D3D12_RESOURCE_DESC1.

+

Similar to Allocator::CreateAliasingResource, but supports new structure D3D12_RESOURCE_DESC1.

It internally uses ID3D12Device8::CreatePlacedResource1.

To work correctly, ID3D12Device8 interface must be available in the current system. Otherwise, E_NOINTERFACE is returned.

@@ -434,66 +389,52 @@ Public Member Functions HRESULT D3D12MA::Allocator::CreateAliasingResource2 ( - Allocation *  - pAllocation, + Allocation * pAllocation, - UINT64  - AllocationLocalOffset, + UINT64 AllocationLocalOffset, - const D3D12_RESOURCE_DESC1 *  - pResourceDesc, + const D3D12_RESOURCE_DESC1 * pResourceDesc, - D3D12_BARRIER_LAYOUT  - InitialLayout, + D3D12_BARRIER_LAYOUT InitialLayout, - const D3D12_CLEAR_VALUE *  - pOptimizedClearValue, + const D3D12_CLEAR_VALUE * pOptimizedClearValue, - UINT32  - NumCastableFormats, + UINT32 NumCastableFormats, - DXGI_FORMAT *  - pCastableFormats, + DXGI_FORMAT * pCastableFormats, - REFIID  - riidResource, + REFIID riidResource, - void **  - ppvResource  - - - - ) - + void ** ppvResource )
-

Similar to Allocator::CreateAliasingResource1, but there are initial layout instead of state and castable formats list.

+

Similar to Allocator::CreateAliasingResource1, but there are initial layout instead of state and castable formats list.

It internally uses ID3D12Device10::CreatePlacedResource2.

To work correctly, ID3D12Device10 interface must be available in the current system. Otherwise, E_NOINTERFACE is returned.

@@ -508,19 +449,12 @@ Public Member Functions HRESULT D3D12MA::Allocator::CreatePool ( - const POOL_DESC *  - pPoolDesc, + const POOL_DESC * pPoolDesc, - Pool **  - ppPool  - - - - ) - + Pool ** ppPool )
@@ -538,49 +472,37 @@ Public Member Functions HRESULT D3D12MA::Allocator::CreateResource ( - const ALLOCATION_DESC *  - pAllocDesc, + const ALLOCATION_DESC * pAllocDesc, - const D3D12_RESOURCE_DESC *  - pResourceDesc, + const D3D12_RESOURCE_DESC * pResourceDesc, - D3D12_RESOURCE_STATES  - InitialResourceState, + D3D12_RESOURCE_STATES InitialResourceState, - const D3D12_CLEAR_VALUE *  - pOptimizedClearValue, + const D3D12_CLEAR_VALUE * pOptimizedClearValue, - Allocation **  - ppAllocation, + Allocation ** ppAllocation, - REFIID  - riidResource, + REFIID riidResource, - void **  - ppvResource  - - - - ) - + void ** ppvResource )
@@ -614,54 +536,42 @@ Public Member Functions HRESULT D3D12MA::Allocator::CreateResource2 ( - const ALLOCATION_DESC *  - pAllocDesc, + const ALLOCATION_DESC * pAllocDesc, - const D3D12_RESOURCE_DESC1 *  - pResourceDesc, + const D3D12_RESOURCE_DESC1 * pResourceDesc, - D3D12_RESOURCE_STATES  - InitialResourceState, + D3D12_RESOURCE_STATES InitialResourceState, - const D3D12_CLEAR_VALUE *  - pOptimizedClearValue, + const D3D12_CLEAR_VALUE * pOptimizedClearValue, - Allocation **  - ppAllocation, + Allocation ** ppAllocation, - REFIID  - riidResource, + REFIID riidResource, - void **  - ppvResource  - - - - ) - + void ** ppvResource )
-

Similar to Allocator::CreateResource, but supports new structure D3D12_RESOURCE_DESC1.

+

Similar to Allocator::CreateResource, 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.

@@ -676,66 +586,52 @@ Public Member Functions HRESULT D3D12MA::Allocator::CreateResource3 ( - const ALLOCATION_DESC *  - pAllocDesc, + const ALLOCATION_DESC * pAllocDesc, - const D3D12_RESOURCE_DESC1 *  - pResourceDesc, + const D3D12_RESOURCE_DESC1 * pResourceDesc, - D3D12_BARRIER_LAYOUT  - InitialLayout, + D3D12_BARRIER_LAYOUT InitialLayout, - const D3D12_CLEAR_VALUE *  - pOptimizedClearValue, + const D3D12_CLEAR_VALUE * pOptimizedClearValue, - UINT32  - NumCastableFormats, + UINT32 NumCastableFormats, - DXGI_FORMAT *  - pCastableFormats, + DXGI_FORMAT * pCastableFormats, - Allocation **  - ppAllocation, + Allocation ** ppAllocation, - REFIID  - riidResource, + REFIID riidResource, - void **  - ppvResource  - - - - ) - + void ** ppvResource )
-

Similar to Allocator::CreateResource2, but there are initial layout instead of state and castable formats list.

+

Similar to Allocator::CreateResource2, but there are initial layout instead of state and castable formats list.

It internally uses ID3D12Device10::CreateCommittedResource3 or ID3D12Device10::CreatePlacedResource2.

To work correctly, ID3D12Device10 interface must be available in the current system. Otherwise, E_NOINTERFACE is returned.

@@ -750,14 +646,13 @@ Public Member Functions void D3D12MA::Allocator::FreeStatsString ( - WCHAR *  - pStatsString) + WCHAR * pStatsString) const
-

Frees memory of a string returned from Allocator::BuildStatsString.

+

Frees memory of a string returned from Allocator::BuildStatsString.

@@ -770,19 +665,12 @@ Public Member Functions void D3D12MA::Allocator::GetBudget ( - Budget *  - pLocalBudget, + Budget * pLocalBudget, - Budget *  - pNonLocalBudget  - - - - ) - + Budget * pNonLocalBudget )
@@ -796,18 +684,18 @@ Public Member Functions
@@ -821,7 +709,7 @@ Public Member Functions const D3D12_FEATURE_DATA_D3D12_OPTIONS & D3D12MA::Allocator::GetD3D12Options ( - ) + ) const @@ -840,8 +728,7 @@ Public Member Functions UINT64 D3D12MA::Allocator::GetMemoryCapacity ( - UINT  - memorySegmentGroup) + UINT memorySegmentGroup) const @@ -854,14 +741,14 @@ Public Member Functions -

This information is taken from DXGI_ADAPTER_DESC. It is not recommended to use this number. You should preferably call GetBudget() and limit memory usage to D3D12MA::Budget::BudgetBytes instead.

+

This information is taken from DXGI_ADAPTER_DESC. It is not recommended to use this number. You should preferably call GetBudget() and limit memory usage to D3D12MA::Budget::BudgetBytes instead.