# VkStencilOpState(3) Manual Page

## Name

VkStencilOpState - Structure specifying stencil operation state

Loading… please wait.

## C Specification

The `VkStencilOpState` structure is defined as:

    // Provided by VK_VERSION_1_0
    typedef struct VkStencilOpState {
        VkStencilOp    failOp;
        VkStencilOp    passOp;
        VkStencilOp    depthFailOp;
        VkCompareOp    compareOp;
        uint32_t       compareMask;
        uint32_t       writeMask;
        uint32_t       reference;
    } VkStencilOpState;

## Members

- `failOp` is a VkStencilOp value specifying the action performed on samples that fail the stencil test.

- `passOp` is a VkStencilOp value specifying the action performed on samples that pass both the depth and stencil tests.

- `depthFailOp` is a VkStencilOp value specifying the action performed on samples that pass the stencil test and fail the depth test.

- `compareOp` is a VkCompareOp value specifying the comparison operator used in the stencil test.

- `compareMask` selects the bits of the unsigned integer stencil values participating in the stencil test.

- `writeMask` selects the bits of the unsigned integer stencil values updated by the stencil test in the stencil framebuffer attachment.

- `reference` is an integer stencil reference value that is used in the unsigned stencil comparison.

## Description

Valid Usage (Implicit)

- VUID-VkStencilOpState-failOp-parameter
  `failOp` must be a valid VkStencilOp value

- VUID-VkStencilOpState-passOp-parameter
  `passOp` must be a valid VkStencilOp value

- VUID-VkStencilOpState-depthFailOp-parameter
  `depthFailOp` must be a valid VkStencilOp value

- VUID-VkStencilOpState-compareOp-parameter
  `compareOp` must be a valid VkCompareOp value

## See Also

VK_VERSION_1_0, VkCompareOp, VkPipelineDepthStencilStateCreateInfo, VkStencilOp

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright 2014-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0