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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13491>
(cherry picked from commit dabe477b4f)
This commit is contained in:
Mike Blumenkrantz 2021-10-22 14:24:48 -04:00 committed by Dylan Baker
parent eadc3eca00
commit 34ddc2a5b5
2 changed files with 1 additions and 5 deletions

View file

@ -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
},

View file

@ -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 {