Mesa (master): zink: set VK_IMAGE_LAYOUT_PRESENT_SRC_KHR on fb resources at eof flush

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 25 02:32:12 UTC 2021


Module: Mesa
Branch: master
Commit: 22fc869187e67e7c2a98529572ba22b7d4e667e6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=22fc869187e67e7c2a98529572ba22b7d4e667e6

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Oct  8 15:19:02 2020 -0400

zink: set VK_IMAGE_LAYOUT_PRESENT_SRC_KHR on fb resources at eof flush

this should maybe fix garbled images on amd?

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

---

 src/gallium/drivers/zink/zink_context.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index effeb05db36..684939db12e 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1361,6 +1361,14 @@ zink_flush(struct pipe_context *pctx,
    if (deferred)
       batch->fence->deferred_ctx = pctx;
    else if (batch->has_work) {
+      if (flags & PIPE_FLUSH_END_OF_FRAME) {
+         if (ctx->fb_state.nr_cbufs)
+            zink_end_render_pass(ctx, batch);
+         for (int i = 0; i < ctx->fb_state.nr_cbufs; i++)
+            zink_resource_image_barrier(ctx, batch,
+                                        ctx->fb_state.cbufs[i] ? zink_resource(ctx->fb_state.cbufs[i]->texture) : NULL,
+                                        VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, 0, 0);
+      }
       flush_batch(ctx);
 
       if (zink_screen(pctx->screen)->info.have_EXT_transform_feedback && ctx->num_so_targets)



More information about the mesa-commit mailing list