> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateCommandSignature

> This method creates a command signature.

This method creates a command signature.

## Syntax

```cpp theme={null}
HRESULT CreateCommandSignature(
    const D3D12_COMMAND_SIGNATURE_DESC  pDesc,
    ID3D12RootSignature  pRootSignature,
    const IID & riid,
    void  ppvCommandSignature
)
```

### Parameters

*pDesc \[in]*\
Type: const D3D12\_COMMAND\_SIGNATURE\_DESC \*

Describes the command signature to be created with the [D3D12\_COMMAND\_SIGNATURE\_DESC](/reference/graphics/d3d12/structs/d3d12_command_signature_desc_public) structure.

*pRootSignature \[in, optional]*\
Type: ID3D12RootSignature \*

Specifies the  [ID3D12RootSignature](/reference/graphics/d3d12/interfaces/id3d12rootsignature/id3d12rootsignature_public) that the command signature applies to.

The root signature is required if any of the commands in the signature will update bindings on the pipeline. If the only command present is a draw or dispatch, the root signature parameter can be set to NULL.

*riid*\
Type: const IID &

The globally unique identifier (**GUID**) for the command signature interface ([ID3D12CommandSignature](/reference/graphics/d3d12/interfaces/id3d12commandsignature/id3d12commandsignature_public)).
The **REFIID**, or **GUID**, of the interface to the command signature can be obtained by using the \_\_uuidof() macro.
For example, \_\_uuidof(**ID3D12CommandSignature**) will get the **GUID** of the interface to a command signature.

*ppvCommandSignature \[out, optional]*\
Type: void \*\*

Specifies a pointer, that on successful completion of the method will point to the created command signature ([ID3D12CommandSignature](/reference/graphics/d3d12/interfaces/id3d12commandsignature/id3d12commandsignature_public)).

### Return value

Type: HRESULT

This method returns one of the [Direct3D 12 Return Codes](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues).

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[ID3D12Device](/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)


## Related topics

- [ID3D12CommandSignature](/reference/graphics/d3d12/interfaces/id3d12commandsignature/id3d12commandsignature_public.md)
- [D3D12_COMMAND_SIGNATURE_DESC](/reference/graphics/d3d12/structs/d3d12_command_signature_desc_public.md)
- [Create Command](/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line-create-command.md)
- [CreateRootSignature](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createrootsignature_public.md)
- [D3D12CreateRootSignatureDeserializer](/reference/graphics/d3d12/functions/d3d12createrootsignaturedeserializer_public.md)
