The depth bounds test compares the depth value za in the depth/stencil attachment at each sample’s framebuffer coordinates (xf ,yf) and sample index i against a set of depth bounds.
The depth bounds are determined by two floating point values defining a minimum (minDepthBounds) and maximum (maxDepthBounds) depth value. These values are either set by the VkPipelineDepthStencilStateCreateInfo structure during pipeline creation, or dynamically by AfxCmdEnableDepthBoundsTest and AfxCmdSetDepthBounds.
A given sample is considered within the depth bounds if za is in the range [minDepthBounds, maxDepthBounds]. Samples with depth attachment values outside of the depth bounds will have their coverage set to 0.
If the depth bounds test is disabled, or if there is no depth attachment, the coverage mask is unmodified by this operation.
To dynamically enable or disable the depth bounds test, call:
void AfxCmdEnableDepthBoundsTest
(
afxDrawScript dscr, /// is the command buffer into which the command will be recorded.
afxBool enabled /// specifies if the depth bounds test is enabled.
);
This command sets the depth bounds enable for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkPipelineDepthStencilStateCreateInfo::depthBoundsTestEnable value used to create the currently active pipeline.
To dynamically set the depth bounds range, call:
void AfxCmdSetDepthBounds
(
afxDrawScript dscr, /// is the command buffer into which the command will be recorded.
afxReal depthBounds[2] /// is the minimum and maximum depth bounds.
);
This command sets the depth bounds range for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_DEPTH_BOUNDS set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkPipelineDepthStencilStateCreateInfo::minDepthBounds and VkPipelineDepthStencilStateCreateInfo::maxDepthBounds values used to create the currently active pipeline.
Responses