mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
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 <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
This commit is contained in:
parent
7099f628c5
commit
4c0fdef42c
1 changed files with 16 additions and 31 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue