From f5b09fefe3eadd4d213b38e0cbfdbb4dbbe9fe79 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 2 Aug 2023 10:24:59 -0400 Subject: [PATCH] ntt: Evaluate write_mask check In light of the input necessarily being SSA. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Faith Ekstrand Part-of: --- src/gallium/auxiliary/nir/nir_to_tgsi.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index 00d7191..b2a9303 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -1269,16 +1269,13 @@ ntt_get_alu_src(struct ntt_compile *c, nir_alu_instr *instr, int i) */ if (nir_src_bit_size(instr->src[i].src) == 64 && !(src.src.is_ssa && src.src.ssa->parent_instr->type == nir_instr_type_ssa_undef)) { - int chan0 = 0, chan1 = 1; + int chan1 = 1; if (nir_op_infos[instr->op].input_sizes[i] == 0) { - chan0 = ffs(instr->dest.write_mask) - 1; - chan1 = ffs(instr->dest.write_mask & ~(1 << chan0)) - 1; - if (chan1 == -1) - chan1 = chan0; + chan1 = nir_dest_num_components(instr->dest.dest) > 1 ? 1 : 0; } usrc = ureg_swizzle(usrc, - src.swizzle[chan0] * 2, - src.swizzle[chan0] * 2 + 1, + src.swizzle[0] * 2, + src.swizzle[0] * 2 + 1, src.swizzle[chan1] * 2, src.swizzle[chan1] * 2 + 1); } else { -- 2.7.4