vkCmdSetDepthBias
To dynamically set the depth bias parameters, call:
void vkCmdSetDepthBias(
VkCommandBuffer commandBuffer,
float depthBiasConstantFactor,
float depthBiasClamp,
float depthBiasSlopeFactor);
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.
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
thatcommandBuffer
was allocated from must be externally synchronized ::