Mesa (staging/22.1): zink: don't short-circuit gfx stage finding during barrier generation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 20 01:14:50 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: 7ef27bec10fd3bcc11e3cd6403b1db47e2f5bf9a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7ef27bec10fd3bcc11e3cd6403b1db47e2f5bf9a

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Sat Jun 18 09:48:51 2022 -0400

zink: don't short-circuit gfx stage finding during barrier generation

according to spec, all stages must be specified, not just the first one

Acked-by: Dave Airlie <airlied at redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>

---

 src/gallium/drivers/zink/zink_draw.cpp | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp
index 9a61b93f51c..6f62d07a25b 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -323,15 +323,29 @@ draw(struct zink_context *ctx,
    }
 }
 
+/*
+   If a synchronization command includes a source stage mask, its first synchronization scope only
+   includes execution of the pipeline stages specified in that mask, and its first access scope only
+   includes memory accesses performed by pipeline stages specified in that mask.
+
+   If a synchronization command includes a destination stage mask, its second synchronization scope
+   only includes execution of the pipeline stages specified in that mask, and its second access scope
+   only includes memory access performed by pipeline stages specified in that mask.
+
+   - Chapter 7. Synchronization and Cache Control
+
+ * thus, all stages must be added to ensure accurate synchronization
+ */
 ALWAYS_INLINE static VkPipelineStageFlags
 find_pipeline_bits(uint32_t *mask)
 {
+   VkPipelineStageFlags pipeline = 0;
    for (unsigned i = 0; i < ZINK_SHADER_COUNT; i++) {
       if (mask[i]) {
-         return zink_pipeline_flags_from_pipe_stage((enum pipe_shader_type)i);
+         pipeline |= zink_pipeline_flags_from_pipe_stage((enum pipe_shader_type)i);
       }
    }
-   return 0;
+   return pipeline;
 }
 
 static void



More information about the mesa-commit mailing list