Direct3D 12 Memory Allocator
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
D3D12MemAlloc.h File Reference
#include <d3d12.h>
#include <dxgi1_4.h>

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...
 
struct  D3D12MA::Statistics
 Calculated statistics of memory usage e.g. in a specific memory heap type, memory segment group, custom pool, or total. More...
 
struct  D3D12MA::DetailedStatistics
 More detailed statistics than D3D12MA::Statistics. More...
 
struct  D3D12MA::TotalStatistics
 General statistics from current state of the allocator - total memory usage across all memory heaps and segments. More...
 
struct  D3D12MA::Budget
 Statistics of current memory usage and available budget for a specific memory segment group. More...
 
struct  D3D12MA::VirtualAllocation
 Represents single memory allocation done inside VirtualBlock. More...
 
class  D3D12MA::Allocation
 Represents single memory allocation. More...
 
struct  D3D12MA::DEFRAGMENTATION_DESC
 Parameters for defragmentation. More...
 
struct  D3D12MA::DEFRAGMENTATION_MOVE
 Single move of an allocation to be done for defragmentation. More...
 
struct  D3D12MA::DEFRAGMENTATION_PASS_MOVE_INFO
 Parameters for incremental defragmentation steps. More...
 
struct  D3D12MA::DEFRAGMENTATION_STATS
 Statistics returned for defragmentation process by function DefragmentationContext::GetStats(). More...
 
class  D3D12MA::DefragmentationContext
 Represents defragmentation process in progress. 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...
 
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

namespace  D3D12MA
 

Macros

#define D3D12MA_DXGI_1_4   0
 
#define D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT   1
 

Typedefs

typedef UINT64 D3D12MA::AllocHandle
 Unique identifier of single allocation done inside the memory heap. More...
 
using D3D12MA::ALLOCATE_FUNC_PTR = void *(*)(size_t Size, size_t Alignment, void *pPrivateData)
 Pointer to custom callback function that allocates CPU memory. More...
 
using D3D12MA::FREE_FUNC_PTR = void(*)(void *pMemory, void *pPrivateData)
 Pointer to custom callback function that deallocates CPU memory. 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 ,
  D3D12MA::ALLOCATION_FLAG_UPPER_ADDRESS = 0x8 , D3D12MA::ALLOCATION_FLAG_CAN_ALIAS = 0x10 , D3D12MA::ALLOCATION_FLAG_STRATEGY_MIN_MEMORY = 0x00010000 , D3D12MA::ALLOCATION_FLAG_STRATEGY_MIN_TIME = 0x00020000 ,
  D3D12MA::ALLOCATION_FLAG_STRATEGY_MIN_OFFSET = 0x0004000 , D3D12MA::ALLOCATION_FLAG_STRATEGY_BEST_FIT = ALLOCATION_FLAG_STRATEGY_MIN_MEMORY , D3D12MA::ALLOCATION_FLAG_STRATEGY_FIRST_FIT = ALLOCATION_FLAG_STRATEGY_MIN_TIME , D3D12MA::ALLOCATION_FLAG_STRATEGY_MASK
}
 Bit flags to be used with ALLOCATION_DESC::Flags. More...
 
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 , 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 , D3D12MA::POOL_FLAG_ALGORITHM_LINEAR = 0x1 , D3D12MA::POOL_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED = 0x2 , D3D12MA::POOL_FLAG_ALGORITHM_MASK = POOL_FLAG_ALGORITHM_LINEAR }
 Bit flags to be used with POOL_DESC::Flags. More...
 
enum  D3D12MA::ALLOCATOR_FLAGS {
  D3D12MA::ALLOCATOR_FLAG_NONE = 0 , D3D12MA::ALLOCATOR_FLAG_SINGLETHREADED = 0x1 , D3D12MA::ALLOCATOR_FLAG_ALWAYS_COMMITTED = 0x2 , D3D12MA::ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED = 0x4 ,
  D3D12MA::ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED = 0x8
}
 Bit flags to be used with ALLOCATOR_DESC::Flags. More...
 
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 {
  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 , D3D12MA::VIRTUAL_ALLOCATION_FLAG_STRATEGY_MIN_TIME = ALLOCATION_FLAG_STRATEGY_MIN_TIME ,
  D3D12MA::VIRTUAL_ALLOCATION_FLAG_STRATEGY_MIN_OFFSET = ALLOCATION_FLAG_STRATEGY_MIN_OFFSET , D3D12MA::VIRTUAL_ALLOCATION_FLAG_STRATEGY_MASK = ALLOCATION_FLAG_STRATEGY_MASK
}
 Bit flags to be used with VIRTUAL_ALLOCATION_DESC::Flags. More...
 

Functions

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...
 

Macro Definition Documentation

◆ D3D12MA_DXGI_1_4

#define D3D12MA_DXGI_1_4   0

◆ D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT

#define D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT   1