glsl: add can_remove_uniform() helper to the NIR linker
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 28 May 2020 01:08:42 +0000 (11:08 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 3 Jun 2020 02:22:23 +0000 (02:22 +0000)
commit60bee4c70c0d956ecdcae542a515f3e3a4ee328c
treebef7f496538c64ae72f47849047c00154311142c
parent04dbf709edf069bc720d941fab27c53269336bcf
glsl: add can_remove_uniform() helper to the NIR linker

This helper reflects the rules we follow in the GLSL IR linker when
deciding if we can remove a dead uniform. This check is required to
avoid regressions when turning on NIR dead uniform clean up in the
following patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4797>
src/compiler/glsl/gl_nir_linker.c