nir/lower_non_uniform: Better handle non-derefs
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 12 Nov 2020 23:32:41 +0000 (17:32 -0600)
committerMarge Bot <eric+marge@anholt.net>
Mon, 7 Dec 2020 19:27:56 +0000 (19:27 +0000)
commitc47fe54bc785788147f1f1808d0da720995f5447
tree800141224f57acce680d69922cae8524b3e79d60
parent0bf8d156a9f0e53e17fe342a9cb528513236ef8f
nir/lower_non_uniform: Better handle non-derefs

In particular, if we have an index or bindless handle we were passing
the original handle which, technically, is uniform within the context of
the if.  However, we can save the back-end compiler some effort if we
pass it the result of the read_first_invocation().

(Rebased by Kenneth Graunke and Rhys Perry.)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7592>
src/compiler/nir/nir_lower_non_uniform_access.c