ID3D12Device::CreateCommandQueue method (d3d12.h)

Creates a command queue.

Also see ID3D12Device9::CreateCommandQueue1.

Syntax

HRESULT CreateCommandQueue(
  const D3D12_COMMAND_QUEUE_DESC *pDesc,
  REFIID                         riid,
  void                           **ppCommandQueue
);

Parameters

pDesc

Type: [in] const D3D12_COMMAND_QUEUE_DESC*

Specifies a D3D12_COMMAND_QUEUE_DESC that describes the command queue.

riid

Type: REFIID

The globally unique identifier (GUID) for the command queue interface. See Remarks. An input parameter.

ppCommandQueue

Type: [out] void**

A pointer to a memory block that receives a pointer to the ID3D12CommandQueue interface for the command queue.

Return value

Type: HRESULT

This method returns E_OUTOFMEMORY if there is insufficient memory to create the command queue. See Direct3D 12 return codes for other possible return values.

Remarks

The REFIID, or GUID, of the interface to the command queue can be obtained by using the __uuidof() macro. For example, __uuidof(ID3D12CommandQueue) will get the GUID of the interface to a command queue.

Examples

The D3D12HelloTriangle sample uses ID3D12Device::CreateCommandQueue as follows:

D3D12_COMMAND_QUEUE_DESC queueDesc{};
queueDesc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE;
queueDesc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;

ThrowIfFailed(m_device->CreateCommandQueue(&queueDesc, IID_PPV_ARGS(&m_commandQueue)));

Refer to the Example code in the D3D12 reference.

Requirements

Requirement Value
Target Platform Windows
Header d3d12.h
Library D3D12.lib
DLL D3D12.dll

See also