Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::EngineD3D12CreateInfo Struct Reference

Attributes specific to D3D12 engine. More...

#include <GraphicsTypes.h>

Inheritance diagram for Diligent::EngineD3D12CreateInfo:
Diligent::EngineCreateInfo

Public Member Functions

void SetValidationLevel (VALIDATION_LEVEL Level)
 Sets the validation options corresponding to the specified level, see Diligent::VALIDATION_LEVEL.
 
- Public Member Functions inherited from Diligent::EngineCreateInfo
void SetValidationLevel (VALIDATION_LEVEL Level)
 Sets the validation options corresponding to the specified level, see Diligent::VALIDATION_LEVEL.
 

Public Attributes

const Char * D3D12DllName = "d3d12.dll"
 Name of the D3D12 DLL to load. Ignored on UWP.
 
D3D12_VALIDATION_FLAGS D3D12ValidationFlags = D3D12_VALIDATION_FLAG_BREAK_ON_CORRUPTION
 Direct3D12-specific validation options, see Diligent::D3D12_VALIDATION_FLAGS.
 
Uint32 CPUDescriptorHeapAllocationSize [4]
 Size of the CPU descriptor heap allocations for different heap types.
 
Uint32 GPUDescriptorHeapSize [2]
 
Uint32 GPUDescriptorHeapDynamicSize [2]
 
Uint32 DynamicDescriptorAllocationChunkSize [2]
 
Uint32 DynamicHeapPageSize = 1 << 20
 
Uint32 NumDynamicHeapPagesToReserve = 1
 
Uint32 QueryPoolSizes [QUERY_TYPE_NUM_TYPES]
 Query pool size for each query type.
 
const Char * pDxCompilerPath = nullptr
 Path to DirectX Shader Compiler, which is required to use Shader Model 6.0+ features.
 
- Public Attributes inherited from Diligent::EngineCreateInfo
Int32 EngineAPIVersion = DILIGENT_API_VERSION
 Engine API version number.
 
Uint32 AdapterId = DEFAULT_ADAPTER_ID
 
Version GraphicsAPIVersion = {}
 Minimum required graphics API version (feature level for Direct3D).
 
const ImmediateContextCreateInfopImmediateContextInfo = nullptr
 
Uint32 NumImmediateContexts = 0
 The number of immediate contexts in pImmediateContextInfo array.
 
Uint32 NumDeferredContexts = 0
 The number of deferred contexts to create when initializing the engine.
 
DeviceFeatures Features
 Requested device features.
 
Bool EnableValidation = false
 
VALIDATION_FLAGS ValidationFlags = VALIDATION_FLAG_NONE
 Validation options, see Diligent::VALIDATION_FLAGS.
 
struct IMemoryAllocatorpRawMemAllocator = nullptr
 
IThreadPoolpAsyncShaderCompilationThreadPool = nullptr
 
Uint32 NumAsyncShaderCompilationThreads = 0xFFFFFFFFu
 When AsyncShaderCompilation is enabled, the maximum number of threads that can be used to compile shaders.
 
const OpenXRAttribspXRAttribs = nullptr
 

Detailed Description

Attributes specific to D3D12 engine.

Member Data Documentation

◆ DynamicDescriptorAllocationChunkSize

Uint32 Diligent::EngineD3D12CreateInfo::DynamicDescriptorAllocationChunkSize[2]
Initial value:
{
256,
32
}

The size of the chunk that dynamic descriptor allocations manager requests from the main GPU descriptor heap. The total number of dynamic descriptors available across all frames in flight is defined by GPUDescriptorHeapDynamicSize. Every device context allocates dynamic descriptors in two stages: it first requests a chunk from the global heap, and the performs linear suballocations from this chunk in a lock-free manner. The size of this chunk is defined by DynamicDescriptorAllocationChunkSize, thus there will be total GPUDescriptorHeapDynamicSize/DynamicDescriptorAllocationChunkSize chunks in the heap of each type.

◆ DynamicHeapPageSize

Uint32 Diligent::EngineD3D12CreateInfo::DynamicHeapPageSize = 1 << 20

A device context uses dynamic heap when it needs to allocate temporary CPU-accessible memory to update a resource via IDeviceContext::UpdateBuffer() or IDeviceContext::UpdateTexture(), or to map dynamic resources. Device contexts first request a chunk of memory from global dynamic resource manager and then suballocate from this chunk in a lock-free fashion. DynamicHeapPageSize defines the size of this chunk.

◆ GPUDescriptorHeapDynamicSize

Uint32 Diligent::EngineD3D12CreateInfo::GPUDescriptorHeapDynamicSize[2]
Initial value:
{
8192,
1024
}

The size of the GPU descriptor heap region designated to dynamic shader resource variables. Every Shader Resource Binding object allocates one descriptor per any dynamic shader resource variable (every array element counts) every time the object is committed via IDeviceContext::CommitShaderResources. All used dynamic descriptors are discarded at the end of the frame and recycled when they are no longer used by the GPU. GPUDescriptorHeapDynamicSize defines the total number of descriptors that can be used for dynamic variables across all SRBs and all frames currently in flight. Note that in Direct3D12, the size of sampler descriptor heap is limited by 2048. Since Diligent Engine allocates single heap for all variable types, GPUDescriptorHeapSize[1] + GPUDescriptorHeapDynamicSize[1] must not exceed 2048.

◆ GPUDescriptorHeapSize

Uint32 Diligent::EngineD3D12CreateInfo::GPUDescriptorHeapSize[2]
Initial value:
{
16384,
1024
}

The size of the GPU descriptor heap region designated to static/mutable shader resource variables. Every Shader Resource Binding object allocates one descriptor per any static/mutable shader resource variable (every array element counts) when the object is created. All required descriptors are allocated in one continuous chunk. GPUDescriptorHeapSize defines the total number of all descriptors that can be allocated across all SRB objects. Note that due to heap fragmentation, releasing two chunks of sizes N and M does not necessarily make the chunk of size N+M available.

When the application exits, the engine prints the GPU descriptor heap statistics to the log, for example:

Diligent Engine: Info: D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER     GPU heap max allocated size (static|dynamic): 0/128 (0.00%) | 0/1920 (0.00%).
Diligent Engine: Info: D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV GPU heap max allocated size (static|dynamic): 9/16384 (0.05%) | 128/32768 (0.39%).

An application should monitor the GPU descriptor heap statistics and set GPUDescriptorHeapSize and GPUDescriptorHeapDynamicSize accordingly.

◆ NumDynamicHeapPagesToReserve

Uint32 Diligent::EngineD3D12CreateInfo::NumDynamicHeapPagesToReserve = 1

Number of dynamic heap pages that will be reserved by the global dynamic heap manager to avoid page creation at run time.

◆ pDxCompilerPath

const Char* Diligent::EngineD3D12CreateInfo::pDxCompilerPath = nullptr

Path to DirectX Shader Compiler, which is required to use Shader Model 6.0+ features.

By default, the engine will search for "dxcompiler.dll".

◆ QueryPoolSizes

Uint32 Diligent::EngineD3D12CreateInfo::QueryPoolSizes[QUERY_TYPE_NUM_TYPES]
Initial value:
{
0,
128,
128,
512,
128,
256,
}

Query pool size for each query type.

In Direct3D12, queries are allocated from the pool, and QueryPoolSizes array specifies the number of queries one pool may contain multiple queries of different types. of each type that will be allocated from a single pool. The engine will create as many pools as necessary to satisfy the requested number of queries.