From 449a747979bfd78d6af70e6f0102f50bcec97b4b Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 3 Sep 2018 08:58:28 -0500 Subject: [PATCH] anv: Apply pipeline lushes a bit earlier and more often --- src/intel/vulkan/genX_cmd_buffer.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index f95e106f923..a03c0ff8a27 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -2525,6 +2525,8 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer) genX(flush_pipeline_select_3d)(cmd_buffer); + genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer); + if (vb_emit) { const uint32_t num_buffers = __builtin_popcount(vb_emit); const uint32_t num_dwords = 1 + num_buffers * 4; @@ -2642,8 +2644,6 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer) gen7_cmd_buffer_emit_scissor(cmd_buffer); genX(cmd_buffer_flush_dynamic_state)(cmd_buffer); - - genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer); } static void @@ -3043,10 +3043,12 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer) * sufficient." */ cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_CS_STALL_BIT; - genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer); + } + + genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer); + if (cmd_buffer->state.compute.pipeline_dirty) anv_batch_emit_batch(&cmd_buffer->batch, &pipeline->batch); - } if ((cmd_buffer->state.descriptors_dirty & VK_SHADER_STAGE_COMPUTE_BIT) || cmd_buffer->state.compute.pipeline_dirty) { @@ -3073,8 +3075,6 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer) } cmd_buffer->state.compute.pipeline_dirty = false; - - genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer); } #if GEN_GEN == 7 @@ -3825,6 +3825,8 @@ cmd_buffer_begin_subpass(struct anv_cmd_buffer *cmd_buffer, att_state->pending_load_aspects = 0; } + genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer); + cmd_buffer_emit_depth_stencil(cmd_buffer); } -- 2.17.1