Mesa (master): freedreno/ir3: fix GETLOD for negative LODs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 14 22:07:06 UTC 2019


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

Author: Jonathan Marek <jonathan at marek.ca>
Date:   Mon Oct  7 16:21:09 2019 -0400

freedreno/ir3: fix GETLOD for negative LODs

Note: for output type U32, negative LOD is not sign extended from 16 bits

Signed-off-by: Jonathan Marek <jonathan at marek.ca>
Reviewed-by: Rob Clark <robclark at gmail.com>

---

 src/freedreno/ir3/ir3_compiler_nir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c
index 7061964be20..38dad5c7e49 100644
--- a/src/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/freedreno/ir3/ir3_compiler_nir.c
@@ -1918,7 +1918,7 @@ emit_tex(struct ir3_context *ctx, nir_tex_instr *tex)
 	}
 
 	if (opc == OPC_GETLOD)
-		type = TYPE_U32;
+		type = TYPE_S32;
 
 	struct ir3_instruction *samp_tex;
 
@@ -1970,7 +1970,7 @@ emit_tex(struct ir3_context *ctx, nir_tex_instr *tex)
 
 		compile_assert(ctx, tex->dest_type == nir_type_float);
 		for (i = 0; i < 2; i++) {
-			dst[i] = ir3_MUL_F(b, ir3_COV(b, dst[i], TYPE_U32, TYPE_F32), 0,
+			dst[i] = ir3_MUL_F(b, ir3_COV(b, dst[i], TYPE_S32, TYPE_F32), 0,
 							   factor, 0);
 		}
 	}




More information about the mesa-commit mailing list