Mesa (main): zink: only do deferred image barriers if layout changes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 24 23:23:49 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Apr  9 10:30:49 2021 -0400

zink: only do deferred image barriers if layout changes

otherwise these should be handled by apps using glMemoryBarrier

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11590>

---

 src/gallium/drivers/zink/zink_draw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_draw.c b/src/gallium/drivers/zink/zink_draw.c
index 36bd7329e04..793c60b0793 100644
--- a/src/gallium/drivers/zink/zink_draw.c
+++ b/src/gallium/drivers/zink/zink_draw.c
@@ -377,7 +377,8 @@ update_barriers(struct zink_context *ctx, bool is_compute)
             zink_resource_buffer_barrier(ctx, NULL, res, access, pipeline);
          else {
             VkImageLayout layout = zink_descriptor_util_image_layout_eval(res, is_compute);
-            zink_resource_image_barrier(ctx, NULL, res, layout, access, pipeline);
+            if (layout != res->layout)
+               zink_resource_image_barrier(ctx, NULL, res, layout, access, pipeline);
          }
          /* always barrier on draw if this resource has either multiple image write binds or
           * image write binds and image read binds



More information about the mesa-commit mailing list