From 767ef6e02e06f379ce2aab6172b7b60eaf45ff0e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 8 Mar 2023 12:13:05 -0500 Subject: [PATCH] aux/tc: flag late zs clears as partial clears MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this ensures drivers can't optimize out a zs attachment that gets a late clear Fixes: 07017aa137b ("util/tc: implement renderpass tracking") Acked-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_threaded_context.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index bb4f849160b..78e46e208b2 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -4379,8 +4379,13 @@ tc_clear(struct pipe_context *_pipe, unsigned buffers, const struct pipe_scissor if (info) { /* full clears use a different load operation, but are only valid if draws haven't occurred yet */ info->cbuf_clear |= (buffers >> 2) & ~info->cbuf_load; - if (buffers & PIPE_CLEAR_DEPTHSTENCIL && !info->zsbuf_load && !info->zsbuf_clear_partial) - info->zsbuf_clear = true; + if (buffers & PIPE_CLEAR_DEPTHSTENCIL) { + if (!info->zsbuf_load && !info->zsbuf_clear_partial) + info->zsbuf_clear = true; + else if (!info->zsbuf_clear) + /* this is a clear that occurred after a draw: flag as partial to ensure it isn't ignored */ + info->zsbuf_clear_partial = true; + } } } p->scissor_state_set = !!scissor_state;