# VkPipelineDepthStencilStateCreateInfo(3) Manual Page

## Name

VkPipelineDepthStencilStateCreateInfo - Structure specifying parameters of a newly created pipeline depth stencil state

Loading… please wait.

## C Specification

The `VkPipelineDepthStencilStateCreateInfo` structure is defined as:

    // Provided by VK_VERSION_1_0
    typedef struct VkPipelineDepthStencilStateCreateInfo {
        VkStructureType                           sType;
        const void*                               pNext;
        VkPipelineDepthStencilStateCreateFlags    flags;
        VkBool32                                  depthTestEnable;
        VkBool32                                  depthWriteEnable;
        VkCompareOp                               depthCompareOp;
        VkBool32                                  depthBoundsTestEnable;
        VkBool32                                  stencilTestEnable;
        VkStencilOpState                          front;
        VkStencilOpState                          back;
        float                                     minDepthBounds;
        float                                     maxDepthBounds;
    } VkPipelineDepthStencilStateCreateInfo;

## Members

- `sType` is a VkStructureType value identifying this structure.

- `pNext` is `NULL` or a pointer to a structure extending this structure.

- `flags` is a bitmask of VkPipelineDepthStencilStateCreateFlagBits specifying additional depth/stencil state information.

- `depthTestEnable` controls whether depth testing is enabled.

- `depthWriteEnable` controls whether depth writes are enabled when `depthTestEnable` is `VK_TRUE`. Depth writes are always disabled when `depthTestEnable` is `VK_FALSE`.

- `depthCompareOp` is a VkCompareOp value specifying the comparison operator to use in the Depth Comparison step of the depth test.

- `depthBoundsTestEnable` controls whether depth bounds testing is enabled.

- `stencilTestEnable` controls whether stencil testing is enabled.

- `front` and `back` are VkStencilOpState values controlling the corresponding parameters of the stencil test.

- `minDepthBounds` is the minimum depth bound used in the depth bounds test.

- `maxDepthBounds` is the maximum depth bound used in the depth bounds test.

## Description

Valid Usage

- VUID-VkPipelineDepthStencilStateCreateInfo-depthBoundsTestEnable-00598
  If the `depthBounds` feature is not enabled, `depthBoundsTestEnable` must be `VK_FALSE`

- VUID-VkPipelineDepthStencilStateCreateInfo-separateStencilMaskRef-04453
  If the `VK_KHR_portability_subset` extension is enabled, and VkPhysicalDevicePortabilitySubsetFeaturesKHR::`separateStencilMaskRef` is `VK_FALSE`, and the value of VkPipelineDepthStencilStateCreateInfo::`stencilTestEnable` is `VK_TRUE`, and the value of VkPipelineRasterizationStateCreateInfo::`cullMode` is `VK_CULL_MODE_NONE`, the value of `reference` in each of the VkStencilOpState structs in `front` and `back` must be the same

- VUID-VkPipelineDepthStencilStateCreateInfo-rasterizationOrderDepthAttachmentAccess-06463
  If the `rasterizationOrderDepthAttachmentAccess` feature is not enabled, `flags` must not include `VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT`

- VUID-VkPipelineDepthStencilStateCreateInfo-rasterizationOrderStencilAttachmentAccess-06464
  If the `rasterizationOrderStencilAttachmentAccess` feature is not enabled, `flags` must not include `VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT`

Valid Usage (Implicit)

- VUID-VkPipelineDepthStencilStateCreateInfo-sType-sType
  `sType` must be `VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO`

- VUID-VkPipelineDepthStencilStateCreateInfo-pNext-pNext
  `pNext` must be `NULL`

- VUID-VkPipelineDepthStencilStateCreateInfo-flags-parameter
  `flags` must be a valid combination of VkPipelineDepthStencilStateCreateFlagBits values

- VUID-VkPipelineDepthStencilStateCreateInfo-depthCompareOp-parameter
  `depthCompareOp` must be a valid VkCompareOp value

- VUID-VkPipelineDepthStencilStateCreateInfo-front-parameter
  `front` must be a valid VkStencilOpState structure

- VUID-VkPipelineDepthStencilStateCreateInfo-back-parameter
  `back` must be a valid VkStencilOpState structure

## See Also

VK_VERSION_1_0, VkBool32, VkCompareOp, VkGraphicsPipelineCreateInfo, VkPipelineDepthStencilStateCreateFlags, VkStencilOpState, VkStructureType

## 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-2024 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0