radv: Only flush for the needed stages, and before the flushes.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 8 Mar 2017 22:51:01 +0000 (23:51 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 9 Mar 2017 01:35:19 +0000 (02:35 +0100)
Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_cmd_buffer.c

index 5d4236ca18705d046f6adb6513841db911bede61..274495f134f3acbb7841922da8535cae7b02d5a0 100644 (file)
@@ -2928,6 +2928,7 @@ void radv_CmdPipelineBarrier(
                                                        image);
        }
 
+       radv_stage_flush(cmd_buffer, srcStageMask);
        cmd_buffer->state.flush_bits |= src_flush_bits;
 
        for (uint32_t i = 0; i < imageMemoryBarrierCount; i++) {
@@ -2942,12 +2943,6 @@ void radv_CmdPipelineBarrier(
        }
 
        cmd_buffer->state.flush_bits |= dst_flush_bits;
-
-       /* TODO reduce this */
-       enum radv_cmd_flush_bits flush_bits = RADV_CMD_FLAG_CS_PARTIAL_FLUSH |
-               RADV_CMD_FLAG_PS_PARTIAL_FLUSH;
-
-       cmd_buffer->state.flush_bits |= flush_bits;
 }