diff --git a/.pick_status.json b/.pick_status.json index 1c5bea6a44b..3e12c076889 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1634,7 +1634,7 @@ "description": "zink: handle stencil_fallback in zink_clear_depth_stencil", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c index dc2ca1d1c11..c417b62c811 100644 --- a/src/gallium/drivers/zink/zink_clear.c +++ b/src/gallium/drivers/zink/zink_clear.c @@ -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; }