Module: Mesa
Branch: main
Commit: 3bd9fcfa3d322b76d2e4e0b0a00691f8274b99ef
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3bd9fcfa3d322b76d2e4e0b0a00691f8274b99ef

Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Apr  8 10:26:37 2022 -0400

zink: don't rely on implicit access for generated barriers

compute shaders will get this wrong, so calculate access manually
using binding info

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15827>

---

 src/gallium/drivers/zink/zink_draw.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_draw.cpp 
b/src/gallium/drivers/zink/zink_draw.cpp
index 7dde95a0719..f79f13f1046 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -402,6 +402,11 @@ update_barriers(struct zink_context *ctx, bool is_compute)
             if (res->image_bind_count[is_compute] != 
res->bind_count[is_compute] ||
                 res->write_bind_count[is_compute] != 
res->image_bind_count[is_compute])
                access |= VK_ACCESS_SHADER_READ_BIT;
+         } else {
+            if (res->bind_count[is_compute] != 
res->write_bind_count[is_compute])
+               access |= VK_ACCESS_SHADER_READ_BIT;
+            if (res->write_bind_count[is_compute])
+               access |= VK_ACCESS_SHADER_WRITE_BIT;
          }
          if (is_compute)
             pipeline = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;

Reply via email to