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

# D3D12_ROOT_CONSTANTS

> Describes constants inline in the root signature that appear in shaders as one constant buffer.

Describes constants inline in the root signature that appear in shaders as one constant buffer.

## Syntax

```cpp theme={null}
typedef struct D3D12_ROOT_CONSTANTS
{
    UINT ShaderRegister;
    UINT RegisterSpace;
    UINT Num32BitValues;
} D3D12_ROOT_CONSTANTS
```

### Members

*ShaderRegister*\
Type: UINT

The shader register.

*RegisterSpace*\
Type: UINT

The register space.

*Num32BitValues*\
Type: UINT

The number of constants that occupy a single shader slot (these constants appear like a single constant buffer).
All constants occupy a single root signature bind slot.

## Remarks

Refer to [Resource Binding in HLSL](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/resource-binding-in-hlsl) for more information on shader registers and spaces.

**D3D12\_ROOT\_CONSTANTS** is the data type of the **Constants** member of [D3D12\_ROOT\_PARAMETER](/reference/graphics/d3d12/structs/d3d12_root_parameter_public).
Use a **D3D12\_ROOT\_CONSTANTS** when you set **D3D12\_ROOT\_PARAMETER**'s **SlotType** field to the D3D12\_ROOT\_PARAMETER\_TYPE\_32BIT\_CONSTANTS member of [D3D12\_ROOT\_PARAMETER\_TYPE](/reference/graphics/d3d12/enums/d3d12_root_parameter_type_public).

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

[CD3DX12\_ROOT\_CONSTANTS](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/cd3dx12-root-constants)

[Core Structures](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)

[Creating a Root Signature](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/creating-a-root-signature)

[Using constants directly in the root signature](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/using-constants-directly-in-the-root-signature)


## Related topics

- [D3D12_ROOT_PARAMETER](/reference/graphics/d3d12/structs/d3d12_root_parameter_public.md)
- [D3D12_ROOT_PARAMETER1](/reference/graphics/d3d12/structs/d3d12_root_parameter1_public.md)
- [D3D12_ROOT_PARAMETER_TYPE](/reference/graphics/d3d12/enums/d3d12_root_parameter_type_public.md)
- [D3D12_ROOT_DESCRIPTOR_FLAGS](/reference/graphics/d3d12/enums/d3d12_root_descriptor_flags_public.md)
- [D3D12_ROOT_SIGNATURE_DESC](/reference/graphics/d3d12/structs/d3d12_root_signature_desc_public.md)
