From 765f3b78d567ebeac39016e1518d81a6a5df9053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Wed, 5 Feb 2025 13:01:12 +0200 Subject: [PATCH] anv: apply cache flushes on pipeline select with gfx20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes rendering artifacts seen with Hogwarts Legacy and Black Myth Wukong. Assumption is that we can get rid of these flushes once RESOURCE_BARRIER work lands but until then we need them. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12540 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12489 Signed-off-by: Tapani Pälli Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index ed12621521f..68f3ef54256 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -4604,26 +4604,6 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer, if (cmd_buffer->state.current_pipeline == pipeline) return; -#if GFX_VER >= 20 - /* While PIPELINE_SELECT is not needed on Xe2+, our current assumption - * is that the pipelined flushes in the 3D pipeline are not getting - * synchronized with the compute dispatches (and vice versa). So we need - * a CS_STALL prior the next set of commands to ensure the flushes have - * completed. - * - * The new RESOURCE_BARRIER instruction has support for synchronizing - * 3D/Compute and once we switch to that we should be able to get rid of - * this CS_STALL. - */ - anv_add_pending_pipe_bits(cmd_buffer, ANV_PIPE_CS_STALL_BIT, "pipeline switch stall"); - - /* Since we are not stalling/flushing caches explicitly while switching - * between the pipelines, we need to apply data dependency flushes recorded - * previously on the resource. - */ - genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer); -#else - #if GFX_VER == 9 /* From the Broadwell PRM, Volume 2a: Instructions, PIPELINE_SELECT: * @@ -4791,7 +4771,6 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer, if (pipeline == GPGPU) cmd_buffer->state.push_constants_dirty |= VK_SHADER_STAGE_COMPUTE_BIT; #endif -#endif /* else of if GFX_VER >= 20 */ cmd_buffer->state.current_pipeline = pipeline; }