From 8fb83c0935948c3bf0717e0a3d9ea3ba4cdf4f6c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 21 Feb 2024 16:38:02 -0500 Subject: [PATCH] zink: only update swapchain readback cache on create if necessary minor optimization Part-of: --- src/gallium/drivers/zink/zink_kopper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c index 04a6b1eba54..933d1493212 100644 --- a/src/gallium/drivers/zink/zink_kopper.c +++ b/src/gallium/drivers/zink/zink_kopper.c @@ -877,7 +877,7 @@ zink_kopper_acquire_readback(struct zink_context *ctx, struct zink_resource *res VkResult ret = VK_SUCCESS; if (++cdt->readback_counter >= ZINK_READBACK_THRESHOLD) { - if (kopper_ensure_readback(screen, res)) + if (kopper_ensure_readback(screen, res) && cswap->images[res->obj->dt_idx].readback_needs_update) zink_kopper_readback_update(ctx, res); } /* if this hasn't been presented or if it has data, use this as the readback target */