nir: Fix nir_validate fail after nir_lower_tex
authorRob Clark <robdclark@chromium.org>
Thu, 12 Nov 2020 00:59:04 +0000 (16:59 -0800)
committerMarge Bot <eric+marge@anholt.net>
Thu, 12 Nov 2020 17:12:17 +0000 (17:12 +0000)
commitf6359d2dc32d625319921d7232197764907bb5a4
treea27c5946604604029c1c50f620c7330f60781989
parent53660e4c4ed315d4b2fe5d921861fbfebf2bbe42
nir: Fix nir_validate fail after nir_lower_tex

It is UB to initialize unions on the stack and rely on bits not covered
by the initialized union member to be zero.  Lets just simplify it and
move the entire nir_const_value off the stack.

While we're in there, sprinkle around some const.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3778
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7579>
src/compiler/nir/nir_lower_tex.c