tu,lvp: fix load_helper_invocation not being lowered
nir_lower_is_helper_invocation
lowers intrinsic_is_helper_invocation
and uses load_helper_invocation
(which is lowered by nir_lower_system_values
).
While nir_lower_system_values
may lower SYSTEM_VALUE_HELPER_INVOCATION
into intrinsic_is_helper_invocation
.
So they depend on each other. Break the dependency by making nir_lower_is_helper_invocation aware of lower_helper_invocation option and emitting lowered load_helper_invocation when required.
Happens with SPIR-V 1.6 for which gl_HelperInvocation
is translated into
"BuiltIn HelperInvocation" + "Volatile", which nir_lower_system_values
translates into is_helper_invocation
.