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

Device context description. More...

#include <DeviceContext.h>

Public Member Functions

constexpr DeviceContextDesc (const Char *_Name, COMMAND_QUEUE_TYPE _QueueType, Bool _IsDeferred, Uint32 _ContextId, Uint32 _QueueId=DeviceContextDesc{}.QueueId) noexcept
 Initializes the structure with user-specified values.
 

Public Attributes

const Char * Name = nullptr
 Device context name.
 
COMMAND_QUEUE_TYPE QueueType = COMMAND_QUEUE_TYPE_UNKNOWN
 Command queue type that this context uses.
 
Bool IsDeferred = False
 Indicates if this is a deferred context.
 
Uint8 ContextId = 0
 
Uint8 QueueId = DEFAULT_QUEUE_ID
 Hardware queue index in GraphicsAdapterInfo::Queues array.
 
Uint32 TextureCopyGranularity [3] = {}
 Required texture granularity for copy operations, for a transfer queue.
 

Detailed Description

Device context description.

Member Data Documentation

◆ ContextId

Uint8 Diligent::DeviceContextDesc::ContextId = 0

Device context ID. This value corresponds to the index of the device context in ppContexts array when the engine was initialized. When starting recording commands with a deferred context, the context id of the immediate context where the command list will be executed should be given to IDeviceContext::Begin() method.

◆ Name

const Char* Diligent::DeviceContextDesc::Name = nullptr

Device context name.

This name is what was specified in ImmediateContextCreateInfo::Name when the engine was initialized.

◆ QueueId

Uint8 Diligent::DeviceContextDesc::QueueId = DEFAULT_QUEUE_ID

Hardware queue index in GraphicsAdapterInfo::Queues array.

This member is only defined for immediate contexts and matches QueueId member of ImmediateContextCreateInfo struct that was used to initialize the context.

  • Vulkan backend: same as queue family index.
  • Direct3D12 backend:
    • 0 - Graphics queue
    • 1 - Compute queue
    • 2 - Transfer queue
  • Metal backend: index of the unique command queue.

◆ QueueType

COMMAND_QUEUE_TYPE Diligent::DeviceContextDesc::QueueType = COMMAND_QUEUE_TYPE_UNKNOWN

Command queue type that this context uses.

For immediate contexts, this type matches GraphicsAdapterInfo::Queues[QueueId].QueueType. For deferred contexts, the type is only defined between IDeviceContext::Begin and IDeviceContext::FinishCommandList calls and matches the type of the immediate context where the command list will be executed.

◆ TextureCopyGranularity

Uint32 Diligent::DeviceContextDesc::TextureCopyGranularity[3] = {}

Required texture granularity for copy operations, for a transfer queue.

For graphics and compute queues, the granularity is always {1,1,1}. For transfer queues, an application must align the texture offsets and sizes by the granularity defined by this member.

For deferred contexts, this member is only defined between IDeviceContext::Begin() and IDeviceContext::FinishCommandList() calls and matches the texture copy granularity of the immediate context where the command list will be executed.