From: Caio Marcelo de Oliveira Filho Date: Wed, 8 Jan 2020 21:30:43 +0000 (-0800) Subject: spirv: Handle PhysicalStorageBuffer in memory barriers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d8440a3d2f4fb8a0b816c8e0884738de9797f09d;p=mesa.git spirv: Handle PhysicalStorageBuffer in memory barriers PhysicalStorageBuffer is lowered to nir_var_mem_global, and SPIR-V 1.5rev1 in section "3.25. Memory Semantics " says UniformMemory Apply the memory-ordering constraints to StorageBuffer, PhysicalStorageBuffer, or Uniform Storage Class memory. Reviewed-by: Jason Ekstrand Part-of: --- diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 9337482e30f..dd53cee3be6 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -2101,8 +2101,12 @@ vtn_emit_scoped_memory_barrier(struct vtn_builder *b, SpvScope scope, nir_variable_mode modes = 0; if (semantics & (SpvMemorySemanticsUniformMemoryMask | - SpvMemorySemanticsImageMemoryMask)) - modes |= nir_var_mem_ubo | nir_var_mem_ssbo | nir_var_uniform; + SpvMemorySemanticsImageMemoryMask)) { + modes |= nir_var_uniform | + nir_var_mem_ubo | + nir_var_mem_ssbo | + nir_var_mem_global; + } if (semantics & SpvMemorySemanticsWorkgroupMemoryMask) modes |= nir_var_mem_shared; if (semantics & SpvMemorySemanticsOutputMemoryMask) {