Mesa (main): zink: update push descriptor set anytime fbfetch changes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 31 19:56:28 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Jul 27 14:03:50 2021 -0400

zink: update push descriptor set anytime fbfetch changes

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

---

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

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index e00398eea1e..e7b4a088b09 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1479,14 +1479,19 @@ zink_update_fbfetch(struct zink_context *ctx)
       ctx->di.fbfetch.imageView = zink_screen(ctx->base.screen)->info.rb2_feats.nullDescriptor ?
                                   VK_NULL_HANDLE :
                                   zink_surface(ctx->dummy_surface)->image_view;
+      zink_screen(ctx->base.screen)->context_invalidate_descriptor_state(ctx, PIPE_SHADER_FRAGMENT, ZINK_DESCRIPTOR_TYPE_UBO, 0, 1);
       return;
    }
 
+   bool changed = !had_fbfetch;
    if (ctx->fb_state.cbufs[0]) {
       VkImageView fbfetch = zink_surface(ctx->fb_state.cbufs[0])->image_view;
+      changed |= fbfetch != ctx->di.fbfetch.imageView;
       ctx->di.fbfetch.imageView = zink_surface(ctx->fb_state.cbufs[0])->image_view;
    }
    ctx->di.fbfetch.imageLayout = VK_IMAGE_LAYOUT_GENERAL;
+   if (changed)
+      zink_screen(ctx->base.screen)->context_invalidate_descriptor_state(ctx, PIPE_SHADER_FRAGMENT, ZINK_DESCRIPTOR_TYPE_UBO, 0, 1);
 }
 
 static uint32_t



More information about the mesa-commit mailing list