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

> 깊이 스텐실 상태를 설명합니다. (D3D12_DEPTH_STENCIL_DESC)

깊이 스텐실 상태를 설명합니다.

## 구문

```cpp theme={null}
typedef struct D3D12_DEPTH_STENCIL_DESC
{
    BOOL DepthEnable;
    D3D12_DEPTH_WRITE_MASK DepthWriteMask;
    D3D12_COMPARISON_FUNC DepthFunc;
    BOOL StencilEnable;
    UINT8 StencilReadMask;
    UINT8 StencilWriteMask;
    D3D12_DEPTH_STENCILOP_DESC FrontFace;
    D3D12_DEPTH_STENCILOP_DESC BackFace;
} D3D12_DEPTH_STENCIL_DESC
```

### 멤버

*DepthEnable*\
형식: BOOL

깊이 테스트를 사용할지 여부를 지정합니다. 깊이 테스트를 사용하려면 이 멤버를 **TRUE**로 설정합니다.

*DepthWriteMask*\
형식: D3D12\_DEPTH\_WRITE\_MASK

깊이 데이터에 의해 수정될 수 있는 깊이 스텐실 버퍼의 일부를 식별하는 [D3D12\_DEPTH\_WRITE\_MASK](/reference/graphics/d3d12/enums/d3d12_depth_write_mask_public) 형식의 값입니다.

*DepthFunc*\
형식: D3D12\_COMPARISON\_FUNC

깊이 데이터를 기존 깊이 데이터와 비교하는 함수를 식별하는 [D3D12\_COMPARISON\_FUNC](/reference/graphics/d3d12/enums/d3d12_comparison_func_public) 형식의 값입니다.

*StencilEnable*\
형식: BOOL

스텐실 테스트를 사용할지 여부를 지정합니다. 스텐실 테스트를 사용하려면 이 멤버를 **TRUE**로 설정합니다.

*StencilReadMask*\
형식: UINT8

스텐실 데이터 읽기용 깊이 스텐실 버퍼의 일부를 식별합니다.

*StencilWriteMask*\
형식: UINT8

스텐실 데이터 쓰기용 깊이 스텐실 버퍼의 일부를 식별합니다.

*FrontFace*\
형식: D3D12\_DEPTH\_STENCILOP\_DESC

표면 법선이 카메라를 향하는 픽셀에 대해 깊이 테스트와 스텐실 테스트의 결과를 사용하는 방법을 설명하는 [D3D12\_DEPTH\_STENCILOP\_DESC](/reference/graphics/d3d12/structs/d3d12_depth_stencilop_desc_public) 구조체입니다.

*BackFace*\
형식: D3D12\_DEPTH\_STENCILOP\_DESC

표면 법선이 카메라 반대쪽을 향하는 픽셀에 대해 깊이 테스트와 스텐실 테스트의 결과를 사용하는 방법을 설명하는 [D3D12\_DEPTH\_STENCILOP\_DESC](/reference/graphics/d3d12/structs/d3d12_depth_stencilop_desc_public) 구조체입니다.

## 설명

[D3D12\_GRAPHICS\_PIPELINE\_STATE\_DESC](/reference/graphics/d3d12_x/structs/d3d12_graphics_pipeline_state_desc) 개체는 출력 병합기(output-merger) 단계에서 깊이 스텐실 테스트가 수행되는 방식을 제어하는 깊이 스텐실 상태 구조체를 포함합니다.

이 표는 깊이 스텐실 상태의 기본값을 보여 줍니다.

<table>
  <tr>
    <th>상태</th>
    <th>기본값</th>
  </tr>

  <tr>
    <td>DepthEnable</td>
    <td>TRUE</td>
  </tr>

  <tr>
    <td>DepthWriteMask</td>
    <td>D3D12\_DEPTH\_WRITE\_MASK\_ALL</td>
  </tr>

  <tr>
    <td>DepthFunc</td>
    <td>D3D12\_COMPARISON\_FUNC\_LESS</td>
  </tr>

  <tr>
    <td>StencilEnable</td>
    <td>FALSE</td>
  </tr>

  <tr>
    <td>StencilReadMask</td>
    <td>D3D12\_DEFAULT\_STENCIL\_READ\_MASK</td>
  </tr>

  <tr>
    <td>StencilWriteMask</td>
    <td>D3D12\_DEFAULT\_STENCIL\_WRITE\_MASK</td>
  </tr>

  <tr>
    <td>
      FrontFace.StencilFailOp

      및

      BackFace.StencilFailOp
    </td>

    <td>D3D12\_STENCIL\_OP\_KEEP</td>
  </tr>

  <tr>
    <td>
      FrontFace.StencilDepthFailOp

      및

      BackFace.StencilDepthFailOp
    </td>

    <td>D3D12\_STENCIL\_OP\_KEEP</td>
  </tr>

  <tr>
    <td>
      FrontFace.StencilPassOp

      및

      BackFace.StencilPassOp
    </td>

    <td>D3D12\_STENCIL\_OP\_KEEP</td>
  </tr>

  <tr>
    <td>
      FrontFace.StencilFunc

      및

      BackFace.StencilFunc
    </td>

    <td>D3D12\_COMPARISON\_FUNC\_ALWAYS</td>
  </tr>
</table>

스텐실링을 지원하는 형식은 DXGI\_FORMAT\_D24\_UNORM\_S8\_UINT 및 DXGI\_FORMAT\_D32\_FLOAT\_S8X24\_UINT입니다.

## 요구 사항

**헤더:** d3d12\_xs.h 또는 d3d12\_x.h\
**라이브러리:** d3d12\_xs.lib 또는 d3d12\_x.lib\
**지원 플랫폼:** XBOX Series 콘솔 및 XBOX One 제품군

## 관련 항목

[CD3DX12\_DEPTH\_STENCIL\_DESC](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/cd3dx12-depth-stencil-desc)

[핵심 구조체](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [D3D12_DEPTH_STENCILOP_DESC](/ko/reference/graphics/d3d12/structs/d3d12_depth_stencilop_desc_public.md)
- [D3D12_DEPTH_WRITE_MASK](/ko/reference/graphics/d3d12/enums/d3d12_depth_write_mask_public.md)
- [D3D12_PIPELINE_STATE_STREAM_DESC](/ko/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public.md)
- [D3D12_COMPARISON_FUNC](/ko/reference/graphics/d3d12/enums/d3d12_comparison_func_public.md)
- [D3D12_DEPTH_STENCIL_DESC1](/ko/reference/graphics/d3d12/structs/d3d12_depth_stencil_desc1_public.md)
