From 86752ce4e8668dd897423ad64fa470d49d12e416 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 15 Jan 2026 17:28:03 -0500 Subject: [PATCH] zink: create new transient image if the sample count doesn't match otherwise this will keep reusing the previous transient cc: mesa-stable (cherry picked from commit 9fd8041d247daccfe26e4097c8a0346fe358b37c) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_surface.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 191b0c24642..c0e448b8a2f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -734,7 +734,7 @@ "description": "zink: create new transient image if the sample count doesn't match", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_surface.c b/src/gallium/drivers/zink/zink_surface.c index 415af721e19..f2d205c961c 100644 --- a/src/gallium/drivers/zink/zink_surface.c +++ b/src/gallium/drivers/zink/zink_surface.c @@ -291,7 +291,7 @@ zink_create_transient_surface(struct zink_context *ctx, const struct pipe_surfac struct zink_resource *res = zink_resource(psurf->texture); struct zink_resource *transient = res->transient; assert(nr_samples > 1); - if (!res->transient) { + if (!res->transient || res->transient->base.b.nr_samples != nr_samples) { /* transient fb attachment: not cached */ struct pipe_resource rtempl = *psurf->texture; rtempl.nr_samples = nr_samples; @@ -299,6 +299,7 @@ zink_create_transient_surface(struct zink_context *ctx, const struct pipe_surfac rtempl.bind |= ZINK_BIND_TRANSIENT; if (zink_format_needs_mutable(rtempl.format, psurf->format)) rtempl.bind |= ZINK_BIND_MUTABLE; + zink_resource_reference(&res->transient, NULL); res->transient = zink_resource(ctx->base.screen->resource_create(ctx->base.screen, &rtempl)); transient = res->transient; if (unlikely(!transient)) {