freedreno/a6xx: Always pass ctx to fd6_emit_textures()
authorRob Clark <robdclark@chromium.org>
Sun, 28 Feb 2021 19:04:42 +0000 (11:04 -0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 1 Mar 2021 20:01:07 +0000 (20:01 +0000)
Prep for next patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9321>

src/gallium/drivers/freedreno/a6xx/fd6_emit.c
src/gallium/drivers/freedreno/a6xx/fd6_emit.h
src/gallium/drivers/freedreno/a6xx/fd6_texture.c

index 8a8373d..bef2841 100644 (file)
@@ -282,11 +282,11 @@ fd6_emit_fb_tex(struct fd_ringbuffer *state, struct fd_context *ctx)
 }
 
 bool
-fd6_emit_textures(struct fd_pipe *pipe, struct fd_ringbuffer *ring,
+fd6_emit_textures(struct fd_context *ctx, struct fd_ringbuffer *ring,
                enum pipe_shader_type type, struct fd_texture_stateobj *tex,
                unsigned bcolor_offset,
                /* can be NULL if no image/SSBO/fb state to merge in: */
-               const struct ir3_shader_variant *v, struct fd_context *ctx)
+               const struct ir3_shader_variant *v)
 {
        bool needs_border = false;
        unsigned opcode, tex_samp_reg, tex_const_reg, tex_count_reg;
@@ -341,7 +341,7 @@ fd6_emit_textures(struct fd_pipe *pipe, struct fd_ringbuffer *ring,
 
        if (tex->num_samplers > 0) {
                struct fd_ringbuffer *state =
-                       fd_ringbuffer_new_object(pipe, tex->num_samplers * 4 * 4);
+                       fd_ringbuffer_new_object(ctx->pipe, tex->num_samplers * 4 * 4);
                for (unsigned i = 0; i < tex->num_samplers; i++) {
                        static const struct fd6_sampler_stateobj dummy_sampler = {};
                        const struct fd6_sampler_stateobj *sampler = tex->samplers[i] ?
@@ -388,7 +388,7 @@ fd6_emit_textures(struct fd_pipe *pipe, struct fd_ringbuffer *ring,
 
        if (num_merged_textures > 0) {
                struct fd_ringbuffer *state =
-                       fd_ringbuffer_new_object(pipe, num_merged_textures * 16 * 4);
+                       fd_ringbuffer_new_object(ctx->pipe, num_merged_textures * 16 * 4);
                for (unsigned i = 0; i < num_textures; i++) {
                        static const struct fd6_pipe_sampler_view dummy_view = {};
                        const struct fd6_pipe_sampler_view *view = tex->textures[i] ?
@@ -540,8 +540,8 @@ fd6_emit_combined_textures(struct fd_ringbuffer *ring, struct fd6_emit *emit,
                        unsigned bcolor_offset =
                                fd6_border_color_offset(ctx, type, tex);
 
-                       needs_border |= fd6_emit_textures(ctx->pipe, stateobj, type, tex,
-                                       bcolor_offset, v, ctx);
+                       needs_border |= fd6_emit_textures(ctx, stateobj, type, tex,
+                                       bcolor_offset, v);
 
                        fd6_emit_take_group(emit, stateobj, s[type].state_id,
                                        s[type].enable_mask);
@@ -1142,8 +1142,8 @@ fd6_emit_cs_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
                struct fd_texture_stateobj *tex = &ctx->tex[PIPE_SHADER_COMPUTE];
                unsigned bcolor_offset = fd6_border_color_offset(ctx, PIPE_SHADER_COMPUTE, tex);
 
-               bool needs_border = fd6_emit_textures(ctx->pipe, ring, PIPE_SHADER_COMPUTE, tex,
-                               bcolor_offset, cp, ctx);
+               bool needs_border = fd6_emit_textures(ctx, ring, PIPE_SHADER_COMPUTE, tex,
+                               bcolor_offset, cp);
 
                if (needs_border)
                        emit_border_color(ctx, ring);
index 5d51d3c..54376a2 100644 (file)
@@ -270,10 +270,10 @@ fd6_gl2spacing(enum gl_tess_spacing spacing)
        }
 }
 
-bool fd6_emit_textures(struct fd_pipe *pipe, struct fd_ringbuffer *ring,
+bool fd6_emit_textures(struct fd_context *ctx, struct fd_ringbuffer *ring,
                enum pipe_shader_type type, struct fd_texture_stateobj *tex,
                unsigned bcolor_offset,
-               const struct ir3_shader_variant *v, struct fd_context *ctx) assert_dt;
+               const struct ir3_shader_variant *v) assert_dt;
 
 void fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit) assert_dt;
 
index 56d25ce..c417ee3 100644 (file)
@@ -400,8 +400,7 @@ fd6_texture_state(struct fd_context *ctx, enum pipe_shader_type type,
        state->stateobj = fd_ringbuffer_new_object(ctx->pipe, 0x1000);
        state->needs_border = needs_border;
 
-       fd6_emit_textures(ctx->pipe, state->stateobj, type, tex, key.bcolor_offset,
-                       NULL, NULL);
+       fd6_emit_textures(ctx, state->stateobj, type, tex, key.bcolor_offset, NULL);
 
        /* NOTE: uses copy of key in state obj, because pointer passed by caller
         * is probably on the stack