r600/sfn: lower undef to zero
authorGert Wollny <gert.wollny@collabora.com>
Thu, 21 Jul 2022 11:36:49 +0000 (13:36 +0200)
committerMarge Bot <emma+marge@anholt.net>
Sat, 23 Jul 2022 13:10:45 +0000 (13:10 +0000)
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@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>

src/gallium/drivers/r600/sfn/sfn_nir.cpp

index 8f813c2..8c87884 100644 (file)
@@ -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);