Mesa (main): lima: lower all undefs to zero in vs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jun 4 16:47:32 UTC 2022


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

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Wed May 18 15:32:09 2022 +1000

lima: lower all undefs to zero in vs

Otherwise we will later hit:

gpir_error("nir_ssa_undef_instr is not supported\n");

Unfortunatly this causes a piglit failure due to increased register
pressure in an unrealistic shader but since not doing this can
result in hitting the not supported error in more relistic shaders
this seems the right thing to do for now.

Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>

---

 src/gallium/drivers/lima/ci/lima-fails.txt | 1 +
 src/gallium/drivers/lima/lima_program.c    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/gallium/drivers/lima/ci/lima-fails.txt b/src/gallium/drivers/lima/ci/lima-fails.txt
index 58035199bc7..8cc9dffab87 100644
--- a/src/gallium/drivers/lima/ci/lima-fails.txt
+++ b/src/gallium/drivers/lima/ci/lima-fails.txt
@@ -388,6 +388,7 @@ spec at glsl-1.10@execution at samplers@glsl-fs-shadow2d-clamp-z,Fail
 spec at glsl-1.10@execution at samplers@glsl-fs-shadow2d,Fail
 spec at glsl-1.10@execution at samplers@glsl-fs-shadow2dproj-bias,Fail
 spec at glsl-1.10@execution at samplers@glsl-fs-shadow2dproj,Fail
+spec at glsl-1.10@execution at temp-array-indexing@glsl-vs-giant-temp-array,Fail
 spec at glsl-1.10@execution at variable-indexing@fs-temp-array-mat2-col-row-wr,Fail
 spec at glsl-1.10@execution at variable-indexing@fs-temp-array-mat2-col-wr,Fail
 spec at glsl-1.10@execution at variable-indexing@fs-temp-array-mat2-index-col-row-wr,Fail
diff --git a/src/gallium/drivers/lima/lima_program.c b/src/gallium/drivers/lima/lima_program.c
index f28eac5081c..9e43db13ea7 100644
--- a/src/gallium/drivers/lima/lima_program.c
+++ b/src/gallium/drivers/lima/lima_program.c
@@ -138,6 +138,7 @@ lima_program_optimize_vs_nir(struct nir_shader *s)
       NIR_PASS(progress, s, nir_opt_constant_folding);
       NIR_PASS(progress, s, nir_opt_undef);
       NIR_PASS(progress, s, nir_opt_loop_unroll);
+      NIR_PASS(progress, s, nir_lower_undef_to_zero);
    } while (progress);
 
    NIR_PASS_V(s, nir_lower_int_to_float);



More information about the mesa-commit mailing list