diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c index 906c60915f1..e0559c18c5c 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c @@ -565,7 +565,7 @@ emit_tex(struct etna_compile *c, nir_tex_instr * tex) } } - etna_emit_tex(c, tex->op, tex->sampler_index, dst_swiz, dst, get_src(c, coord), + etna_emit_tex(c, tex, dst_swiz, dst, get_src(c, coord), src1 ? get_src(c, src1) : SRC_DISABLE, src2 ? get_src(c, src2) : SRC_DISABLE); } diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.h b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.h index c1041a3c714..0c7f2622179 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.h +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.h @@ -422,7 +422,7 @@ etna_emit_alu(struct etna_compile *c, nir_op op, struct etna_inst_dst dst, struct etna_inst_src src[3], bool saturate); void -etna_emit_tex(struct etna_compile *c, nir_texop op, unsigned texid, unsigned dst_swiz, +etna_emit_tex(struct etna_compile *c, nir_tex_instr *tex, unsigned dst_swiz, struct etna_inst_dst dst, struct etna_inst_src coord, struct etna_inst_src src1, struct etna_inst_src src2); diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c index d7a8ad75dea..fd2ff19d3e7 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c @@ -198,13 +198,13 @@ etna_emit_alu(struct etna_compile *c, nir_op op, struct etna_inst_dst dst, } void -etna_emit_tex(struct etna_compile *c, nir_texop op, unsigned texid, unsigned dst_swiz, +etna_emit_tex(struct etna_compile *c, nir_tex_instr * tex, unsigned dst_swiz, struct etna_inst_dst dst, struct etna_inst_src coord, struct etna_inst_src src1, struct etna_inst_src src2) { struct etna_inst inst = { .dst = dst, - .tex.id = texid + (is_fs(c) ? 0 : c->specs->vertex_sampler_offset), + .tex.id = tex->sampler_index + (is_fs(c) ? 0 : c->specs->vertex_sampler_offset), .tex.swiz = dst_swiz, .src[0] = coord, }; @@ -215,7 +215,7 @@ etna_emit_tex(struct etna_compile *c, nir_texop op, unsigned texid, unsigned dst if (src2.use) inst.src[2] = src2; - switch (op) { + switch (tex->op) { case nir_texop_tex: inst.opcode = ISA_OPC_TEXLD; break; case nir_texop_txb: inst.opcode = ISA_OPC_TEXLDB; break; case nir_texop_txd: inst.opcode = ISA_OPC_TEXLDD; break; @@ -225,7 +225,7 @@ etna_emit_tex(struct etna_compile *c, nir_texop op, unsigned texid, unsigned dst inst.src[2] = etna_immediate_int(0x1100); break; default: - compile_error(c, "Unhandled NIR tex type: %d\n", op); + compile_error(c, "Unhandled NIR tex type: %d\n", tex->op); } emit_inst(c, &inst);