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

# OMSetRenderTargets

> レンダー ターゲットと深度ステンシルの CPU 記述子ハンドルを設定します。

レンダー ターゲットと深度ステンシルの CPU 記述子ハンドルを設定します。

## 構文

```cpp theme={null}
void OMSetRenderTargets(
    UINT NumRenderTargetDescriptors,
    const D3D12_CPU_DESCRIPTOR_HANDLE  pRenderTargetDescriptors,
    BOOL RTsSingleHandleToDescriptorRange,
    const D3D12_CPU_DESCRIPTOR_HANDLE  pDepthStencilDescriptor
)
```

### パラメーター

*NumRenderTargetDescriptors \[in]*\
型: UINT

*pRenderTargetDescriptors* 配列内のエントリ数 (0 から **D3D12\_SIMULTANEOUS\_RENDER\_TARGET\_COUNT** の範囲)。このパラメーターがゼロ以外の場合、pRenderTargetDescriptors が指す配列内のエントリ数は、このパラメーターの数と等しくなければなりません。

*pRenderTargetDescriptors \[in, optional]*\
型: const D3D12\_CPU\_DESCRIPTOR\_HANDLE \*

レンダー ターゲット記述子のヒープの先頭を表す CPU 記述子ハンドルを記述する [D3D12\_CPU\_DESCRIPTOR\_HANDLE](https://docs.xbox.com/ja-jp/reference/graphics/d3d12/structs/d3d12_cpu_descriptor_handle_public.md) 構造体の配列を指定します。このパラメーターが NULL で NumRenderTargetDescriptors が 0 の場合、レンダー ターゲットはバインドされません。

*RTsSingleHandleToDescriptorRange \[in]*\
型: BOOL

**True** は、渡されたハンドルが *NumRenderTargetDescriptors* 個の記述子の連続範囲へのポインターであることを意味します。このケースは、バインドする記述子のセットがすでにメモリ上で連続している場合に便利です (最初の 1 つへのハンドルだけで済みます)。たとえば、*NumRenderTargetDescriptors* が 3 の場合、メモリ レイアウトは次のようになります。

![パラメーターが true に設定されている場合のメモリ レイアウト](https://mintcdn.com/microsoft-4404708b/5IpvKlT-jmAaVkeY/images/nda/graphics/oms_true.png?fit=max\&auto=format\&n=5IpvKlT-jmAaVkeY\&q=85\&s=ca9a65f296f515512968ef8e99ddb20e)

このケースでは、ドライバーはハンドルをデリファレンスし、その後、指し示されているメモリをインクリメントします。

**False** は、ハンドルが *NumRenderTargetDescriptors* 個のハンドル配列の最初のものであることを意味します。false の場合、アプリケーションは異なる場所からの記述子のセットを一度にバインドできます。同じく *NumRenderTargetDescriptors* が 3 と仮定すると、メモリ レイアウトは次のようになります。

![パラメーターが false に設定されている場合のメモリ レイアウト](https://mintcdn.com/microsoft-4404708b/5IpvKlT-jmAaVkeY/images/nda/graphics/oms_false.png?fit=max\&auto=format\&n=5IpvKlT-jmAaVkeY\&q=85\&s=c88e0ec402d2cb0c624ed18ccc174c42)

このケースでは、ドライバーはメモリ上で互いに隣接していると想定される 3 つのハンドルをデリファレンスします。

*pDepthStencilDescriptor \[in, optional]*\
型: const D3D12\_CPU\_DESCRIPTOR\_HANDLE \*

深度ステンシル記述子を保持するヒープの先頭を表す CPU 記述子ハンドルを記述する [D3D12\_CPU\_DESCRIPTOR\_HANDLE](https://docs.xbox.com/ja-jp/reference/graphics/d3d12/structs/d3d12_cpu_descriptor_handle_public.md) 構造体へのポインター。このパラメーターが NULL の場合、深度ステンシル記述子はバインドされません。

### 戻り値

型: void

なし。

## 要件

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

## 関連項目

[ID3D12GraphicsCommandList](https://docs.xbox.com/ja-jp/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList/id3d12graphicscommandlist_xs.md)


## Related topics

- [D3D12_CPU_DESCRIPTOR_HANDLE](https://docs.xbox.com/ja-jp/reference/graphics/d3d12/structs/d3d12_cpu_descriptor_handle_public.md)
- [set_audio_render_volume](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_set_audio_render_volume.md)
- [CreateRenderTargetView](https://docs.xbox.com/ja-jp/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createrendertargetview_public.md)
- [D3D12_RENDER_PASS_RENDER_TARGET_DESC](https://docs.xbox.com/ja-jp/reference/graphics/d3d12/structs/d3d12_render_pass_render_target_desc_public.md)
- [PartyLocalChatControl::SetAudioRenderVolume](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_setaudiorendervolume.md)
