radv: handle subpass dependencies correctly
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 29 Jan 2019 21:18:59 +0000 (22:18 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 4 Feb 2019 12:19:14 +0000 (13:19 +0100)
The different masks should be accumulated. For example if two
subpasses declare an outgoing dependency (ie. dst ==
VK_SUBPASS_EXTERNAL).

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

index 4d9fb0bf7dfff7cb0acd4dfca9aaba7ea34fd6cc..0a37392322f751abb4d75eba0402c2f3e1c39591 100644 (file)
@@ -43,13 +43,13 @@ radv_render_pass_add_subpass_dep(struct radv_render_pass *pass,
                return;
 
        if (dst == VK_SUBPASS_EXTERNAL) {
-               pass->end_barrier.src_stage_mask = dep->srcStageMask;
-               pass->end_barrier.src_access_mask = dep->srcAccessMask;
-               pass->end_barrier.dst_access_mask = dep->dstAccessMask;
+               pass->end_barrier.src_stage_mask |= dep->srcStageMask;
+               pass->end_barrier.src_access_mask |= dep->srcAccessMask;
+               pass->end_barrier.dst_access_mask |= dep->dstAccessMask;
        } else {
-               pass->subpasses[dst].start_barrier.src_stage_mask = dep->srcStageMask;
-               pass->subpasses[dst].start_barrier.src_access_mask = dep->srcAccessMask;
-               pass->subpasses[dst].start_barrier.dst_access_mask = dep->dstAccessMask;
+               pass->subpasses[dst].start_barrier.src_stage_mask |= dep->srcStageMask;
+               pass->subpasses[dst].start_barrier.src_access_mask |= dep->srcAccessMask;
+               pass->subpasses[dst].start_barrier.dst_access_mask |= dep->dstAccessMask;
        }
 }