From f2280e03e21d37ab9bf3b8f0ebeea42dda7fdf37 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sun, 2 Aug 2020 19:35:58 +0200 Subject: [PATCH] r600/sfn: Fix ordering of tex param moves Both moves should happen in the same instuction group, otherwise the lod/bias value will be overwritten by the shadow compare value. Signed-off-by: Gert Wollny Part-of: --- .../r600/sfn/sfn_emittexinstruction.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_emittexinstruction.cpp b/src/gallium/drivers/r600/sfn/sfn_emittexinstruction.cpp index 8764d8adeac..0fe9db23dae 100644 --- a/src/gallium/drivers/r600/sfn/sfn_emittexinstruction.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_emittexinstruction.cpp @@ -539,15 +539,15 @@ bool EmitTexInstruction::emit_tex_txl(nir_tex_instr* instr, TexInputs& src) << "' (" << __func__ << ")\n"; auto tex_op = TexInstruction::sample_l; - emit_instruction(new AluInstruction(op1_mov, src.coord.reg_i(3), src.lod, - {alu_last_instr, alu_write})); - if (instr->is_shadow) { emit_instruction(new AluInstruction(op1_mov, src.coord.reg_i(2), src.comperator, - {alu_last_instr, alu_write})); + {alu_write})); tex_op = TexInstruction::sample_c_l; } + emit_instruction(new AluInstruction(op1_mov, src.coord.reg_i(3), src.lod, + {alu_last_instr, alu_write})); + auto sampler = get_samplerr_id(instr->sampler_index, src.sampler_deref); assert(!sampler.indirect && "Indirect sampler selection not yet supported"); @@ -571,14 +571,15 @@ bool EmitTexInstruction::emit_tex_txb(nir_tex_instr* instr, TexInputs& src) std::array in_swizzle = {0,1,2,3}; + if (instr->is_shadow) { + emit_instruction(new AluInstruction(op1_mov, src.coord.reg_i(2), src.comperator, + {alu_write})); + tex_op = TexInstruction::sample_c_lb; + } + emit_instruction(new AluInstruction(op1_mov, src.coord.reg_i(3), src.bias, {alu_last_instr, alu_write})); - if (instr->is_shadow) { - emit_instruction(new AluInstruction(op1_mov, src.coord.reg_i(2), src.comperator, - {alu_last_instr, alu_write})); - tex_op = TexInstruction::sample_c_lb; - } GPRVector tex_src(src.coord, in_swizzle);