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

Attributes specific to Vulkan engine. More...

#include <GraphicsTypes.h>

Inheritance diagram for Diligent::EngineVkCreateInfo:
Diligent::EngineCreateInfo

Public Attributes

DeviceFeaturesVk FeaturesVk
 Vulkan-specific device features, see Diligent::DeviceFeaturesVk.
 
Uint32 InstanceLayerCount = 0
 The number of Vulkan instance layers in ppInstanceLayerNames array.
 
const Char *const * ppInstanceLayerNames = nullptr
 A list of additional Vulkan instance layers to enable.
 
Uint32 InstanceExtensionCount = 0
 The number of Vulkan instance extensions in ppInstanceExtensionNames array.
 
const Char *const * ppInstanceExtensionNames = nullptr
 A list of additional Vulkan instance extensions to enable.
 
Uint32 DeviceExtensionCount = 0
 Number of Vulkan device extensions in ppDeviceExtensionNames array.
 
const Char *const * ppDeviceExtensionNames = nullptr
 A list of additional Vulkan device extensions to enable.
 
void * pDeviceExtensionFeatures = nullptr
 Pointer to Vulkan device extension features.
 
void * pVkAllocator = nullptr
 Allocator used as pAllocator parameter in calls to Vulkan Create* functions.
 
Uint32 IgnoreDebugMessageCount = 0
 The number of Vulkan validation messages to ignore in ppIgnoreMessageNames array.
 
const Char *const * ppIgnoreDebugMessageNames = nullptr
 An optional list of IgnoreDebugMessageCount Vulkan validation message names to ignore.
 
VulkanDescriptorPoolSize MainDescriptorPoolSize {8192, 1024, 8192, 8192, 1024, 4096, 4096, 1024, 1024, 256, 256}
 
VulkanDescriptorPoolSize DynamicDescriptorPoolSize {2048, 256, 2048, 2048, 256, 1024, 1024, 256, 256, 64, 64}
 
Uint32 DeviceLocalMemoryPageSize = 16 << 20
 Allocation granularity for device-local memory.
 
Uint32 HostVisibleMemoryPageSize = 16 << 20
 Allocation granularity for host-visible memory.
 
Uint32 DeviceLocalMemoryReserveSize = 256 << 20
 Amount of device-local memory reserved by the engine.
 
Uint32 HostVisibleMemoryReserveSize = 256 << 20
 Amount of host-visible memory reserved by the engine.
 
Uint32 UploadHeapPageSize = 1 << 20
 
Uint32 DynamicHeapSize = 8 << 20
 
Uint32 DynamicHeapPageSize = 256 << 10
 
Uint32 QueryPoolSizes [QUERY_TYPE_NUM_TYPES]
 
const Char * pDxCompilerPath = nullptr
 
- 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
 

Additional Inherited Members

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

Detailed Description

Attributes specific to Vulkan engine.

Member Data Documentation

◆ DeviceLocalMemoryPageSize

Uint32 Diligent::EngineVkCreateInfo::DeviceLocalMemoryPageSize = 16 << 20

Allocation granularity for device-local memory.

Device-local memory is used for USAGE_DEFAULT and USAGE_IMMUTABLE GPU resources, such as buffers and textures.

If there is no available GPU memory, the resource will fail to be created.

◆ DeviceLocalMemoryReserveSize

Uint32 Diligent::EngineVkCreateInfo::DeviceLocalMemoryReserveSize = 256 << 20

Amount of device-local memory reserved by the engine.

The engine does not pre-allocate the memory, but rather keeps free pages when resources are released.

◆ DynamicDescriptorPoolSize

VulkanDescriptorPoolSize Diligent::EngineVkCreateInfo::DynamicDescriptorPoolSize {2048, 256, 2048, 2048, 256, 1024, 1024, 256, 256, 64, 64}

Size of the dynamic descriptor pool that is used to allocate descriptor sets for dynamic variables. Every device context has its own dynamic descriptor set allocator. The allocator requests pools from global dynamic descriptor pool manager, and then performs lock-free suballocations from the pool.

◆ DynamicHeapPageSize

Uint32 Diligent::EngineVkCreateInfo::DynamicHeapPageSize = 256 << 10

Size of the memory chunk suballocated by immediate/deferred context from the global dynamic heap to perform lock-free dynamic suballocations.

Dynamic memory is not allocated directly from the dynamic heap. Instead, when a context needs to allocate memory for a dynamic resource, it allocates a chunk of memory from the global dynamic heap (which requires synchronization with other contexts), and then performs lock-free suballocations from the chunk. The size of this chunk is set by DynamicHeapPageSize variable.

