From d8440a3d2f4fb8a0b816c8e0884738de9797f09d Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Wed, 8 Jan 2020 13:30:43 -0800 Subject: [PATCH] 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: --- src/compiler/spirv/spirv_to_nir.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) { -- 2.30.2