From 4488fa2a731e9fcae9e4b4cc941183995ba8abbf Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Fri, 3 Dec 2021 18:08:24 +0100 Subject: [PATCH] Improved and rebuilt documentation --- docs/html/_d3_d12_mem_alloc_8h.html | 20 ++--- docs/html/annotated.html | 4 +- .../html/class_d3_d12_m_a_1_1_allocation.html | 2 +- ...lass_d3_d12_m_a_1_1_allocator-members.html | 2 +- docs/html/class_d3_d12_m_a_1_1_allocator.html | 4 +- docs/html/class_d3_d12_m_a_1_1_pool.html | 2 +- ..._d3_d12_m_a_1_1_virtual_block-members.html | 2 +- .../class_d3_d12_m_a_1_1_virtual_block.html | 5 +- docs/html/configuration.html | 20 ++--- docs/html/custom_pools.html | 2 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 84 +++++++++++++++++++ docs/html/files.html | 2 +- docs/html/functions.html | 4 +- docs/html/functions_rela.html | 4 +- docs/html/general_considerations.html | 1 + docs/html/hierarchy.html | 4 +- docs/html/namespace_d3_d12_m_a.html | 28 +++---- docs/html/namespacemembers.html | 4 +- docs/html/namespacemembers_func.html | 4 +- docs/html/namespaces.html | 4 +- docs/html/quick_start.html | 20 ++--- docs/html/resource_aliasing.html | 8 +- docs/html/search/all_2.js | 4 +- docs/html/search/functions_2.js | 4 +- docs/html/search/related_0.js | 4 +- ...l_l_o_c_a_t_i_o_n___c_a_l_l_b_a_c_k_s.html | 2 +- ...m_a_1_1_a_l_l_o_c_a_t_i_o_n___d_e_s_c.html | 2 +- ...2_m_a_1_1_a_l_l_o_c_a_t_o_r___d_e_s_c.html | 6 +- docs/html/struct_d3_d12_m_a_1_1_budget.html | 2 +- ...ruct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html | 2 +- .../html/struct_d3_d12_m_a_1_1_stat_info.html | 2 +- docs/html/struct_d3_d12_m_a_1_1_stats.html | 2 +- ...u_a_l___a_l_l_o_c_a_t_i_o_n___d_e_s_c.html | 2 +- ...u_a_l___a_l_l_o_c_a_t_i_o_n___i_n_f_o.html | 2 +- ...1_v_i_r_t_u_a_l___b_l_o_c_k___d_e_s_c.html | 6 +- docs/html/virtual_allocator.html | 24 +++--- include/D3D12MemAlloc.h | 3 + 37 files changed, 193 insertions(+), 104 deletions(-) create mode 100644 docs/html/dir_d44c64559bbebec7f509842c48db8b23.html diff --git a/docs/html/_d3_d12_mem_alloc_8h.html b/docs/html/_d3_d12_mem_alloc_8h.html index 21a3a21..de2f514 100644 --- a/docs/html/_d3_d12_mem_alloc_8h.html +++ b/docs/html/_d3_d12_mem_alloc_8h.html @@ -5,7 +5,7 @@ -Direct3D 12 Memory Allocator: D:/PROJECTS/D3D12 Memory Allocator/REPO/src/D3D12MemAlloc.h File Reference +Direct3D 12 Memory Allocator: D:/PROJECTS/D3D12 Memory Allocator/REPO/include/D3D12MemAlloc.h File Reference @@ -62,7 +62,7 @@ $(function() {
@@ -98,7 +98,7 @@ Classes  Custom memory pool. More...
  struct  D3D12MA::ALLOCATOR_DESC - Parameters of created Allocator object. To be used with CreateAllocator(). More...
+ Parameters of created Allocator object. To be used with CreateAllocator(). More...
  struct  D3D12MA::StatInfo  Calculated statistics of memory usage in entire allocator. More...
@@ -113,7 +113,7 @@ Classes  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...
+ 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...
@@ -164,12 +164,12 @@ Enumerations - - - - - - + + + + + +

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...
 
D3D12MA_API HRESULT D3D12MA::CreateAllocator (const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)
 Creates new main D3D12MA::Allocator object and returns it through ppAllocator. More...
 
D3D12MA_API HRESULT D3D12MA::CreateVirtualBlock (const VIRTUAL_BLOCK_DESC *pDesc, VirtualBlock **ppVirtualBlock)
 Creates new D3D12MA::VirtualBlock object and returns it through ppVirtualBlock. More...
 
diff --git a/docs/html/annotated.html b/docs/html/annotated.html index d24daf4..d06f048 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -72,7 +72,7 @@ $(function() { - + @@ -80,7 +80,7 @@ $(function() { - +

Variables

 CALLOCATION_CALLBACKSCustom callbacks to CPU memory allocation functions
 CALLOCATION_DESCParameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource
 CAllocatorRepresents main object of this library initialized for particular ID3D12Device
 CALLOCATOR_DESCParameters of created Allocator object. To be used with CreateAllocator()
 CALLOCATOR_DESCParameters of created Allocator object. To be used with CreateAllocator()
 CBudgetStatistics of current memory usage and available budget, in bytes, for GPU or CPU memory
 CPoolCustom memory pool
 CPOOL_DESCParameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool
 CStatsGeneral statistics from the current state of the allocator
 CVIRTUAL_ALLOCATION_DESCParameters of created virtual allocation to be passed to VirtualBlock::Allocate()
 CVIRTUAL_ALLOCATION_INFOParameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo()
 CVIRTUAL_BLOCK_DESCParameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock()
 CVIRTUAL_BLOCK_DESCParameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock()
 CVirtualBlockRepresents pure allocation algorithm and a data structure with allocations in some memory block, without actually allocating any GPU memory
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 cb34c57..b28a911 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 @@ -426,7 +426,7 @@ Public Member Functions
The documentation for this class was generated from the following file: 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 3a9256a..78ea2b5 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 @@ -77,7 +77,7 @@ $(function() { BuildStatsString(WCHAR **ppStatsString, BOOL DetailedMap) constD3D12MA::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 - CreateAllocatorD3D12MA::Allocatorfriend + CreateAllocatorD3D12MA::Allocatorfriend 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 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 59df19e..b9a0092 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 @@ -134,7 +134,7 @@ Public Member Functions

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

@@ -741,7 +741,7 @@ Public Member Functions
The documentation for this class was generated from the following file: diff --git a/docs/html/class_d3_d12_m_a_1_1_pool.html b/docs/html/class_d3_d12_m_a_1_1_pool.html index b575cab..6831db5 100644 --- a/docs/html/class_d3_d12_m_a_1_1_pool.html +++ b/docs/html/class_d3_d12_m_a_1_1_pool.html @@ -188,7 +188,7 @@ Public Member Functions
The documentation for this class was generated from the following file: diff --git a/docs/html/class_d3_d12_m_a_1_1_virtual_block-members.html b/docs/html/class_d3_d12_m_a_1_1_virtual_block-members.html index 1db8cd5..55c3d02 100644 --- a/docs/html/class_d3_d12_m_a_1_1_virtual_block-members.html +++ b/docs/html/class_d3_d12_m_a_1_1_virtual_block-members.html @@ -76,7 +76,7 @@ $(function() { BuildStatsString(WCHAR **ppStatsString) constD3D12MA::VirtualBlock CalculateStats(StatInfo *pInfo) constD3D12MA::VirtualBlock Clear()D3D12MA::VirtualBlock - CreateVirtualBlockD3D12MA::VirtualBlockfriend + CreateVirtualBlockD3D12MA::VirtualBlockfriend D3D12MA_DELETED3D12MA::VirtualBlockfriend FreeAllocation(UINT64 offset)D3D12MA::VirtualBlock FreeStatsString(WCHAR *pStatsString) constD3D12MA::VirtualBlock diff --git a/docs/html/class_d3_d12_m_a_1_1_virtual_block.html b/docs/html/class_d3_d12_m_a_1_1_virtual_block.html index d29aa39..7e11f17 100644 --- a/docs/html/class_d3_d12_m_a_1_1_virtual_block.html +++ b/docs/html/class_d3_d12_m_a_1_1_virtual_block.html @@ -117,7 +117,8 @@ Public Member Functions

Detailed Description

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(). You need to free all the allocations within this block or call Clear() before destroying it.

+

To create this object, fill in D3D12MA::VIRTUAL_BLOCK_DESC and call CreateVirtualBlock(). To destroy it, call its method VirtualBlock::Release(). You need to free all the allocations within this block or call Clear() before destroying it.

+

This object is not thread-safe - should not be used from multiple threads simultaneously, must be synchronized externally.

Member Function Documentation

◆ Allocate()

@@ -342,7 +343,7 @@ Public Member Functions
The documentation for this class was generated from the following file: diff --git a/docs/html/configuration.html b/docs/html/configuration.html index a6313d0..e1b0133 100644 --- a/docs/html/configuration.html +++ b/docs/html/configuration.html @@ -100,16 +100,16 @@ Custom CPU memory allocator
allocatorDesc.pAllocationCallbacks = &allocationCallbacks;
D3D12MA::Allocator* allocator;
-
HRESULT hr = D3D12MA::CreateAllocator(&allocatorDesc, &allocator);
-
Represents main object of this library initialized for particular ID3D12Device.
Definition: D3D12MemAlloc.h:661
-
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:166
-
FREE_FUNC_PTR pFree
Dellocation function.
Definition: D3D12MemAlloc.h:170
-
ALLOCATE_FUNC_PTR pAllocate
Allocation function.
Definition: D3D12MemAlloc.h:168
-
Parameters of created Allocator object. To be used with CreateAllocator().
Definition: D3D12MemAlloc.h:542
-
const ALLOCATION_CALLBACKS * pAllocationCallbacks
Custom CPU memory allocation callbacks. Optional.
Definition: D3D12MemAlloc.h:562
-
IDXGIAdapter * pAdapter
Definition: D3D12MemAlloc.h:568
-
ID3D12Device * pDevice
Definition: D3D12MemAlloc.h:550
+
HRESULT hr = D3D12MA::CreateAllocator(&allocatorDesc, &allocator);
+
Represents main object of this library initialized for particular ID3D12Device.
Definition: D3D12MemAlloc.h:670
+
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:175
+
FREE_FUNC_PTR pFree
Dellocation function.
Definition: D3D12MemAlloc.h:179
+
ALLOCATE_FUNC_PTR pAllocate
Allocation function.
Definition: D3D12MemAlloc.h:177
+
Parameters of created Allocator object. To be used with CreateAllocator().
Definition: D3D12MemAlloc.h:551
+
const ALLOCATION_CALLBACKS * pAllocationCallbacks
Custom CPU memory allocation callbacks. Optional.
Definition: D3D12MemAlloc.h:571
+
IDXGIAdapter * pAdapter
Definition: D3D12MemAlloc.h:577
+
ID3D12Device * pDevice
Definition: D3D12MemAlloc.h:559
diff --git a/docs/html/custom_pools.html b/docs/html/custom_pools.html index e1aa7e5..872238d 100644 --- a/docs/html/custom_pools.html +++ b/docs/html/custom_pools.html @@ -110,7 +110,7 @@ Features and benefits
ID3D12Resource* res;
hr = allocator->CreateResource(&allocDesc, &resDesc,
D3D12_RESOURCE_STATE_GENERIC_READ, NULL, &alloc, IID_PPV_ARGS(&res));
-
@ ALLOCATION_FLAG_COMMITTED
Definition: D3D12MemAlloc.h:186
+
@ ALLOCATION_FLAG_COMMITTED
Definition: D3D12MemAlloc.h:195

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.

diff --git a/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html b/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html new file mode 100644 index 0000000..bb717a3 --- /dev/null +++ b/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html @@ -0,0 +1,84 @@ + + + + + + + +Direct3D 12 Memory Allocator: D:/PROJECTS/D3D12 Memory Allocator/REPO/include Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
Direct3D 12 Memory Allocator +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
include Directory Reference
+
+
+ + + + +

+Files

file  D3D12MemAlloc.h
 
+
+ + + + diff --git a/docs/html/files.html b/docs/html/files.html index 8a652b2..4d96965 100644 --- a/docs/html/files.html +++ b/docs/html/files.html @@ -67,7 +67,7 @@ $(function() {
Here is a list of all files with brief descriptions:
[detail level 12]
- +
  src
  include
 D3D12MemAlloc.h
diff --git a/docs/html/functions.html b/docs/html/functions.html index 73234fd..df7bf4b 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -91,12 +91,12 @@ $(function() {
  • CalculateStats() : D3D12MA::Allocator, D3D12MA::Pool, D3D12MA::VirtualBlock
  • Clear() : D3D12MA::VirtualBlock
  • CreateAliasingResource() : D3D12MA::Allocator
  • -
  • CreateAllocator : D3D12MA::Allocator
  • +
  • CreateAllocator : D3D12MA::Allocator
  • CreatePool() : D3D12MA::Allocator
  • CreateResource() : D3D12MA::Allocator
  • CreateResource1() : D3D12MA::Allocator
  • CreateResource2() : D3D12MA::Allocator
  • -
  • CreateVirtualBlock : D3D12MA::VirtualBlock
  • +
  • CreateVirtualBlock : D3D12MA::VirtualBlock
  • CustomPool : D3D12MA::ALLOCATION_DESC
  • diff --git a/docs/html/functions_rela.html b/docs/html/functions_rela.html index 4ff075a..bad1cd6 100644 --- a/docs/html/functions_rela.html +++ b/docs/html/functions_rela.html @@ -63,8 +63,8 @@ $(function() {
     
    diff --git a/docs/html/general_considerations.html b/docs/html/general_considerations.html index 0240476..e1da999 100644 --- a/docs/html/general_considerations.html +++ b/docs/html/general_considerations.html @@ -75,6 +75,7 @@ Thread safety
  • The library has no global state, so separate D3D12MA::Allocator objects can be used independently. In typical applications there should be no need to create multiple such objects though - one per ID3D12Device is enough.
  • All calls to methods of D3D12MA::Allocator class are safe to be made from multiple threads simultaneously because they are synchronized internally when needed.
  • When the allocator is created with D3D12MA::ALLOCATOR_FLAG_SINGLETHREADED, calls to methods of D3D12MA::Allocator class must be made from a single thread or synchronized by the user. Using this flag may improve performance.
  • +
  • D3D12MA::VirtualBlock is not safe to be used from multiple threads simultaneously.
  • Future plans

    diff --git a/docs/html/hierarchy.html b/docs/html/hierarchy.html index b07721b..be41a96 100644 --- a/docs/html/hierarchy.html +++ b/docs/html/hierarchy.html @@ -69,7 +69,7 @@ $(function() {
    [detail level 12]
    - + @@ -81,7 +81,7 @@ $(function() { - +
     CD3D12MA::ALLOCATION_CALLBACKSCustom callbacks to CPU memory allocation functions
     CD3D12MA::ALLOCATION_DESCParameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource
     CD3D12MA::ALLOCATOR_DESCParameters of created Allocator object. To be used with CreateAllocator()
     CD3D12MA::ALLOCATOR_DESCParameters of created Allocator object. To be used with CreateAllocator()
     CD3D12MA::BudgetStatistics of current memory usage and available budget, in bytes, for GPU or CPU memory
     CIUnknownImpl
     CD3D12MA::AllocationRepresents single memory allocation
     CD3D12MA::StatsGeneral statistics from the current state of the allocator
     CD3D12MA::VIRTUAL_ALLOCATION_DESCParameters of created virtual allocation to be passed to VirtualBlock::Allocate()
     CD3D12MA::VIRTUAL_ALLOCATION_INFOParameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo()
     CD3D12MA::VIRTUAL_BLOCK_DESCParameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock()
     CD3D12MA::VIRTUAL_BLOCK_DESCParameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock()
    diff --git a/docs/html/namespace_d3_d12_m_a.html b/docs/html/namespace_d3_d12_m_a.html index 364c1bb..2621aa3 100644 --- a/docs/html/namespace_d3_d12_m_a.html +++ b/docs/html/namespace_d3_d12_m_a.html @@ -87,7 +87,7 @@ Classes  Represents main object of this library initialized for particular ID3D12Device. More...
      struct  ALLOCATOR_DESC - Parameters of created Allocator object. To be used with CreateAllocator(). More...
    + Parameters of created Allocator object. To be used with CreateAllocator(). More...
      struct  Budget  Statistics of current memory usage and available budget, in bytes, for GPU or CPU memory. More...
    @@ -111,7 +111,7 @@ Classes  Parameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo(). More...
      struct  VIRTUAL_BLOCK_DESC - Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock(). More...
    + Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock(). More...
      class  VirtualBlock  Represents pure allocation algorithm and a data structure with allocations in some memory block, without actually allocating any GPU memory. More...
    @@ -144,12 +144,12 @@ Enumerations - - - - - - + + + + + +

    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...
     
    D3D12MA_API HRESULT CreateAllocator (const ALLOCATOR_DESC *pDesc, Allocator **ppAllocator)
     Creates new main D3D12MA::Allocator object and returns it through ppAllocator. More...
     
    D3D12MA_API HRESULT CreateVirtualBlock (const VIRTUAL_BLOCK_DESC *pDesc, VirtualBlock **ppVirtualBlock)
     Creates new D3D12MA::VirtualBlock object and returns it through ppVirtualBlock. More...
     
    @@ -247,14 +247,14 @@ Variables

    Function Documentation

    - -

    ◆ CreateAllocator()

    + +

    ◆ CreateAllocator()

    Variables

    - + @@ -278,14 +278,14 @@ Variables - -

    ◆ CreateVirtualBlock()

    + +

    ◆ CreateVirtualBlock()

    HRESULT D3D12MA::CreateAllocator D3D12MA_API HRESULT D3D12MA::CreateAllocator ( const ALLOCATOR_DESC pDesc,
    - + diff --git a/docs/html/namespacemembers.html b/docs/html/namespacemembers.html index 72140ae..eab4af3 100644 --- a/docs/html/namespacemembers.html +++ b/docs/html/namespacemembers.html @@ -73,8 +73,8 @@ $(function() {
  • ALLOCATOR_FLAG_NONE : D3D12MA
  • ALLOCATOR_FLAG_SINGLETHREADED : D3D12MA
  • ALLOCATOR_FLAGS : D3D12MA
  • -
  • CreateAllocator() : D3D12MA
  • -
  • CreateVirtualBlock() : D3D12MA
  • +
  • CreateAllocator() : D3D12MA
  • +
  • CreateVirtualBlock() : D3D12MA
  • FREE_FUNC_PTR : D3D12MA
  • HEAP_TYPE_COUNT : D3D12MA
  • diff --git a/docs/html/namespacemembers_func.html b/docs/html/namespacemembers_func.html index 16e7f29..939bbab 100644 --- a/docs/html/namespacemembers_func.html +++ b/docs/html/namespacemembers_func.html @@ -63,8 +63,8 @@ $(function() {
     
    diff --git a/docs/html/namespaces.html b/docs/html/namespaces.html index 501b7ce..084e168 100644 --- a/docs/html/namespaces.html +++ b/docs/html/namespaces.html @@ -72,7 +72,7 @@ $(function() { - + @@ -80,7 +80,7 @@ $(function() { - +
    HRESULT D3D12MA::CreateVirtualBlock D3D12MA_API HRESULT D3D12MA::CreateVirtualBlock ( const VIRTUAL_BLOCK_DESC pDesc,
     CALLOCATION_CALLBACKSCustom callbacks to CPU memory allocation functions
     CALLOCATION_DESCParameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource
     CAllocatorRepresents main object of this library initialized for particular ID3D12Device
     CALLOCATOR_DESCParameters of created Allocator object. To be used with CreateAllocator()
     CALLOCATOR_DESCParameters of created Allocator object. To be used with CreateAllocator()
     CBudgetStatistics of current memory usage and available budget, in bytes, for GPU or CPU memory
     CPoolCustom memory pool
     CPOOL_DESCParameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool
     CStatsGeneral statistics from the current state of the allocator
     CVIRTUAL_ALLOCATION_DESCParameters of created virtual allocation to be passed to VirtualBlock::Allocate()
     CVIRTUAL_ALLOCATION_INFOParameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo()
     CVIRTUAL_BLOCK_DESCParameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock()
     CVIRTUAL_BLOCK_DESCParameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock()
     CVirtualBlockRepresents pure allocation algorithm and a data structure with allocations in some memory block, without actually allocating any GPU memory
    diff --git a/docs/html/quick_start.html b/docs/html/quick_start.html index b12ed1f..ac6d180 100644 --- a/docs/html/quick_start.html +++ b/docs/html/quick_start.html @@ -79,7 +79,7 @@ Project setup and initialization

    (3.) Include library header in each CPP file that needs to use the library.

    #include "D3D12MemAlloc.h"
    -

    (4.) Right after you created ID3D12Device, fill D3D12MA::ALLOCATOR_DESC structure and call function D3D12MA::CreateAllocator to create the main D3D12MA::Allocator object.

    +

    (4.) Right after you created ID3D12Device, fill D3D12MA::ALLOCATOR_DESC structure and call function D3D12MA::CreateAllocator to create the main D3D12MA::Allocator object.

    Please note that all symbols of the library are declared inside D3D12MA namespace.

    IDXGIAdapter* adapter = (...)
    ID3D12Device* device = (...)
    @@ -89,12 +89,12 @@ Project setup and initialization
    allocatorDesc.pAdapter = adapter;
    D3D12MA::Allocator* allocator;
    -
    HRESULT hr = D3D12MA::CreateAllocator(&allocatorDesc, &allocator);
    -
    Represents main object of this library initialized for particular ID3D12Device.
    Definition: D3D12MemAlloc.h:661
    -
    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:542
    -
    IDXGIAdapter * pAdapter
    Definition: D3D12MemAlloc.h:568
    -
    ID3D12Device * pDevice
    Definition: D3D12MemAlloc.h:550
    +
    HRESULT hr = D3D12MA::CreateAllocator(&allocatorDesc, &allocator);
    +
    Represents main object of this library initialized for particular ID3D12Device.
    Definition: D3D12MemAlloc.h:670
    +
    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:551
    +
    IDXGIAdapter * pAdapter
    Definition: D3D12MemAlloc.h:577
    +
    ID3D12Device * pDevice
    Definition: D3D12MemAlloc.h:559

    (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:256
    +
    Represents single memory allocation.
    Definition: D3D12MemAlloc.h:265
    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:207
    -
    D3D12_HEAP_TYPE HeapType
    The type of memory heap where the new allocation should be placed.
    Definition: D3D12MemAlloc.h:216
    +
    Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.
    Definition: D3D12MemAlloc.h:216
    +
    D3D12_HEAP_TYPE HeapType
    The type of memory heap where the new allocation should be placed.
    Definition: D3D12MemAlloc.h:225

    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 b06c606..2270a3c 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:256
    +
    Represents single memory allocation.
    Definition: D3D12MemAlloc.h:265
    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:207
    -
    D3D12_HEAP_FLAGS ExtraHeapFlags
    Additional heap flags to be used when allocating memory.
    Definition: D3D12MemAlloc.h:232
    -
    D3D12_HEAP_TYPE HeapType
    The type of memory heap where the new allocation should be placed.
    Definition: D3D12MemAlloc.h:216
    +
    Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource.
    Definition: D3D12MemAlloc.h:216
    +
    D3D12_HEAP_FLAGS ExtraHeapFlags
    Additional heap flags to be used when allocating memory.
    Definition: D3D12MemAlloc.h:241
    +
    D3D12_HEAP_TYPE HeapType
    The type of memory heap where the new allocation should be placed.
    Definition: D3D12MemAlloc.h:225

    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: