zink: handle stencil_fallback in zink_clear_depth_stencil

ctx->blitting will already be set at this point, meaning the flag
should not be modified and no barriers are required

fixes stencil blitting on nvk

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27735>
This commit is contained in:
Mike Blumenkrantz 2024-02-21 12:03:12 -05:00 committed by Marge Bot
parent e3d4897dfe
commit ac45d893d6

View file

@ -644,6 +644,8 @@ zink_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *dst,
bool render_condition_enabled)
{
struct zink_context *ctx = zink_context(pctx);
/* check for stencil fallback */
bool blitting = ctx->blitting;
zink_flush_dgc_if_enabled(ctx);
bool render_condition_active = ctx->render_condition_active;
if (!render_condition_enabled && render_condition_active) {
@ -656,14 +658,16 @@ zink_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *dst,
dsty + height > ctx->fb_state.height)
cur_attachment = false;
if (!cur_attachment) {
util_blitter_save_framebuffer(ctx->blitter, &ctx->fb_state);
set_clear_fb(pctx, NULL, dst);
zink_blit_barriers(ctx, NULL, zink_resource(dst->texture), false);
ctx->blitting = true;
if (!blitting) {
util_blitter_save_framebuffer(ctx->blitter, &ctx->fb_state);
set_clear_fb(pctx, NULL, dst);
zink_blit_barriers(ctx, NULL, zink_resource(dst->texture), false);
ctx->blitting = true;
}
}
struct pipe_scissor_state scissor = {dstx, dsty, dstx + width, dsty + height};
pctx->clear(pctx, clear_flags, &scissor, NULL, depth, stencil);
if (!cur_attachment) {
if (!cur_attachment && !blitting) {
util_blitter_restore_fb_state(ctx->blitter);
ctx->blitting = false;
}