Fragment Operations


void vkCmdSetScissor( VkCommandBuffer uint32_t uint32_t const VkRect2D* commandBuffer, firstScissor, scissorCount, pScissors);

void FVulkanPendingGfxState::InternalUpdateDynamicStates(FVulkanCmdBuffer* Cmd)

This command sets the scissor rectangles for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_SCISSOR set in VkPipelineDynamicStateCreateInfo ::pDynamicStates. Otherwise, this state is specified by the VkPipelineViewportStateCreateInfo ::pScissors values used to create the currently active pipeline.

Sample Mask Test

Fragment Shading

Sample Mask

Depth Replacement

Multisample Coverage

Depth and Stencil Operations

typedef struct VkPipelineDepthStencilStateCreateInfo { Using different algorithms at different framebuffer coordinates may help to avoid artifacts caused by regular coverage sample locations. VkStructureType const void* VkPipelineDepthStencilStateCreateFlags VkBool32 VkBool32 VkCompareOp VkBool32 VkBool32 VkStencilOpState VkStencilOpState float float } VkPipelineDepthStencilStateCreateInfo; sType; pNext; flags; depthTestEnable; depthWriteEnable; depthCompareOp; depthBoundsTestEnable; stencilTestEnable; front; back; minDepthBounds; maxDepthBounds;

void vkCmdSetDepthBoundsTestEnable( VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable);

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.

void vkCmdSetDepthBounds( VkCommandBuffer float float commandBuffer, minDepthBounds, maxDepthBounds);

void FVulkanCommandListContext::RHISetDepthBounds(float MinDepth, float MaxDepth)

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.

void vkCmdSetStencilTestEnable( VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable);

This command sets the stencil test enable for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkPipelineDepthStencilStateCreateInfo::stencilTestEnable value used to create the currently active pipeline.

void vkCmdSetStencilOp( VkCommandBuffer VkStencilFaceFlags VkStencilOp VkStencilOp VkStencilOp VkCompareOp commandBuffer, faceMask, failOp, passOp, depthFailOp, compareOp);

This command sets the stencil operation for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_STENCIL_OP set in VkPipelineDynamicStateCreateInfo ::pDynamicStates. Otherwise, this state is specified by the corresponding VkPipelineDepthStencilStateCreateInfo::failOp, passOp, depthFailOp, and compareOp values used to create the currently active pipeline, for both front and back faces.

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

void vkCmdSetStencilCompareMask( VkCommandBuffer VkStencilFaceFlags uint32_t commandBuffer, faceMask, compareMask);

This command sets the stencil compare mask for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkPipelineDepthStencilStateCreateInfo::compareMask value used to create the currently active pipeline, for both front and back faces.

typedef enum VkStencilFaceFlagBits { VK_STENCIL_FACE_FRONT_BIT = 0x00000001, VK_STENCIL_FACE_BACK_BIT = 0x00000002, VK_STENCIL_FACE_FRONT_AND_BACK = 0x00000003, VK_STENCIL_FRONT_AND_BACK = VK_STENCIL_FACE_FRONT_AND_BACK, } VkStencilFaceFlagBits;

void vkCmdSetStencilWriteMask( VkCommandBuffer VkStencilFaceFlags uint32_t commandBuffer, faceMask, writeMask);

This command sets the stencil write mask for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_STENCIL_WRITE_MASK set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkPipelineDepthStencilStateCreateInfo::writeMask value used to create the currently active pipeline, for both front and back faces.

void vkCmdSetStencilReference( VkCommandBuffer VkStencilFaceFlags uint32_t commandBuffer, faceMask, reference);

void FVulkanPendingGfxState::InternalUpdateDynamicStates(FVulkanCmdBuffer* Cmd)

This command sets the stencil reference value for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_STENCIL_REFERENCE set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkPipelineDepthStencilStateCreateInfo::reference value used to create the currently active pipeline, for both front and back faces.

Depth Test

Depth Clamping and Range Adjustment

Depth Comparison

Depth Attachment Writes

void vkCmdSetDepthTestEnable( VkCommandBuffer VkBool32 commandBuffer, depthTestEnable);

This command sets the depth test enable for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkPipelineDepthStencilStateCreateInfo::depthTestEnable value used to create the currently active pipeline.

void vkCmdSetDepthCompareOp( VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp);

This command sets the depth comparison operator for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_DEPTH_COMPARE_OP set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkPipelineDepthStencilStateCreateInfo::depthCompareOp value used to create the currently active pipeline.

void vkCmdSetDepthWriteEnable( VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable);

This command sets the depth write enable for subsequent drawing commands when the graphics pipeline is created with VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkPipelineDepthStencilStateCreateInfo::depthWriteEnable value used to create the currently active pipeline.

Sample Counting

Coverage Reduction

Pixel Coverage

Color Sample Coverage

本节教程就到此结束,希望大家继续阅读我之后的教程。

谢谢大家,再见!


原创技术文章,撰写不易,转载请注明出处:电子设备中的画家|王烁 于 2021 年 5 月 10 日发表,原文链接(http://geekfaner.com/shineengine/blog20_Vulkanv1.2_6.html)