> ## 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_STENCIL_OP (XBOX One 系列)

> 識別在深度樣板測試期間可執行的樣板作業。

識別在深度樣板測試期間可執行的樣板作業。

## 語法

```cpp theme={null}
typedef enum D3D12_STENCIL_OP
{  
    D3D12_STENCIL_OP_KEEP = 1,  
    D3D12_STENCIL_OP_ZERO = 2,  
    D3D12_STENCIL_OP_REPLACE = 3,  
    D3D12_STENCIL_OP_INCR_SAT = 4,  
    D3D12_STENCIL_OP_DECR_SAT = 5,  
    D3D12_STENCIL_OP_INVERT = 6,  
    D3D12_STENCIL_OP_INCR = 7,  
    D3D12_STENCIL_OP_DECR = 8,  
    D3D12XBOX_STENCIL_OP_ONE = 9,  
    D3D12XBOX_STENCIL_OP_REPLACE_OP = 10,  
    D3D12XBOX_STENCIL_OP_AND = 11,  
    D3D12XBOX_STENCIL_OP_OR = 12,  
    D3D12XBOX_STENCIL_OP_XOR = 13,  
    D3D12XBOX_STENCIL_OP_NAND = 14,  
    D3D12XBOX_STENCIL_OP_NOR = 15,  
    D3D12XBOX_STENCIL_OP_XNOR = 16,  
} D3D12_STENCIL_OP  
```

## 常數

| 常數 | 描述 |
| - | - |
| D3D12\_STENCIL\_OP\_KEEP | 保留現有的樣板資料。 |
| D3D12\_STENCIL\_OP\_ZERO | 將樣板資料設為 0。 |
| D3D12\_STENCIL\_OP\_REPLACE | 將樣板資料設為呼叫 [OMSetStencilRef](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-omsetstencilref) 所設定的參考值。 |
| D3D12\_STENCIL\_OP\_INCR\_SAT | 將樣板值遞增 1，並限制結果範圍。 |
| D3D12\_STENCIL\_OP\_DECR\_SAT | 將樣板值遞減 1，並限制結果範圍。 |
| D3D12\_STENCIL\_OP\_INVERT | 反轉樣板資料。 |
| D3D12\_STENCIL\_OP\_INCR | 將樣板值遞增 1，並視需要讓結果循環。 |
| D3D12\_STENCIL\_OP\_DECR | 將樣板值遞減 1，並視需要讓結果循環。 |
| D3D12XBOX\_STENCIL\_OP\_ONE | 將樣板資料設為 1。 |
| D3D12XBOX\_STENCIL\_OP\_REPLACE\_OP | 將樣板資料設為呼叫 [OMSetStencilRef](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-omsetstencilref) 所設定的參考值。 |
| D3D12XBOX\_STENCIL\_OP\_AND | 將樣板資料設為初始樣板值與呼叫 [OMSetStencilRef](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-omsetstencilref) 所設定之參考值的邏輯 AND 結果。 |
| D3D12XBOX\_STENCIL\_OP\_OR | 將樣板資料設為初始樣板值與呼叫 [OMSetStencilRef](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-omsetstencilref) 所設定之參考值的邏輯 OR 結果。 |
| D3D12XBOX\_STENCIL\_OP\_XOR | 將樣板資料設為初始樣板值與呼叫 [OMSetStencilRef](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-omsetstencilref) 所設定之參考值的邏輯 XOR 結果。 |
| D3D12XBOX\_STENCIL\_OP\_NAND | 將樣板資料設為初始樣板值與呼叫 [OMSetStencilRef](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-omsetstencilref) 所設定之參考值的邏輯 NAND 結果。 |
| D3D12XBOX\_STENCIL\_OP\_NOR | 將樣板資料設為初始樣板值與呼叫 [OMSetStencilRef](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-omsetstencilref) 所設定之參考值的邏輯 NOR 結果。 |
| D3D12XBOX\_STENCIL\_OP\_XNOR | 將樣板資料設為初始樣板值與呼叫 [OMSetStencilRef](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-omsetstencilref) 所設定之參考值的邏輯 XNOR 結果。 |

## 備註

[D3D12\_DEPTH\_STENCILOP\_DESC](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_depth_stencilop_desc) 結構會使用此列舉。

## 需求

**標頭：** d3d12\_x.h

**支援的平台：** XBOX One 系列

## 另請參閱

[d3d12\_x](/zh-TW/reference/graphics/d3d12_x/d3d12_x_members)


## Related topics

- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [D3D12_DEPTH_STENCILOP_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_depth_stencilop_desc_public.md)
- [D3D12_LOGIC_OP](/zh-TW/reference/graphics/d3d12/enums/d3d12_logic_op_public.md)
- [D3D12_BLEND_OP](/zh-TW/reference/graphics/d3d12/enums/d3d12_blend_op_public.md)
- [D3D12_PREDICATION_OP](/zh-TW/reference/graphics/d3d12/enums/d3d12_predication_op_public.md)
