Mesa (master): r600/sfn: Fix ordering of tex param moves

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Sep 16 08:36:17 UTC 2020


Module: Mesa
Branch: master
Commit: f2280e03e21d37ab9bf3b8f0ebeea42dda7fdf37
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f2280e03e21d37ab9bf3b8f0ebeea42dda7fdf37

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Sun Aug  2 19:35:58 2020 +0200

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 <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6706>

---

 src/gallium/drivers/r600/sfn/sfn_emittexinstruction.cpp | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 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,15 +571,16 @@ bool EmitTexInstruction::emit_tex_txb(nir_tex_instr* instr, TexInputs& src)
 
    std::array<uint8_t, 4> in_swizzle = {0,1,2,3};
 
-   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}));
+                                          {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}));
+
+
    GPRVector tex_src(src.coord, in_swizzle);
 
    auto sampler = get_samplerr_id(instr->sampler_index, src.sampler_deref);



More information about the mesa-commit mailing list