pan/mdg: Remove nir_alu_src_index

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4792>
This commit is contained in:
Alyssa Rosenzweig 2020-04-27 16:33:54 -04:00 committed by Marge Bot
parent fbbe3d4b75
commit d4600c4340
3 changed files with 4 additions and 10 deletions

View file

@ -458,12 +458,6 @@ nir_src_index(compiler_context *ctx, nir_src *src)
}
}
static inline unsigned
nir_alu_src_index(compiler_context *ctx, nir_alu_src *src)
{
return nir_src_index(ctx, &src->src);
}
static inline unsigned
nir_dest_index(nir_dest *dst)
{

View file

@ -920,9 +920,9 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
* instructions. The latter can only be fetched if the instruction
* needs it, or else we may segfault. */
unsigned src0 = nir_alu_src_index(ctx, &instr->src[0]);
unsigned src1 = nr_inputs >= 2 ? nir_alu_src_index(ctx, &instr->src[1]) : ~0;
unsigned src2 = nr_inputs == 3 ? nir_alu_src_index(ctx, &instr->src[2]) : ~0;
unsigned src0 = nir_src_index(ctx, &instr->src[0].src);
unsigned src1 = nr_inputs >= 2 ? nir_src_index(ctx, &instr->src[1].src) : ~0;
unsigned src2 = nr_inputs == 3 ? nir_src_index(ctx, &instr->src[2].src) : ~0;
assert(nr_inputs <= 3);
/* Rather than use the instruction generation helpers, we do it

View file

@ -102,7 +102,7 @@ midgard_emit_derivatives(compiler_context *ctx, nir_alu_instr *instr)
.type = TAG_TEXTURE_4,
.mask = mask_of(nr_components),
.dest = nir_dest_index(&instr->dest.dest),
.src = { nir_alu_src_index(ctx, &instr->src[0]), ~0, ~0, ~0 },
.src = { nir_src_index(ctx, &instr->src[0].src), ~0, ~0, ~0 },
.texture = {
.op = mir_derivative_op(instr->op),
.format = MALI_TEX_2D,