nir: Handle volatile semantics for loading HelperInvocation builtin
authorCaio Oliveira <caio.oliveira@intel.com>
Wed, 15 Sep 2021 22:38:23 +0000 (15:38 -0700)
committerCaio Oliveira <caio.oliveira@intel.com>
Sat, 18 Dec 2021 00:37:14 +0000 (16:37 -0800)
commit729df14e4528b70e63332e4255571729253e9791
treef375619699670f8211ba3588274dd7c128da3211
parent49e0dd6d426a3605ee511f5029b6a3711721b413
nir: Handle volatile semantics for loading HelperInvocation builtin

SPV_EXT_demote_to_helper_invocation added OpDemoteToHelperInvocation
operation to turn an invocation into a helper invocation, but the
value of HelperInvocation (a builtin from Input storage class)
couldn't be modified dynamically without breaking compatibility.

For the extension the operation OpIsHelperInvocation was added to get
the dynamic value.

For SPIR-V 1.6, the demote operation was promoted, but now to get the
dynamic value the shader must issue a load to HelperInvocation with
Volatile memory access semantics.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14209>
src/compiler/nir/nir_lower_system_values.c