Mesa (main): nir/lower_mediump: Treat u2u16 like i2i16.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 10 16:43:23 UTC 2022


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

Author: Georg Lehmann <dadschoorse at gmail.com>
Date:   Sat Feb  5 12:08:27 2022 +0100

nir/lower_mediump: Treat u2u16 like i2i16.

There is a comment in nir_fold_16bit_sampler_conversions saying that these
are the same, but the code only checks for i2i16.

Signed-off-by: Georg Lehmann <dadschoorse at gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14893>

---

 src/compiler/nir/nir_lower_mediump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_mediump.c b/src/compiler/nir/nir_lower_mediump.c
index 49319dd24b5..7f3a5f01df4 100644
--- a/src/compiler/nir/nir_lower_mediump.c
+++ b/src/compiler/nir/nir_lower_mediump.c
@@ -393,7 +393,8 @@ is_u16_to_u32_conversion(nir_instr *instr)
 static bool
 is_i32_to_i16_conversion(nir_instr *instr)
 {
-   return is_n_to_m_conversion(instr, 32, nir_op_i2i16);
+   return is_n_to_m_conversion(instr, 32, nir_op_i2i16) ||
+      is_n_to_m_conversion(instr, 32, nir_op_u2u16);
 }
 
 static void



More information about the mesa-commit mailing list