nir: Let nir_fixup_deref_modes() fix deref_casts when possible
authorCaio Oliveira <caio.oliveira@intel.com>
Mon, 19 Jun 2023 20:49:21 +0000 (13:49 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Jul 2023 16:20:36 +0000 (16:20 +0000)
commite693fd815aa01045965a4551503d6fb157d350d4
tree37ad03b305abe8cf4c115e1a5ea8860d81fc8294
parent38d1e73868c51fd73c8a9348b221f8ab0175588e
nir: Let nir_fixup_deref_modes() fix deref_casts when possible

If a deref_cast parent is also a deref, and the parent mode is not
generic, we can safely propagate the parent mode down to the
deref_cast.

This will allow the fixup to work when the deref_cast is used just
to change the glsl_type when accessing a variable/deref-chain.

Reviewed-by: Faith Ekstrand <faith@gfxstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23734>
src/compiler/nir/nir_deref.c