From 34ddc2a5b59c78bb1032f54e0a100ff55239ecdf Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 22 Oct 2021 14:24:48 -0400 Subject: [PATCH] zink: don't break early when applying fb clears a resource can be bound to multiple fb attachments, each with its own clear, so ensure that all of these are applied fixes #5542 cc: mesa-stable Reviewed-by: Dave Airlie Part-of: (cherry picked from commit dabe477b4f273964afedab2fce2be22f2617268f) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_clear.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 8ebde23fc76..5e5ae3fbf57 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -382,7 +382,7 @@ "description": "zink: don't break early when applying fb clears", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c index 09be568af58..f7fcb613f61 100644 --- a/src/gallium/drivers/zink/zink_clear.c +++ b/src/gallium/drivers/zink/zink_clear.c @@ -596,7 +596,6 @@ zink_fb_clears_apply(struct zink_context *ctx, struct pipe_resource *pres) for (int i = 0; i < ctx->fb_state.nr_cbufs; i++) { if (ctx->fb_state.cbufs[i] && ctx->fb_state.cbufs[i]->texture == pres) { fb_clears_apply_internal(ctx, pres, i); - return; } } } else { @@ -614,7 +613,6 @@ zink_fb_clears_discard(struct zink_context *ctx, struct pipe_resource *pres) if (ctx->fb_state.cbufs[i] && ctx->fb_state.cbufs[i]->texture == pres) { if (zink_fb_clear_enabled(ctx, i)) { zink_fb_clear_reset(ctx, i); - return; } } } @@ -688,7 +686,6 @@ zink_fb_clears_apply_or_discard(struct zink_context *ctx, struct pipe_resource * for (int i = 0; i < ctx->fb_state.nr_cbufs; i++) { if (ctx->fb_state.cbufs[i] && ctx->fb_state.cbufs[i]->texture == pres) { fb_clears_apply_or_discard_internal(ctx, pres, region, discard_only, false, i); - return; } } } else { @@ -705,7 +702,6 @@ zink_fb_clears_apply_region(struct zink_context *ctx, struct pipe_resource *pres for (int i = 0; i < ctx->fb_state.nr_cbufs; i++) { if (ctx->fb_state.cbufs[i] && ctx->fb_state.cbufs[i]->texture == pres) { fb_clears_apply_or_discard_internal(ctx, pres, region, false, true, i); - return; } } } else {