aco: create acq+rel barriers instead of acq/rel
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 22 Jul 2020 10:47:20 +0000 (11:47 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Jul 2020 16:56:34 +0000 (16:56 +0000)
NIR doesn't have atomic loads/stores, so we have to workaround that with
this for dEQP-VK.memory_model.* to pass.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

src/amd/compiler/aco_instruction_selection.cpp

index 100837bb98c392fbcadeae953dfdc78039806418..0a92788567a80382161667f5bcdfd7da002c6aa2 100644 (file)
@@ -6759,9 +6759,9 @@ void emit_memory_barrier(isel_context *ctx, nir_intrinsic_instr *instr) {
 
          unsigned nir_semantics = nir_intrinsic_memory_semantics(instr);
          if (nir_semantics & NIR_MEMORY_ACQUIRE)
 
          unsigned nir_semantics = nir_intrinsic_memory_semantics(instr);
          if (nir_semantics & NIR_MEMORY_ACQUIRE)
-            semantics |= semantic_acquire;
+            semantics |= semantic_acquire | semantic_release;
          if (nir_semantics & NIR_MEMORY_RELEASE)
          if (nir_semantics & NIR_MEMORY_RELEASE)
-            semantics |= semantic_release;
+            semantics |= semantic_acquire | semantic_release;
 
          assert(!(nir_semantics & (NIR_MEMORY_MAKE_AVAILABLE | NIR_MEMORY_MAKE_VISIBLE)));
 
 
          assert(!(nir_semantics & (NIR_MEMORY_MAKE_AVAILABLE | NIR_MEMORY_MAKE_VISIBLE)));