glsl/nir/linker: Also remove image variables
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 18 Oct 2021 15:21:04 +0000 (10:21 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 27 Oct 2021 06:45:13 +0000 (01:45 -0500)
commit0bbb32ece45d9ef6dd62f5516a8ae1dc779ea3a3
tree4bf09892b77aef45d2d7d8506ef45088b3220b63
parent0a277fabce9dad868d5b38b9ba1d7be4afb62f62
glsl/nir/linker: Also remove image variables

If we don't, then the array shrinker may shrink them to an array of zero
images which can cause GLSL serialization to blow up but only the next
time the GLSL shader is loaded from the disk cache.

Fixes: b8ee37472d3e ("glsl: Use nir_var_mem_image for images")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5520
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13412>
src/compiler/glsl/gl_nir_linker.c