From cce59200254fe6b0d45f408777e9cf3490359d24 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 16 Jan 2024 17:26:46 +0100 Subject: [PATCH] radeonsi: adjust flags for si_compute_shorten_ubyte_buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - no need to flush anything before as we're working on a clean buffer (SI_OP_SKIP_CACHE_INV_BEFORE) - L2 must be flushed after the job to avoid rendering artifacts. Instead of setting it manually, use SI_OP_SYNC_AFTER + SI_COHERENCY_NONE. Fixes: 1a99f50c7f2 ("radeonsi: use a compute shader to convert unsupported indices format") Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_compute_blit.c | 5 ++++- src/gallium/drivers/radeonsi/si_state_draw.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c index fe7ffe8b6ab..cdcf255b187 100644 --- a/src/gallium/drivers/radeonsi/si_compute_blit.c +++ b/src/gallium/drivers/radeonsi/si_compute_blit.c @@ -535,7 +535,10 @@ void si_compute_shorten_ubyte_buffer(struct si_context *sctx, struct pipe_resour if (!sctx->cs_ubyte_to_ushort) sctx->cs_ubyte_to_ushort = si_create_ubyte_to_ushort_compute_shader(sctx); - enum si_coherency coher = SI_COHERENCY_SHADER; + /* Use COHERENCY_NONE to get SI_CONTEXT_WB_L2 automatically used in + * si_launch_grid_internal_ssbos. + */ + enum si_coherency coher = SI_COHERENCY_NONE; si_improve_sync_flags(sctx, dst, src, &flags); diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp index 1a8969309e5..01d210520ba 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.cpp +++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp @@ -2049,7 +2049,7 @@ static void si_draw(struct pipe_context *ctx, si_compute_shorten_ubyte_buffer(sctx, indexbuf, info->index.resource, start_offset, index_offset + start, count, - SI_OP_SYNC_AFTER); + SI_OP_SKIP_CACHE_INV_BEFORE | SI_OP_SYNC_AFTER); index_offset = 0; index_size = 2;