spirv: make OpLoad/OpStore visibility/availablity barriers acquire/release
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 27 Jul 2020 13:51:57 +0000 (14:51 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 17:15:22 +0000 (17:15 +0000)
I think these are needed to order the visibility/availability operation
with the access.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

src/compiler/spirv/vtn_variables.c

index fa78f80459483930b5f3605b4025ff440c4e6177..a8dfcd8e933892f3b1ad1535383fdf47ebdd4d1a 100644 (file)
@@ -2620,6 +2620,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
       if (access & SpvMemoryAccessMakePointerVisibleMask) {
          SpvMemorySemanticsMask semantics =
             SpvMemorySemanticsMakeVisibleMask |
+            SpvMemorySemanticsAcquireMask |
             vtn_mode_to_memory_semantics(src->mode);
          vtn_emit_memory_barrier(b, scope, semantics);
       }
@@ -2669,6 +2670,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
       if (access & SpvMemoryAccessMakePointerAvailableMask) {
          SpvMemorySemanticsMask semantics =
             SpvMemorySemanticsMakeAvailableMask |
+            SpvMemorySemanticsReleaseMask |
             vtn_mode_to_memory_semantics(dest->mode);
          vtn_emit_memory_barrier(b, scope, semantics);
       }