Direct3D 12 Memory Allocator
|
Parameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool. More...
#include <D3D12MemAlloc.h>
Public Attributes | |
POOL_FLAGS | Flags |
Flags. | |
D3D12_HEAP_PROPERTIES | HeapProperties |
The parameters of memory heap where allocations of this pool should be placed. | |
D3D12_HEAP_FLAGS | HeapFlags |
Heap flags to be used when allocating heaps of this pool. | |
UINT64 | BlockSize |
Size of a single heap (memory block) to be allocated as part of this pool, in bytes. Optional. | |
UINT | MinBlockCount |
Minimum number of heaps (memory blocks) to be always allocated in this pool, even if they stay empty. Optional. | |
UINT | MaxBlockCount |
Maximum number of heaps (memory blocks) that can be allocated in this pool. Optional. | |
UINT64 | MinAllocationAlignment |
Additional minimum alignment to be used for all allocations created from this pool. Can be 0. | |
ID3D12ProtectedResourceSession * | pProtectedSession |
Additional parameter allowing pool to create resources with passed protected session. | |
D3D12_RESIDENCY_PRIORITY | ResidencyPriority |
Residency priority to be set for all allocations made in this pool. Optional. | |
Parameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool.
UINT64 D3D12MA::POOL_DESC::BlockSize |
Size of a single heap (memory block) to be allocated as part of this pool, in bytes. Optional.
Specify nonzero to set explicit, constant size of memory blocks used by this pool. Leave 0 to use default and let the library manage block sizes automatically. Then sizes of particular blocks may vary.
POOL_FLAGS D3D12MA::POOL_DESC::Flags |
Flags.
D3D12_HEAP_FLAGS D3D12MA::POOL_DESC::HeapFlags |
Heap flags to be used when allocating heaps of this pool.
It should contain one of these values, depending on type of resources you are going to create in this heap: 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 ResourceHeapTier = 2, then it may be D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES
= 0.
You can specify additional flags if needed.
D3D12_HEAP_PROPERTIES D3D12MA::POOL_DESC::HeapProperties |
The parameters of memory heap where allocations of this pool should be placed.
In the simplest case, just fill it with zeros and set Type
to one of: D3D12_HEAP_TYPE_DEFAULT
, D3D12_HEAP_TYPE_UPLOAD
, D3D12_HEAP_TYPE_READBACK
. Additional parameters can be used e.g. to utilize UMA.
UINT D3D12MA::POOL_DESC::MaxBlockCount |
Maximum number of heaps (memory blocks) that can be allocated in this pool. Optional.
Set to 0 to use default, which is UINT64_MAX
, which means no limit.
Set to same value as D3D12MA::POOL_DESC::MinBlockCount to have fixed amount of memory allocated throughout whole lifetime of this pool.
UINT64 D3D12MA::POOL_DESC::MinAllocationAlignment |
Additional minimum alignment to be used for all allocations created from this pool. Can be 0.
Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two.
UINT D3D12MA::POOL_DESC::MinBlockCount |
Minimum number of heaps (memory blocks) to be always allocated in this pool, even if they stay empty. Optional.
Set to 0 to have no preallocated blocks and allow the pool be completely empty.
ID3D12ProtectedResourceSession* D3D12MA::POOL_DESC::pProtectedSession |
Additional parameter allowing pool to create resources with passed protected session.
If not null then all the heaps and committed resources will be created with this parameter. Valid only if ID3D12Device4 interface is present in current Windows SDK!
D3D12_RESIDENCY_PRIORITY D3D12MA::POOL_DESC::ResidencyPriority |
Residency priority to be set for all allocations made in this pool. Optional.
Set this parameter to one of the possible enum values e.g. D3D12_RESIDENCY_PRIORITY_HIGH
to apply specific residency priority to all allocations made in this pool: ID3D12Heap
memory blocks used to sub-allocate for placed resources, as well as committed resources or heaps created when D3D12MA::ALLOCATION_FLAG_COMMITTED is used. This can increase/decrease chance that the memory will be pushed out from VRAM to system RAM when the system runs out of memory, which is invisible to the developer using D3D12 API while it can degrade performance.
Priority is set using function ID3D12Device1::SetResidencyPriority
. It is performed only when ID3D12Device1
interface is defined and successfully obtained. Otherwise, this parameter is ignored.
This parameter is optional. If you set it to D3D12_RESIDENCY_PRIORITY(0)
, residency priority will not be set for allocations made in this pool.
There is no equivalent parameter for allocations made in default pools. If you want to set residency priority for such allocation, you need to do it manually: allocate with D3D12MA::ALLOCATION_FLAG_COMMITTED and call ID3D12Device1::SetResidencyPriority
, passing allocation->GetResource()
.