From 653bcd85e0289765ccdd12dbd420a9f528f44329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 15 Sep 2024 10:32:14 -0400 Subject: [PATCH] radeonsi: remove barriers around clears using aux_context.compute_resource_init Nothing else uses that context, so all barriers are unnecessary. Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_buffer.c | 1 - src/gallium/drivers/radeonsi/si_pipe.h | 7 ++++++- src/gallium/drivers/radeonsi/si_texture.c | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index 3ecc9ede8ee..f2ffc54a8b4 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -196,7 +196,6 @@ bool si_alloc_resource(struct si_screen *sscreen, struct si_resource *res) si_clear_buffer(ctx, &res->b.b, 0, res->bo_size, &value, 4, SI_AUTO_SELECT_CLEAR_METHOD, false); - si_barrier_after_simple_buffer_op(ctx, 0, &res->b.b, NULL); si_put_aux_context_flush(&sscreen->aux_context.compute_resource_init); } diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 23697d6b5c1..8fbb1321e5e 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -559,7 +559,12 @@ struct si_screen { struct { struct si_aux_context general; - /* Used by resource_create to clear/initialize memory. */ + /* Used by resource_create to clear/initialize memory. + * + * Note that there are no barriers around the clears, which enables parallelism between + * individual clears. If anything else uses this context, it should wait for idle before + * using any buffer/texture. + */ struct si_aux_context compute_resource_init; /* Second auxiliary context for uploading shaders. When the first auxiliary context is diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 07fbadcf394..e480640b542 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1282,9 +1282,7 @@ static struct si_texture *si_texture_create_object(struct pipe_screen *screen, if (num_clears) { struct si_context *sctx = si_get_aux_context(&sscreen->aux_context.compute_resource_init); - si_barrier_before_image_fast_clear(sctx, 0); si_execute_clears(sctx, clears, num_clears, false); - si_barrier_after_image_fast_clear(sctx); si_put_aux_context_flush(&sscreen->aux_context.compute_resource_init); }