Module: Mesa Branch: main Commit: a7c6a7e3458b8368d8170756590d4bdd860f9422 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a7c6a7e3458b8368d8170756590d4bdd860f9422
Author: Gert Wollny <[email protected]> Date: Wed Sep 7 08:18:57 2022 +0200 r600/sfn: Don't allocate un-used components in texture ops Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18619> --- src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp index 8a2370fde35..bfb51259ff1 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp @@ -2486,12 +2486,15 @@ static bool emit_tex_fdd(const nir_alu_instr& alu, TexInstr::Opcode opcode, bool int ncomp = nir_dest_num_components(alu.dest.dest); RegisterVec4::Swizzle src_swz = {7,7,7,7}; - for (auto i = 0; i < ncomp; ++i) + RegisterVec4::Swizzle tmp_swz = {7,7,7,7}; + for (auto i = 0; i < ncomp; ++i) { src_swz[i] = alu.src[0].swizzle[i]; + tmp_swz[i] = i; + } - auto src = value_factory.src_vec4(alu.src[0].src, pin_group, src_swz); + auto src = value_factory.src_vec4(alu.src[0].src, pin_none, src_swz); - auto tmp = value_factory.temp_vec4(pin_group); + auto tmp = value_factory.temp_vec4(pin_group, tmp_swz); AluInstr *mv = nullptr; for (int i = 0; i < ncomp; ++i) { mv = new AluInstr(op1_mov, tmp[i], src[i], AluInstr::write);
