From 3563ae4b2d5626698145dd8d7b101d8a829c9d36 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 28 Dec 2021 11:04:28 -0800 Subject: [PATCH] nir_to_tgsi: Fix a bug in TXP detection after backend lowering. TGSI reserves 2 components for the coord in the first operand vector, even for 1D. Fixes r600 failure with shadow1d. Fixes: 390a3fcdc45e ("nir_to_tgsi: Add support for TXP.") Reviewed-by: Matt Turner Part-of: --- src/gallium/auxiliary/nir/nir_to_tgsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index 4c8068712c8..6281c197edf 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -2097,7 +2097,7 @@ ntt_emit_texture(struct ntt_compile *c, nir_tex_instr *instr) switch (instr->op) { case nir_texop_tex: if (nir_tex_instr_src_size(instr, nir_tex_instr_src_index(instr, nir_tex_src_backend1)) > - instr->coord_components + instr->is_shadow) + MAX2(instr->coord_components, 2) + instr->is_shadow) tex_opcode = TGSI_OPCODE_TXP; else tex_opcode = TGSI_OPCODE_TEX;