From 17de5dd1c46f71683a00c52a59af2c8128b518f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 20 Oct 2023 22:11:14 -0400 Subject: [PATCH] radeonsi: inline si_screen_clear_buffer it has only one use Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_buffer.c | 10 ++++++++-- src/gallium/drivers/radeonsi/si_compute_blit.c | 9 --------- src/gallium/drivers/radeonsi/si_pipe.h | 2 -- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index 6196da9325f..27d227cdbbb 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -184,8 +184,14 @@ bool si_alloc_resource(struct si_screen *sscreen, struct si_resource *res) fprintf(stderr, "\n"); } - if (res->b.b.flags & SI_RESOURCE_FLAG_CLEAR) - si_screen_clear_buffer(sscreen, &res->b.b, 0, res->bo_size, 0, SI_OP_SYNC_AFTER); + if (res->b.b.flags & SI_RESOURCE_FLAG_CLEAR) { + struct si_context *ctx = si_get_aux_context(&sscreen->aux_context.general); + uint32_t value = 0; + + si_clear_buffer(ctx, &res->b.b, 0, res->bo_size, &value, 4, SI_OP_SYNC_AFTER, + SI_COHERENCY_SHADER, SI_AUTO_SELECT_CLEAR_METHOD); + si_put_aux_context_flush(&sscreen->aux_context.general); + } return true; } diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c index 06e2fc16c46..12459bad043 100644 --- a/src/gallium/drivers/radeonsi/si_compute_blit.c +++ b/src/gallium/drivers/radeonsi/si_compute_blit.c @@ -492,15 +492,6 @@ void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, } } -void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset, - uint64_t size, unsigned value, unsigned flags) -{ - struct si_context *ctx = si_get_aux_context(&sscreen->aux_context.general); - si_clear_buffer(ctx, dst, offset, size, &value, 4, flags, - SI_COHERENCY_SHADER, SI_AUTO_SELECT_CLEAR_METHOD); - si_put_aux_context_flush(&sscreen->aux_context.general); -} - static void si_pipe_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned offset, unsigned size, const void *clear_value, int clear_value_size) diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 0901e0c759e..fa9870cddfc 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -1486,8 +1486,6 @@ void si_compute_clear_buffer_rmw(struct si_context *sctx, struct pipe_resource * unsigned dst_offset, unsigned size, uint32_t clear_value, uint32_t writebitmask, unsigned flags, enum si_coherency coher); -void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset, - uint64_t size, unsigned value, unsigned flags); void si_copy_buffer(struct si_context *sctx, struct pipe_resource *dst, struct pipe_resource *src, uint64_t dst_offset, uint64_t src_offset, unsigned size, unsigned flags); bool si_compute_copy_image(struct si_context *sctx, struct pipe_resource *dst, unsigned dst_level,