Mesa (master): gallium/ntt: Stop lowering integer source mods.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 23:08:38 UTC 2021


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jan  7 10:04:03 2021 -0800

gallium/ntt: Stop lowering integer source mods.

While tgsi_exec.c (softpipe) implemented 32b integer src mods, the
tgsi.rst documentation says only 32b negate is supported and not abs.
llvmpipe implemented 32 and 64 negate but not abs, virgl implemented
negate incorrectly, and r600 apparently doesn't do any integer src mods.
glsl_to_tgsi has apparently never generated integer src mods.

Given that r600 can't do any integer src mods, just stop trying to
generate them for TGSI.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8369>

---

 src/gallium/auxiliary/nir/nir_to_tgsi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c
index 9384406d7ca..8a80af0a41b 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c
@@ -2628,9 +2628,11 @@ nir_to_tgsi(struct nir_shader *s,
       NIR_PASS_V(s, nir_lower_bool_to_float);
    }
 
-   NIR_PASS_V(s, nir_lower_to_source_mods,
-              nir_lower_float_source_mods |
-              nir_lower_int_source_mods); /* no doubles */
+   /* Only lower 32-bit floats.  The only other modifier type officially
+    * supported by TGSI is 32-bit integer negates, but even those are broken on
+    * virglrenderer, so skip lowering all integer and f64 float mods.
+    */
+   NIR_PASS_V(s, nir_lower_to_source_mods, nir_lower_float_source_mods);
    NIR_PASS_V(s, nir_convert_from_ssa, true);
    NIR_PASS_V(s, nir_lower_vec_to_movs, NULL, NULL);
 



More information about the mesa-commit mailing list