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

> Describes stencil operations that can be performed based on the results of stencil test.

Describes stencil operations that can be performed based on the results of stencil test.

## Syntax

```cpp theme={null}
typedef struct D3D12_DEPTH_STENCILOP_DESC
{
    D3D12_STENCIL_OP StencilFailOp;
    D3D12_STENCIL_OP StencilDepthFailOp;
    D3D12_STENCIL_OP StencilPassOp;
    D3D12_COMPARISON_FUNC StencilFunc;
} D3D12_DEPTH_STENCILOP_DESC
```

### Members

*StencilFailOp*\
Type: D3D12\_STENCIL\_OP

A [D3D12\_STENCIL\_OP](/reference/graphics/d3d12_x/enums/d3d12_stencil_op)-typed value that identifies the stencil operation to perform when stencil testing fails.

*StencilDepthFailOp*\
Type: D3D12\_STENCIL\_OP

A [D3D12\_STENCIL\_OP](/reference/graphics/d3d12_x/enums/d3d12_stencil_op)-typed value that identifies the stencil operation to perform when stencil testing passes and depth testing fails.

*StencilPassOp*\
Type: D3D12\_STENCIL\_OP

A [D3D12\_STENCIL\_OP](/reference/graphics/d3d12_x/enums/d3d12_stencil_op)-typed value that identifies the stencil operation to perform when stencil testing and depth testing both pass.

*StencilFunc*\
Type: D3D12\_COMPARISON\_FUNC

A [D3D12\_COMPARISON\_FUNC](/reference/graphics/d3d12/enums/d3d12_comparison_func_public)-typed value that identifies the function that compares stencil data against existing stencil data.

## Remarks

All stencil operations are specified as a [D3D12\_STENCIL\_OP](/reference/graphics/d3d12_x/enums/d3d12_stencil_op)-typed value. Each stencil operation can be set differently based on the outcome of the stencil test, which is referred to as **StencilFunc**, in the stencil test portion of depth-stencil testing.

Members of [D3D12\_DEPTH\_STENCIL\_DESC](/reference/graphics/d3d12/structs/d3d12_depth_stencil_desc_public) have this structure for their data type.

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

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


## Related topics

- [D3D12_DEPTH_STENCIL_DESC](/reference/graphics/d3d12/structs/d3d12_depth_stencil_desc_public.md)
- [D3D12_DEPTH_STENCIL_DESC1](/reference/graphics/d3d12/structs/d3d12_depth_stencil_desc1_public.md)
- [D3D12_COMPARISON_FUNC](/reference/graphics/d3d12/enums/d3d12_comparison_func_public.md)
- [D3D12_DEPTH_STENCIL_VIEW_DESC](/reference/graphics/d3d12/structs/d3d12_depth_stencil_view_desc_public.md)
- [D3D12_RENDER_PASS_DEPTH_STENCIL_DESC](/reference/graphics/d3d12/structs/d3d12_render_pass_depth_stencil_desc_public.md)
