From 4c0fdef42cd19a9763b2c653ad1699b1083c81e4 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 26 Mar 2023 12:27:22 -0700 Subject: [PATCH] freedreno: Inline single-use helpers bind_sampler_states() / set_sampler_views() have just a single caller. So inline them. Needed for next commit. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_texture.c | 47 ++++++++--------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/src/gallium/drivers/freedreno/freedreno_texture.c b/src/gallium/drivers/freedreno/freedreno_texture.c index a7ece46..577303b 100644 --- a/src/gallium/drivers/freedreno/freedreno_texture.c +++ b/src/gallium/drivers/freedreno/freedreno_texture.c @@ -48,13 +48,14 @@ fd_sampler_view_destroy(struct pipe_context *pctx, FREE(view); } -static void -bind_sampler_states(struct fd_texture_stateobj *tex, unsigned start, - unsigned nr, void **hwcso) +void +fd_sampler_states_bind(struct pipe_context *pctx, enum pipe_shader_type shader, + unsigned start, unsigned nr, void **hwcso) in_dt { - unsigned i; + struct fd_context *ctx = fd_context(pctx); + struct fd_texture_stateobj *tex = &ctx->tex[shader]; - for (i = 0; i < nr; i++) { + for (unsigned i = 0; i < nr; i++) { unsigned p = i + start; tex->samplers[p] = hwcso ? hwcso[i] : NULL; if (tex->samplers[p]) @@ -64,13 +65,19 @@ bind_sampler_states(struct fd_texture_stateobj *tex, unsigned start, } tex->num_samplers = util_last_bit(tex->valid_samplers); + + fd_context_dirty_shader(ctx, shader, FD_DIRTY_SHADER_TEX); } -static void -set_sampler_views(struct fd_texture_stateobj *tex, unsigned start, unsigned nr, - unsigned unbind_num_trailing_slots, bool take_ownership, - struct pipe_sampler_view **views) +void +fd_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader, + unsigned start, unsigned nr, + unsigned unbind_num_trailing_slots, + bool take_ownership, + struct pipe_sampler_view **views) in_dt { + struct fd_context *ctx = fd_context(pctx); + struct fd_texture_stateobj *tex = &ctx->tex[shader]; unsigned i; for (i = 0; i < nr; i++) { @@ -98,29 +105,7 @@ set_sampler_views(struct fd_texture_stateobj *tex, unsigned start, unsigned nr, } tex->num_textures = util_last_bit(tex->valid_textures); -} - -void -fd_sampler_states_bind(struct pipe_context *pctx, enum pipe_shader_type shader, - unsigned start, unsigned nr, void **hwcso) in_dt -{ - struct fd_context *ctx = fd_context(pctx); - - bind_sampler_states(&ctx->tex[shader], start, nr, hwcso); - fd_context_dirty_shader(ctx, shader, FD_DIRTY_SHADER_TEX); -} - -void -fd_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader, - unsigned start, unsigned nr, - unsigned unbind_num_trailing_slots, - bool take_ownership, - struct pipe_sampler_view **views) in_dt -{ - struct fd_context *ctx = fd_context(pctx); - set_sampler_views(&ctx->tex[shader], start, nr, unbind_num_trailing_slots, - take_ownership, views); fd_context_dirty_shader(ctx, shader, FD_DIRTY_SHADER_TEX); } -- 2.7.4