From f7226181b408f0087032e3b9dff4c87f89b657aa Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Mon, 7 Aug 2023 08:51:23 +0200 Subject: [PATCH] r600/sfn: take number of dest values into account With the write mask removed we have to run the loop correctly. Fixes: b870988b77f70acd69feb1d4e52343b7c3d4e328 r600/sfn: Stop referencing legacy functionality Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9490 Part-of: --- src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp index ac050aa05c1..d5e00eaee79 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp @@ -2719,7 +2719,7 @@ emit_alu_comb_with_zero(const nir_alu_instr& alu, EAluOp opcode, Shader& shader) auto& value_factory = shader.value_factory(); AluInstr *ir = nullptr; auto pin = pin_for_components(alu); - for (int i = 0; i < 4; ++i) { + for (unsigned i = 0; i < nir_dest_num_components(alu.dest.dest); ++i) { ir = new AluInstr(opcode, value_factory.dest(alu.dest, i, pin), value_factory.zero(), @@ -2961,7 +2961,7 @@ emit_alu_trans_op2_eg(const nir_alu_instr& alu, EAluOp opcode, Shader& shader) AluInstr *ir = nullptr; auto pin = pin_for_components(alu); - for (int i = 0; i < 4; ++i) { + for (unsigned i = 0; i < nir_dest_num_components(alu.dest.dest); ++i) { ir = new AluInstr(opcode, value_factory.dest(alu.dest.dest, i, pin), value_factory.src(src0, i),