summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2021-04-08 13:42:46 -0400
committerMarge Bot <eric+marge@anholt.net>2021-05-10 01:02:22 +0000
commit5ac6c70214dc664238cc1fefcd42d5b2f0b3b30d (patch)
tree419684f77f5d974ec2728fc966981ee8e02ee86a
parent94aeb1041f8c8a80d06bbbecedc5890954da311a (diff)
zink: break zs clear loop once both bits are set when beginning renderpass
no point in looping this any more than we have to Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10705>
-rw-r--r--src/gallium/drivers/zink/zink_context.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 6da5d1b3dd0..899761814c0 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1188,7 +1188,9 @@ zink_begin_render_pass(struct zink_context *ctx, struct zink_batch *batch)
assert(ctx->framebuffer->rp->state.clears);
}
if (zink_fb_clear_needs_explicit(fb_clear)) {
- for (int j = !zink_fb_clear_element_needs_explicit(clear); j < zink_fb_clear_count(fb_clear); j++)
+ for (int j = !zink_fb_clear_element_needs_explicit(clear);
+ (clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL && j < zink_fb_clear_count(fb_clear);
+ j++)
clear_buffers |= zink_fb_clear_element(fb_clear, j)->zs.bits;
}
}