zink: reapply zsbuf state after unordered blits

this otherwise creates desync if a renderpass continues after blit reordering

cc: mesa-stable

(cherry picked from commit 43a6928d62)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40488>
This commit is contained in:
Mike Blumenkrantz 2026-03-11 11:29:59 -04:00 committed by Eric Engestrom
parent 641b7710e9
commit 58950e2d06
2 changed files with 5 additions and 1 deletions

View file

@ -1984,7 +1984,7 @@
"description": "zink: reapply zsbuf state after unordered blits",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -491,6 +491,8 @@ zink_blit(struct pipe_context *pctx,
if (whole)
pctx->invalidate_resource(pctx, info->dst.resource);
bool zsbuf_unused = ctx->zsbuf_unused;
bool zsbuf_readonly = ctx->zsbuf_readonly;
ctx->unordered_blitting = !(info->render_condition_enable && ctx->render_condition_active) &&
!needs_present_readback &&
zink_get_cmdbuf(ctx, src, dst) == ctx->bs->reordered_cmdbuf;
@ -571,6 +573,8 @@ zink_blit(struct pipe_context *pctx,
ctx->gfx_pipeline_state.pipeline = pipeline;
ctx->pipeline_changed[ZINK_PIPELINE_GFX] = true;
ctx->ds3_states = ds3_states;
ctx->zsbuf_readonly = zsbuf_readonly;
ctx->zsbuf_unused = zsbuf_unused;
zink_select_draw_vbo(ctx);
}
ctx->unordered_blitting = false;