Module: Mesa Branch: main Commit: 818b49932a300b26c297b99835c5991275ea50a8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=818b49932a300b26c297b99835c5991275ea50a8
Author: Rob Clark <[email protected]> Date: Wed Feb 15 14:01:03 2023 -0800 freedreno/a6xx: Static-ify sampler_view_update() It doesn't need to be visible elsewhere since commit a93d3f14989 ("freedreno/a6xx: Move tex state building") Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408> --- src/gallium/drivers/freedreno/a6xx/fd6_texture.c | 58 ++++++++++++------------ src/gallium/drivers/freedreno/a6xx/fd6_texture.h | 3 -- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c index 5b05e03dbdf..2ea25dc1b88 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c @@ -349,36 +349,9 @@ fd6_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc, } static void -fd6_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); - - fd_set_sampler_views(pctx, shader, start, nr, unbind_num_trailing_slots, - take_ownership, views); - - if (!views) - return; - - for (unsigned i = 0; i < nr; i++) { - struct fd6_pipe_sampler_view *so = fd6_pipe_sampler_view(views[i + start]); - - if (!so) - continue; - - struct fd_resource *rsc = fd_resource(so->base.texture); - - fd6_validate_format(ctx, rsc, so->base.format); - fd6_sampler_view_update(ctx, so); - } -} - -void fd6_sampler_view_update(struct fd_context *ctx, struct fd6_pipe_sampler_view *so) + assert_dt { const struct pipe_sampler_view *cso = &so->base; struct pipe_resource *prsc = cso->texture; @@ -465,6 +438,35 @@ fd6_sampler_view_update(struct fd_context *ctx, } } +static void +fd6_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); + + fd_set_sampler_views(pctx, shader, start, nr, unbind_num_trailing_slots, + take_ownership, views); + + if (!views) + return; + + for (unsigned i = 0; i < nr; i++) { + struct fd6_pipe_sampler_view *so = fd6_pipe_sampler_view(views[i + start]); + + if (!so) + continue; + + struct fd_resource *rsc = fd_resource(so->base.texture); + + fd6_validate_format(ctx, rsc, so->base.format); + fd6_sampler_view_update(ctx, so); + } +} + /* NOTE this can be called in either driver thread or frontend thread * depending on where the last unref comes from */ diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_texture.h b/src/gallium/drivers/freedreno/a6xx/fd6_texture.h index ff1074e73fd..ddec27a8169 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_texture.h +++ b/src/gallium/drivers/freedreno/a6xx/fd6_texture.h @@ -94,9 +94,6 @@ fd6_pipe_sampler_view(struct pipe_sampler_view *pview) return (struct fd6_pipe_sampler_view *)pview; } -void fd6_sampler_view_update(struct fd_context *ctx, - struct fd6_pipe_sampler_view *so) assert_dt; - void fd6_texture_init(struct pipe_context *pctx); void fd6_texture_fini(struct pipe_context *pctx);
