From 1d037518017bfc56f290effecc4ea0a578583ea6 Mon Sep 17 00:00:00 2001 From: Patrick Lerda Date: Wed, 11 Jun 2025 00:20:17 +0200 Subject: [PATCH] r600: clean up and refactor texture_buffer_sampler_view() The parameters width0 and height0 are not used anymore and the function is prepared for the clamp update. Signed-off-by: Patrick Lerda Reviewed-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/evergreen_state.c | 5 ++--- src/gallium/drivers/r600/r600_state.c | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 5b54bf2b5fb..4ea3a80bc70 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -693,8 +693,7 @@ static void evergreen_fill_buffer_resource_words(struct r600_context *rctx, static struct pipe_sampler_view * texture_buffer_sampler_view(struct r600_context *rctx, - struct r600_pipe_sampler_view *view, - unsigned width0, unsigned height0) + struct r600_pipe_sampler_view *view) { struct r600_texture *tmp = (struct r600_texture*)view->base.texture; struct eg_buf_res_params params; @@ -944,7 +943,7 @@ evergreen_create_sampler_view_custom(struct pipe_context *ctx, view->base.context = ctx; if (state->target == PIPE_BUFFER) - return texture_buffer_sampler_view(rctx, view, width0, height0); + return texture_buffer_sampler_view(rctx, view); memset(¶ms, 0, sizeof(params)); params.pipe_format = state->format; diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index ba091bca375..04e851ea1db 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -615,12 +615,11 @@ static void *r600_create_sampler_state(struct pipe_context *ctx, } static struct pipe_sampler_view * -texture_buffer_sampler_view(struct r600_pipe_sampler_view *view, - unsigned width0, unsigned height0) - +texture_buffer_sampler_view(struct pipe_context *ctx, + struct r600_pipe_sampler_view *view) { struct r600_texture *tmp = (struct r600_texture*)view->base.texture; - int stride = util_format_get_blocksize(view->base.format); + const unsigned stride = util_format_get_blocksize(view->base.format); unsigned format, num_format, format_comp, endian; uint64_t offset = view->base.u.buf.offset; unsigned size = view->base.u.buf.size; @@ -678,7 +677,7 @@ r600_create_sampler_view_custom(struct pipe_context *ctx, view->base.context = ctx; if (texture->target == PIPE_BUFFER) - return texture_buffer_sampler_view(view, texture->width0, 1); + return texture_buffer_sampler_view(ctx, view); swizzle[0] = state->swizzle_r; swizzle[1] = state->swizzle_g;