Mesa (main): zink: only do swapchain update during fb setup if swapchain is active
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Apr 11 04:12:45 UTC 2022
Module: Mesa
Branch: main
Commit: 7744a477e8e3996f14f0d181c2bd4cfe9557f4fc
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7744a477e8e3996f14f0d181c2bd4cfe9557f4fc
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Thu Apr 7 17:06:17 2022 -0400
zink: only do swapchain update during fb setup if swapchain is active
otherwise this explodes blitter operations
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15809>
---
src/gallium/drivers/zink/zink_context.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 4db31249d26..bd0f02677f5 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -2194,16 +2194,18 @@ setup_framebuffer(struct zink_context *ctx)
}
ctx->rp_changed = false;
+ bool has_swapchain = false;
for (unsigned i = 0; i < ctx->fb_state.nr_cbufs; i++) {
if (!ctx->fb_state.cbufs[i])
continue;
struct zink_resource *res = zink_resource(ctx->fb_state.cbufs[i]->texture);
if (res->obj->dt) {
+ has_swapchain = true;
zink_kopper_acquire(ctx, res, UINT64_MAX);
zink_surface_swapchain_update(ctx, zink_csurface(ctx->fb_state.cbufs[i]));
}
}
- if (ctx->swapchain_size.width || ctx->swapchain_size.height) {
+ if (has_swapchain && (ctx->swapchain_size.width || ctx->swapchain_size.height)) {
unsigned old_w = ctx->fb_state.width;
unsigned old_h = ctx->fb_state.height;
ctx->fb_state.width = ctx->swapchain_size.width;
More information about the mesa-commit
mailing list