Mesa (main): r600/sfn: lower undef to zero

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jul 23 14:23:00 UTC 2022


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

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Thu Jul 21 13:36:49 2022 +0200

r600/sfn: lower undef to zero

It's what the backend would do anyway, so let's do it in nir and
give the optimizer some chance to profit from possible improvements.

Fixes a bad shader with "The Raven Remastered"

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>

---

 src/gallium/drivers/r600/sfn/sfn_nir.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/r600/sfn/sfn_nir.cpp b/src/gallium/drivers/r600/sfn/sfn_nir.cpp
index 8f813c22831..8c878849b21 100644
--- a/src/gallium/drivers/r600/sfn/sfn_nir.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_nir.cpp
@@ -659,6 +659,7 @@ int r600_shader_from_nir(struct r600_context *rctx,
    NIR_PASS_V(sel->nir, nir_lower_idiv, &idiv_options);
    NIR_PASS_V(sel->nir, r600_nir_lower_trigen);
    NIR_PASS_V(sel->nir, nir_lower_phis_to_scalar, false);
+   NIR_PASS_V(sel->nir, nir_lower_undef_to_zero);
 
    if (lower_64bit)
       NIR_PASS_V(sel->nir, nir_lower_int64);



More information about the mesa-commit mailing list