ID3D12Device::CreateCommandQueue method

Creates a command queue.

Syntax

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

Parameters

pDesc

Type: 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: 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

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

See Also

ID3D12Device