Mesa (main): ir3: Lower alu to scalar if nir_legalize_16bit_sampler_srcs made progress.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 21 20:04:08 UTC 2022


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

Author: Georg Lehmann <dadschoorse at gmail.com>
Date:   Tue Jul 19 22:44:42 2022 +0200

ir3: Lower alu to scalar if nir_legalize_16bit_sampler_srcs made progress.

Fixes: 003327dd95b ("freedreno/ir3: Pass 16-bit sampler coordinates when possible.")
Signed-off-by: Georg Lehmann <dadschoorse at gmail.com>
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16978>

---

 src/freedreno/ir3/ir3_nir.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c
index d9a20bca314..93c43f488a7 100644
--- a/src/freedreno/ir3/ir3_nir.c
+++ b/src/freedreno/ir3/ir3_nir.c
@@ -802,7 +802,11 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
             [nir_tex_src_ddy] = {true, 0, nir_tex_src_coord},
 
          };
-         NIR_PASS_V(s, nir_legalize_16bit_sampler_srcs, tex_constraints);
+         bool scalarize = false;
+         NIR_PASS(scalarize, s, nir_legalize_16bit_sampler_srcs, tex_constraints);
+         if (scalarize) {
+            OPT(s, nir_lower_alu_to_scalar, NULL, NULL);
+         }
       }
       OPT_V(s, nir_opt_constant_folding);
       OPT_V(s, nir_copy_prop);



More information about the mesa-commit mailing list