Otherwise a scoped memory barrier containing nir_var_mem_ubo (which
memoryBarrier() does lower to) would incorrectly prevent the
optimization to happen in UBOs.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5980>
if (nir_intrinsic_memory_scope(intrin) == NIR_SCOPE_NONE)
break;
- modes = nir_intrinsic_memory_modes(intrin);
+ modes = nir_intrinsic_memory_modes(intrin) & (nir_var_mem_ssbo |
+ nir_var_mem_shared |
+ nir_var_mem_global);
acquire = nir_intrinsic_memory_semantics(intrin) & NIR_MEMORY_ACQUIRE;
release = nir_intrinsic_memory_semantics(intrin) & NIR_MEMORY_RELEASE;
switch (nir_intrinsic_memory_scope(intrin)) {