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

Engine creation information. More...

#include <GraphicsTypes.h>

Inheritance diagram for Diligent::EngineCreateInfo:
Diligent::EngineD3D11CreateInfo Diligent::EngineD3D12CreateInfo Diligent::EngineGLCreateInfo Diligent::EngineMtlCreateInfo Diligent::EngineVkCreateInfo Diligent::EngineWebGPUCreateInfo

Public Member Functions

void SetValidationLevel (VALIDATION_LEVEL Level)
 Sets the validation options corresponding to the specified level, see Diligent::VALIDATION_LEVEL.
 

Public Attributes

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

Engine creation information.

Member Data Documentation

◆ AdapterId

Uint32 Diligent::EngineCreateInfo::AdapterId = DEFAULT_ADAPTER_ID

Id of the hardware adapter the engine should use. Call IEngineFactory::EnumerateAdapters() to get the list of available adapters.

◆ EnableValidation

Bool Diligent::EngineCreateInfo::EnableValidation = false

Enable backend-specific validation (e.g. use Direct3D11 debug device, enable Direct3D12 debug layer, enable Vulkan validation layers, create debug OpenGL context, etc.). The validation is enabled by default in Debug/Development builds and disabled in release builds.

◆ Features

DeviceFeatures Diligent::EngineCreateInfo::Features

Requested device features.

If a feature is requested to be enabled, but is not supported by the device/driver/platform, the engine will fail to initialize.

If a feature is requested to be optional, the engine will attempt to enable the feature. If the feature is not supported by the device/driver/platform, the engine will successfully be initialized, but the feature will be disabled. The actual feature state can be queried from DeviceCaps structure.

Applications can query available device features for each graphics adapter with IEngineFactory::EnumerateAdapters().

◆ NumAsyncShaderCompilationThreads

Uint32 Diligent::EngineCreateInfo::NumAsyncShaderCompilationThreads = 0xFFFFFFFFu

When AsyncShaderCompilation is enabled, the maximum number of threads that can be used to compile shaders.

If AsyncShaderCompilation device feature is enabled and pAsyncShaderCompilationThreadPool is null, this value is used to define the number of threads in the default thread pool. If the value is 0xFFFFFFFF, the number of threads will be determined automatically.

If pAsyncShaderCompilationThreadPool is not null, the value is ignored as the user-provided thread pool is used instead.

In OpenGL backend, the thread pool is not used and the value is passed to glMaxShaderCompilerThreadsKHR() function.

◆ NumDeferredContexts

Uint32 Diligent::EngineCreateInfo::NumDeferredContexts = 0

The number of deferred contexts to create when initializing the engine.

If non-zero number is given, pointers to the contexts are written to ppContexts array by the engine factory functions (IEngineFactoryD3D11::CreateDeviceAndContextsD3D11, IEngineFactoryD3D12::CreateDeviceAndContextsD3D12, and IEngineFactoryVk::CreateDeviceAndContextsVk) starting at position max(1, NumImmediateContexts).

Remarks
Additional deferred contexts may be created later by calling IRenderDevice::CreateDeferredContext().
Warning
An application must manually call IDeviceContext::FinishFrame for deferred contexts to let the engine release stale resources.

◆ NumImmediateContexts

Uint32 Diligent::EngineCreateInfo::NumImmediateContexts = 0

The number of immediate contexts in pImmediateContextInfo array.

Warning
If an application uses more than one immediate context, it must manually call IDeviceContext::FinishFrame for additional contexts to let the engine release stale resources.

◆ pAsyncShaderCompilationThreadPool

IThreadPool* Diligent::EngineCreateInfo::pAsyncShaderCompilationThreadPool = nullptr

An optional thread pool for asynchronous shader and pipeline state compilation.

When AsyncShaderCompilation device feature is enabled, the engine will use the provided thread pool to compile shaders and pipeline states asynchronously. If the thread pool is not provided, the engine will create a default thread pool.

Note
Thread pool is not used in OpenGL backend as asynchronous shader compilation is performed by the driver.

◆ pImmediateContextInfo

const ImmediateContextCreateInfo* Diligent::EngineCreateInfo::pImmediateContextInfo = nullptr

A pointer to the array of NumImmediateContexts structs describing immediate device contexts to create. See Diligent::ImmediateContextCreateInfo. Every immediate device contexts encompasses a command queue of a specific type. It may record commands directly or execute command lists recorded by deferred contexts.

If not specified, single graphics context will be created.

Recommended configuration:

  • Modern discrete GPU: 1 graphics, 1 compute, 1 transfer context.
  • Integrated or mobile GPU: 1..2 graphics contexts.

◆ pRawMemAllocator

struct IMemoryAllocator* Diligent::EngineCreateInfo::pRawMemAllocator = nullptr

Pointer to the raw memory allocator that will be used for all memory allocation/deallocation operations in the engine

◆ pXRAttribs

const OpenXRAttribs* Diligent::EngineCreateInfo::pXRAttribs = nullptr

An optional pointer to the OpenXR attributes, must be set if OpenXR is used. See Diligent::OpenXRAttribs.