radv: ignore subpass self-dependencies for CreateRenderPass() too
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 23 Nov 2018 08:47:22 +0000 (09:47 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 23 Nov 2018 10:59:11 +0000 (11:59 +0100)
We really need to refactor this...

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pass.c

index f8e5ea4..b41ae89 100644 (file)
@@ -180,7 +180,17 @@ VkResult radv_CreateRenderPass(
        }
 
        for (unsigned i = 0; i < pCreateInfo->dependencyCount; ++i) {
+               uint32_t src = pCreateInfo->pDependencies[i].srcSubpass;
                uint32_t dst = pCreateInfo->pDependencies[i].dstSubpass;
+
+               /* Ignore subpass self-dependencies as they allow the app to
+                * call vkCmdPipelineBarrier() inside the render pass and the
+                * driver should only do the barrier when called, not when
+                * starting the render pass.
+                */
+               if (src == dst)
+                       continue;
+
                if (dst == VK_SUBPASS_EXTERNAL) {
                        pass->end_barrier.src_stage_mask = pCreateInfo->pDependencies[i].srcStageMask;
                        pass->end_barrier.src_access_mask = pCreateInfo->pDependencies[i].srcAccessMask;