From 6ee7a2ecfa11ba77af79583b529696de643af165 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 2 Mar 2023 18:44:45 +0200 Subject: [PATCH] anv: pull Wa_14016118574 out of some loop not changing state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The WA is meant to be here to apply some state that is not propagated properly inside the HW. But if you have a loop like : for ( ... ) { emit(3DPRIMITIVE, some param); } You're not really changing any state, just push more draws into the pipeline. Signed-off-by: Lionel Landwerlin Fixes: f2645229c2 ("anv: implement Wa_14016118574") Reviewed-by: Tapani Pälli Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 52f40c25680..9fc80fdda1e 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -4226,12 +4226,15 @@ void genX(CmdDrawMultiEXT)( prim.ExtendedParameter1 = firstInstance; prim.ExtendedParameter2 = i; } -#if GFX_VERx10 == 125 - genX(emit_dummy_post_sync_op)(cmd_buffer, draw->vertexCount); -#endif } #endif +#if GFX_VERx10 == 125 + genX(emit_dummy_post_sync_op)(cmd_buffer, + drawCount == 0 ? 0 : + pVertexInfo[drawCount - 1].vertexCount); +#endif + update_dirty_vbs_for_gfx8_vb_flush(cmd_buffer, SEQUENTIAL); trace_intel_end_draw_multi(&cmd_buffer->trace, count); @@ -4434,12 +4437,15 @@ void genX(CmdDrawMultiIndexedEXT)( prim.ExtendedParameter1 = firstInstance; prim.ExtendedParameter2 = i; } -#if GFX_VERx10 == 125 - genX(emit_dummy_post_sync_op)(cmd_buffer, draw->indexCount); -#endif } #endif +#if GFX_VERx10 == 125 + genX(emit_dummy_post_sync_op)(cmd_buffer, + drawCount == 0 ? 0 : + pIndexInfo[drawCount - 1].indexCount); +#endif + update_dirty_vbs_for_gfx8_vb_flush(cmd_buffer, RANDOM); trace_intel_end_draw_indexed_multi(&cmd_buffer->trace, count); @@ -4686,7 +4692,7 @@ emit_indirect_draws(struct anv_cmd_buffer *cmd_buffer, } #if GFX_VERx10 == 125 - genX(emit_dummy_post_sync_op)(cmd_buffer, 1); + genX(emit_dummy_post_sync_op)(cmd_buffer, 1); #endif update_dirty_vbs_for_gfx8_vb_flush(cmd_buffer, SEQUENTIAL);