r600/sfn: use three channels only for unary trans opts if possible

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
This commit is contained in:
Gert Wollny
2022-11-29 13:36:37 +01:00
committed by Marge Bot
parent 71df6ba92d
commit fc75c1e07f
@@ -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);