From 1ff2c01741bf14b3af9e36f0e4c8b5a92e60cbf2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 7 Jan 2021 10:04:03 -0800 Subject: [PATCH] gallium/ntt: Stop lowering integer source mods. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Gert Wollny Part-of: --- 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 9384406..8a80af0 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); -- 2.7.4