vkCmdSetDepthBias(3)

# vkCmdSetDepthBias(3) Manual Page

## Name

vkCmdSetDepthBias - Set depth bias factors and clamp dynamically for a command buffer

Loading… please wait.

## C Specification

To dynamically set the depth bias parameters, call:

    // Provided by VK_VERSION_1_0
    void vkCmdSetDepthBias(
        VkCommandBuffer                             commandBuffer,
        float                                       depthBiasConstantFactor,
        float                                       depthBiasClamp,
        float                                       depthBiasSlopeFactor);

## Parameters

- `commandBuffer` is the command buffer into which the command will be recorded.

- `depthBiasConstantFactor` is a scalar factor controlling the constant depth value added to each fragment.

- `depthBiasClamp` is the maximum (or minimum) depth bias of a fragment.

- `depthBiasSlopeFactor` is a scalar factor applied to a fragment’s slope in depth bias calculations.

## Description

This command sets the depth bias parameters for subsequent drawing commands when drawing using shader objects, or when the graphics pipeline is created with `VK_DYNAMIC_STATE_DEPTH_BIAS` set in VkPipelineDynamicStateCreateInfo::`pDynamicStates`. Otherwise, this state is specified by the corresponding VkPipelineRasterizationStateCreateInfo::`depthBiasConstantFactor`, `depthBiasClamp`, and `depthBiasSlopeFactor` values used to create the currently active pipeline.

Calling this function is equivalent to calling `vkCmdSetDepthBias2EXT` without a `VkDepthBiasRepresentationInfoEXT` in the pNext chain of `VkDepthBiasInfoEXT`.

Valid Usage

- VUID-vkCmdSetDepthBias-depthBiasClamp-00790
  If the `depthBiasClamp` feature is not enabled, `depthBiasClamp` must be `0.0`

Valid Usage (Implicit)

- VUID-vkCmdSetDepthBias-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdSetDepthBias-commandBuffer-recording
  `commandBuffer` must be in the recording state

- VUID-vkCmdSetDepthBias-commandBuffer-cmdpool
  The `VkCommandPool` that `commandBuffer` was allocated from must support graphics operations

- VUID-vkCmdSetDepthBias-videocoding
  This command must only be called outside of a video coding scope

Host Synchronization

- Host access to `commandBuffer` must be externally synchronized

- Host access to the `VkCommandPool` that `commandBuffer` was allocated from must be externally synchronized

Command Properties

Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type
--- | --- | --- | --- | ---
Primary Secondary | Both | Outside | Graphics | State

## See Also

VK_VERSION_1_0, VkCommandBuffer

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

SPDX-License-Identifier: CC-BY-4.0