Fix bad depth/stencil sync for depth_range_unrestricted
authorGraeme Leese <gleese@broadcom.com>
Wed, 14 Sep 2022 13:45:58 +0000 (14:45 +0100)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 29 Sep 2022 16:53:20 +0000 (16:53 +0000)
The synchronisation for the depth image was only for the late fragment
tests stage and only for writing. Since the depth test needs to read the
existing value the sync requires the READ bit and should apply at the
earliest stage that might perform the test (EARLY_FRAGMENT_TESTS, rather
than LATE_FRAGMENT_TESTS).

Component: Vulkan
Affects: dEQP-VK.pipeline.depth_range_unrestricted.*

Change-Id: I329e0f201735d0241c35f37a33379f361334f43e

external/vulkancts/modules/vulkan/pipeline/vktPipelineDepthRangeUnrestrictedTests.cpp

index 1d02c9b..54247ef 100644 (file)
@@ -881,7 +881,7 @@ DepthRangeUnrestrictedTestInstance::DepthRangeUnrestrictedTestInstance      (Context&
                        VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,                         // VkStructureType                      sType;
                        DE_NULL,                                                                                        // const void*                          pNext;
                        0u,                                                                                                     // VkAccessFlags                        srcAccessMask;
-                       VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,           // VkAccessFlags                        dstAccessMask;
+                       VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,             // VkAccessFlags                        dstAccessMask;
                        VK_IMAGE_LAYOUT_UNDEFINED,                                                      // VkImageLayout                        oldLayout;
                        VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,       // VkImageLayout                        newLayout;
                        VK_QUEUE_FAMILY_IGNORED,                                                        // deUint32                                     srcQueueFamilyIndex;
@@ -1268,7 +1268,7 @@ void DepthBoundsRangeUnrestrictedTestInstance::prepareCommandBuffer (bool firstD
 
        beginCommandBuffer(vk, *m_cmdBuffer, 0u);
 
-       vk.cmdPipelineBarrier(*m_cmdBuffer, (firstDraw ? VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT : VK_PIPELINE_STAGE_TRANSFER_BIT), VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, (VkDependencyFlags)0,
+       vk.cmdPipelineBarrier(*m_cmdBuffer, (firstDraw ? VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT : VK_PIPELINE_STAGE_TRANSFER_BIT), VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, (VkDependencyFlags)0,
                0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(m_imageLayoutBarriers), m_imageLayoutBarriers);
 
        prepareRenderPass((firstDraw ? *m_renderPass : *m_renderPassSecondDraw),