zink: check ctx batch states first when finding a usable one

this ensures the completed ones get queued for recycling faster

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37068>
This commit is contained in:
Mike Blumenkrantz 2025-08-26 13:48:21 -04:00 committed by Marge Bot
parent 067873d4a4
commit d1f8cd54f4

View file

@ -481,13 +481,13 @@ get_batch_state(struct zink_context *ctx)
if (bs == ctx->last_free_batch_state)
ctx->last_free_batch_state = NULL;
}
/* try from the ones that are given back to the screen next */
if (!bs)
bs = find_screen_state(screen, ctx);
/* always try to recycle ctx states first */
if (!bs)
bs = find_completed_batch_state(ctx);
if (!bs)
bs = find_screen_state(screen, ctx);
if (bs) {
bs->next = NULL;
} else {