aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2020-01-08 13:30:43 -0800
committerCaio Marcelo de Oliveira Filho <[email protected]>2020-01-14 14:42:12 -0800
commitd8440a3d2f4fb8a0b816c8e0884738de9797f09d (patch)
tree01708eba5181a68b7a77fa2b8105b7747c6381fc
parent1ec0d4fdffe772a33c46bb5620a8928233c345b1 (diff)
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 <id>" says UniformMemory Apply the memory-ordering constraints to StorageBuffer, PhysicalStorageBuffer, or Uniform Storage Class memory. Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3322>
-rw-r--r--src/compiler/spirv/spirv_to_nir.c8
1 files 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) {