From 53c4ce495ccb11afc8d1f66d893238fb17e5488c Mon Sep 17 00:00:00 2001 From: WebsterEndymion <1030210852@qq.com> Date: Sat, 10 Dec 2022 11:12:58 +0000 Subject: [PATCH] zink: add a condition to needs_write_s Previously missing check on the stencil write, condition added to needs_write_s using util_writes_stencil Part-of: --- src/gallium/drivers/zink/zink_render_pass.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_render_pass.c b/src/gallium/drivers/zink/zink_render_pass.c index 45100b828d6..91629fa4e2d 100644 --- a/src/gallium/drivers/zink/zink_render_pass.c +++ b/src/gallium/drivers/zink/zink_render_pass.c @@ -366,7 +366,8 @@ zink_init_zs_attachment(struct zink_context *ctx, struct zink_rt_attrib *rt) needs_write_z |= transient || rt->clear_color || (zink_fb_clear_enabled(ctx, PIPE_MAX_COLOR_BUFS) && (zink_fb_clear_element(fb_clear, 0)->zs.bits & PIPE_CLEAR_DEPTH)); - bool needs_write_s = rt->clear_stencil || (outputs_written & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) || + bool needs_write_s = (ctx->dsa_state && (util_writes_stencil(&ctx->dsa_state->base.stencil[0]) || util_writes_stencil(&ctx->dsa_state->base.stencil[1]))) || + rt->clear_stencil || (outputs_written & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) || (zink_fb_clear_enabled(ctx, PIPE_MAX_COLOR_BUFS) && (zink_fb_clear_element(fb_clear, 0)->zs.bits & PIPE_CLEAR_STENCIL)); rt->needs_write = needs_write_z | needs_write_s; rt->invalid = !zsbuf->valid;