From aaf1174fd30a8950d38b2b87b00589316d5e7e3c Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Thu, 9 Jan 2025 11:03:12 +0800 Subject: [PATCH] radeonsi: remove si_screen.max_texel_buffer_elements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems to be a cache of the PIPE_CAP before, now we use pipe_caps access, no need for it. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_descriptors.c | 2 +- src/gallium/drivers/radeonsi/si_pipe.c | 2 -- src/gallium/drivers/radeonsi/si_pipe.h | 2 -- src/gallium/drivers/radeonsi/si_state.c | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index 694f8df248c..1d1954c2577 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -689,7 +689,7 @@ static void si_set_shader_image_desc(struct si_context *ctx, const struct pipe_i if (res->b.b.target == PIPE_BUFFER) { if (view->access & PIPE_IMAGE_ACCESS_WRITE) si_mark_image_range_valid(view); - uint32_t elements = si_clamp_texture_texel_count(screen->max_texel_buffer_elements, + uint32_t elements = si_clamp_texture_texel_count(screen->b.caps.max_texel_buffer_elements, view->format, view->u.buf.size); si_make_buffer_descriptor(screen, res, view->format, view->u.buf.offset, elements, diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 7cca2afc222..d4d043a26d8 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -1280,8 +1280,6 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws, si_init_screen_caps(sscreen); - sscreen->max_texel_buffer_elements = sscreen->b.caps.max_texel_buffer_elements; - if (sscreen->debug_flags & DBG(INFO)) ac_print_gpu_info(&sscreen->info, stdout); diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index e97c679135c..a9dcb2d867f 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -553,8 +553,6 @@ struct si_screen { /* Texture filter settings. */ int force_aniso; /* -1 = disabled */ - unsigned max_texel_buffer_elements; - /* Auxiliary context. Used to initialize resources and upload shaders. */ union { struct { diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index a222dbf65ba..dc7c106f559 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -4067,7 +4067,7 @@ static struct pipe_sampler_view *si_create_sampler_view(struct pipe_context *ctx /* Buffer resource. */ if (texture->target == PIPE_BUFFER) { - uint32_t elements = si_clamp_texture_texel_count(sctx->screen->max_texel_buffer_elements, + uint32_t elements = si_clamp_texture_texel_count(sctx->screen->b.caps.max_texel_buffer_elements, state->format, state->u.buf.size); si_make_buffer_descriptor(sctx->screen, si_resource(texture), state->format,