From fc75c1e07f2dc69a024c579045166fd17bac0839 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 29 Nov 2022 13:36:37 +0100 Subject: [PATCH] r600/sfn: use three channels only for unary trans opts if possible Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp index 0a56d4b9fba..a9e1b7e07c1 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp @@ -2819,12 +2819,10 @@ emit_alu_trans_op1_cayman(const nir_alu_instr& alu, EAluOp opcode, Shader& shade auto pin = pin_for_components(alu); - unsigned ncomp = 4; //nir_dest_num_components(alu.dest.dest) == 4 ? 4 : 3; - - /* todo: Actually we need only three channels, but then we have - * to make sure that we don't hava w dest */ - for (unsigned j = 0; j < ncomp; ++j) { + for (unsigned j = 0; j < nir_dest_num_components(alu.dest.dest); ++j) { if (alu.dest.write_mask & (1 << j)) { + unsigned ncomp = j == 3 ? 4 : 3; + AluInstr::SrcValues srcs(ncomp); PRegister dest = value_factory.dest(alu.dest.dest, j, pin, (1 << ncomp) - 1);