Fix stencil op in depth bounds tests
authorziga-lunarg <ziga@lunarg.com>
Mon, 5 Dec 2022 14:12:06 +0000 (15:12 +0100)
committerPiotr Byszewski <piotr.byszewski@mobica.com>
Fri, 16 Dec 2022 15:22:23 +0000 (15:22 +0000)
If stencil attachment is in a read only layout and stencil test is
enabled, the stencil ops in VkPipelineDepthStencilStateCreateInfo must
be VK_STENCIL_OP_KEEP

Components: Vulkan

VK-GL-CTS issue: 4155

Affected tests:
dEQP-VK.dynamic_state.*.ds_state.depth_bounds_2*

Change-Id: Ifeb2ddca71e5cbd60afebd8d8b6dd77b5e7f2e9b

external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateDSTests.cpp

index d430b63..a2ea407 100644 (file)
@@ -626,11 +626,12 @@ void DepthBoundsTestInstance::initPipeline (const vk::VkDevice device)
        std::vector<vk::VkViewport>                             viewports       { { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f } };
        std::vector<vk::VkRect2D>                               scissors        { { { 0u, 0u }, { 0u, 0u } } };
 
-       const PipelineCreateInfo::ColorBlendState::Attachment   attachmentState;
-       const PipelineCreateInfo::ColorBlendState                               colorBlendState(1u, static_cast<const vk::VkPipelineColorBlendAttachmentState*>(&attachmentState));
-       const PipelineCreateInfo::RasterizerState                               rasterizerState;
-       const PipelineCreateInfo::DepthStencilState                             depthStencilState(false, false, vk::VK_COMPARE_OP_NEVER, true);
-       const PipelineCreateInfo::DynamicState                                  dynamicState;
+       const PipelineCreateInfo::ColorBlendState::Attachment           attachmentState;
+       const PipelineCreateInfo::ColorBlendState                                       colorBlendState(1u, static_cast<const vk::VkPipelineColorBlendAttachmentState*>(&attachmentState));
+       const PipelineCreateInfo::RasterizerState                                       rasterizerState;
+       const PipelineCreateInfo::DepthStencilState::StencilOpState stencilOpState(vk::VK_STENCIL_OP_KEEP, vk::VK_STENCIL_OP_KEEP, vk::VK_STENCIL_OP_KEEP);
+       const PipelineCreateInfo::DepthStencilState                                     depthStencilState(false, false, vk::VK_COMPARE_OP_NEVER, true, 0u, stencilOpState, stencilOpState);
+       const PipelineCreateInfo::DynamicState                                          dynamicState;
 
        m_pipeline.setDefaultTopology(m_topology)
                          .setDynamicState(static_cast<const vk::VkPipelineDynamicStateCreateInfo*>(&dynamicState))