zink: add a fixup case for readonly zsbuf clears

this shouldn't currently be possible to hit, but in the future it may

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
This commit is contained in:
Mike Blumenkrantz
2023-03-17 12:55:00 -04:00
committed by Marge Bot
parent e2e079eef4
commit 93d7bde9dc

View File

@@ -199,8 +199,14 @@ zink_clear(struct pipe_context *pctx,
}
if (batch->in_rp) {
clear_in_rp(pctx, buffers, scissor_state, pcolor, depth, stencil);
return;
if (buffers & PIPE_CLEAR_DEPTHSTENCIL && (!zink_is_zsbuf_used(ctx) || ctx->zsbuf_readonly)) {
/* this will need a layout change */
assert(!zink_screen(ctx->base.screen)->driver_workarounds.track_renderpasses);
zink_batch_no_rp(ctx);
} else {
clear_in_rp(pctx, buffers, scissor_state, pcolor, depth, stencil);
return;
}
}
unsigned rp_clears_enabled = ctx->rp_clears_enabled;