freedreno/a6xx: Always pass ctx to fd6_emit_textures()

Prep for next patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9321>
This commit is contained in:
Rob Clark 2021-02-28 11:04:42 -08:00 committed by Marge Bot
parent 21082b4529
commit 73f70d9b5f
3 changed files with 11 additions and 12 deletions

View 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);

View 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;

View 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