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

> シェーダー内で 1 つの定数バッファーとして現れる、ルート シグネチャ内のインライン定数を記述します。

シェーダー内で 1 つの定数バッファーとして現れる、ルート シグネチャ内のインライン定数を記述します。

## 構文

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

### メンバー

*ShaderRegister*\
型: UINT

シェーダー レジスター。

*RegisterSpace*\
型: UINT

レジスター空間。

*Num32BitValues*\
型: UINT

単一のシェーダー スロットを占有する定数の数 (これらの定数は単一の定数バッファーのように現れます)。
すべての定数は単一のルート シグネチャ バインド スロットを占有します。

## 解説

シェーダー レジスターと空間の詳細については、[HLSL でのリソース バインディング](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/resource-binding-in-hlsl) を参照してください。

**D3D12\_ROOT\_CONSTANTS** は [D3D12\_ROOT\_PARAMETER](/reference/graphics/d3d12/structs/d3d12_root_parameter_public) の **Constants** メンバーのデータ型です。
**D3D12\_ROOT\_PARAMETER** の **SlotType** フィールドを [D3D12\_ROOT\_PARAMETER\_TYPE](/reference/graphics/d3d12/enums/d3d12_root_parameter_type_public) の D3D12\_ROOT\_PARAMETER\_TYPE\_32BIT\_CONSTANTS メンバーに設定する場合は、**D3D12\_ROOT\_CONSTANTS** を使用します。

## 要件

**ヘッダー:** d3d12\_xs.h または d3d12\_x.h\
**ライブラリ:** d3d12\_xs.lib または d3d12\_x.lib\
**サポートされるプラットフォーム**: XBOX Series 本体および XBOX One ファミリ

## 関連項目

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

[コア構造体](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)

[ルート シグネチャの作成](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/creating-a-root-signature)

[ルート シグネチャで定数を直接使用する](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/using-constants-directly-in-the-root-signature)


## Related topics

- [D3D12_ROOT_PARAMETER](/ja-jp/reference/graphics/d3d12/structs/d3d12_root_parameter_public.md)
- [D3D12_ROOT_PARAMETER1](/ja-jp/reference/graphics/d3d12/structs/d3d12_root_parameter1_public.md)
- [D3D12_ROOT_PARAMETER_TYPE](/ja-jp/reference/graphics/d3d12/enums/d3d12_root_parameter_type_public.md)
- [D3D12_ROOT_DESCRIPTOR](/ja-jp/reference/graphics/d3d12/structs/d3d12_root_descriptor_public.md)
- [D3D12_ROOT_DESCRIPTOR1](/ja-jp/reference/graphics/d3d12/structs/d3d12_root_descriptor1_public.md)
