From 7486aaa1c0ea8dda75ecddf631ebab9064d2b161 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 21 Feb 2024 16:33:39 -0500 Subject: [PATCH] zink: make readback attempts count towards ZINK_READBACK_THRESHOLD readback is readback even if the app is being "smart" (swapchain readback is never smart) Part-of: --- src/gallium/drivers/zink/zink_kopper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c index b094aa4922b..6bac2be9341 100644 --- a/src/gallium/drivers/zink/zink_kopper.c +++ b/src/gallium/drivers/zink/zink_kopper.c @@ -867,6 +867,8 @@ zink_kopper_acquire_readback(struct zink_context *ctx, struct zink_resource *res uint32_t last_dt_idx = res->obj->last_dt_idx; VkResult ret = VK_SUCCESS; + if (++cdt->readback_counter >= ZINK_READBACK_THRESHOLD) + kopper_ensure_readback(screen, res); /* if this hasn't been presented or if it has data, use this as the readback target */ if (res->obj->last_dt_idx == UINT32_MAX || (res->obj->dt_idx != UINT32_MAX && cdt->swapchain->images[res->obj->dt_idx].age)) { @@ -885,8 +887,6 @@ zink_kopper_acquire_readback(struct zink_context *ctx, struct zink_resource *res return false; } } - if (++cdt->readback_counter >= ZINK_READBACK_THRESHOLD) - kopper_ensure_readback(screen, res); while (res->obj->dt_idx != last_dt_idx) { cdt->age_locked = true; if (res->obj->dt_idx != UINT32_MAX && !zink_kopper_present_readback(ctx, res))