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@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
This commit is contained in:
Gert Wollny 2022-07-21 13:36:49 +02:00 committed by Marge Bot
parent 982effcd4e
commit 233f246bdf
1 changed files with 1 additions and 0 deletions

View 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);