From 3488dc7dd0f2f9c11f384aed16fbecefcd472e4e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 6 Jul 2022 08:29:30 -0400 Subject: [PATCH] zink: improve zink_clear_depth_stencil check for current attachment this is technically more correct since it accounts for multi-context usage Acked-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_clear.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c index 3b4d97631fe..e6927b13c3f 100644 --- a/src/gallium/drivers/zink/zink_clear.c +++ b/src/gallium/drivers/zink/zink_clear.c @@ -534,8 +534,9 @@ zink_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *dst, struct u_rect rect = {dstx, dstx + width, dsty, dsty + height}; bool needs_rp = !zink_blit_region_fills(rect, dst->texture->width0, dst->texture->height0); needs_rp |= check_3d_layers(dst); + bool cur_attachment = zink_csurface(ctx->fb_state.zsbuf) == zink_csurface(dst); bool render_condition_active = ctx->render_condition_active; - if (res->fb_binds) { //current depth attachment + if (cur_attachment) { //current depth attachment struct pipe_scissor_state scissor = {dstx, dsty, dstx + width, dsty + height}; if (!render_condition_enabled && render_condition_active) { zink_stop_conditional_render(ctx);