When the application exits, the engine prints dynamic heap statistics for each context to the log, for example:

Diligent Engine: Info: Dynamic heap of immediate context usage stats:
                       Peak used/aligned/allocated size: 94.14 KB / 94.56 KB / 256.00 KB (1 page). Peak efficiency (used/aligned): 99.6%. Peak utilization (used/allocated): 36.8%
  • Peak used size is the total amount of memory required for dynamic resources allocated by the context during the frame.
  • Peak aligned size is the total amount of memory required for dynamic resources allocated by the context during the frame, accounting for necessary alignment. This value is always greater than or equal to the peak used size.
  • Peak allocated size is the total amount of memory allocated from the dynamic heap by the context during the frame. This value is always a multiple of DynamicHeapPageSize.

◆ DynamicHeapSize

Uint32 Diligent::EngineVkCreateInfo::DynamicHeapSize = 8 << 20

Size of the dynamic heap (the buffer that is used to suballocate memory for dynamic resources) shared by all contexts. The dynamic heap is used to allocate memory for dynamic resources. Each time a dynamic buffer or dynamic texture is mapped, the engine allocates a new chunk of memory from the dynamic heap. At the end of the frame, all dynamic memory allocated for the frame is recycled. However, it may not became available again until all command buffers that reference the memory are executed by the GPU (which typically happens 1-2 frames later). If space in the dynamic heap is exhausted, the engine will wait for up to 60 ms for the space released from previous frames to become available. If the space is still not available, the engine will fail to map the resource and return null pointer. The dynamic heap is shared by all contexts and cannot be resized on the fly. The application should track the amount of dynamic memory it needs and set this variable accordingly. When the application exits, the engine prints dynamic heap statistics to the log, for example:

Diligent Engine: Info: Dynamic memory manager usage stats:
Total size: 8.00 MB. Peak allocated size: 0.50 MB. Peak utilization: 6.2%

The peak allocated size (0.50 MB in the example above) is the value that should be used to guide setting this variable. An application should always allow some extra space in the dynamic heap to avoid running out of dynamic memory.

◆ HostVisibleMemoryPageSize

Uint32 Diligent::EngineVkCreateInfo::HostVisibleMemoryPageSize = 16 << 20

Allocation granularity for host-visible memory.

Host-visible memory is primarily used to upload data to GPU resources.

◆ HostVisibleMemoryReserveSize

Uint32 Diligent::EngineVkCreateInfo::HostVisibleMemoryReserveSize = 256 << 20

Amount of host-visible memory reserved by the engine.

The engine does not pre-allocate the memory, but rather keeps free pages when resources are released.

◆ MainDescriptorPoolSize

VulkanDescriptorPoolSize Diligent::EngineVkCreateInfo::MainDescriptorPoolSize {8192, 1024, 8192, 8192, 1024, 4096, 4096, 1024, 1024, 256, 256}

Size of the main descriptor pool that is used to allocate descriptor sets for static and mutable variables. If allocation from the current pool fails, the engine creates another one.

◆ pDeviceExtensionFeatures

void* Diligent::EngineVkCreateInfo::pDeviceExtensionFeatures = nullptr

Pointer to Vulkan device extension features.

Will be added to VkDeviceCreateInfo::pNext.

◆ pDxCompilerPath

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

Path to DirectX Shader Compiler, which is required to use Shader Model 6.0+ features when compiling shaders from HLSL.

◆ QueryPoolSizes

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

Query pool size for each query type.

In Vulkan, queries are allocated from the pool, and one pool may contain multiple queries of different types. QueryPoolSizes array specifies the number of queries 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.

◆ UploadHeapPageSize

Uint32 Diligent::EngineVkCreateInfo::UploadHeapPageSize = 1 << 20

Page size of the upload heap that is allocated by immediate/deferred contexts from the global memory manager to perform lock-free dynamic suballocations. Upload heap is used to update resources with IDeviceContext::UpdateBuffer() and IDeviceContext::UpdateTexture().

Upload pages are allocated in host-visible memory. When a page becomes available, the engiene will keep it alive if the total size of the host-visible memory is less than HostVisibleMemoryReserveSize. Otherwise, the page will be released.

On exit, the engine prints the number of pages that were allocated by each context to the log, for example:

Diligent Engine: Info: Upload heap of immediate context peak used/allocated frame size: 80.00 MB / 80.00 MB (80 pages)