zink: disable fbfetch when flushing clears

this ensures there's no weird perf happening, avoids using renderpass
instead of dynamic rendering, and avoids hitting an assert from broken
framebuffer construction

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19065>
(cherry picked from commit d3880a6324)
This commit is contained in:
Mike Blumenkrantz
2022-10-13 16:35:22 -04:00
committed by Dylan Baker
parent 266850c3f5
commit ab1dffa8f7
2 changed files with 11 additions and 2 deletions

View File

@@ -715,7 +715,7 @@
"description": "zink: disable fbfetch when flushing clears",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@@ -3400,9 +3400,18 @@ zink_flush(struct pipe_context *pctx,
unsigned submit_count = 0;
/* triggering clears will force has_work */
if (!deferred && ctx->clears_enabled)
if (!deferred && ctx->clears_enabled) {
/* if fbfetch outputs are active, disable them when flushing clears */
unsigned fbfetch_outputs = ctx->fbfetch_outputs;
if (fbfetch_outputs) {
ctx->fbfetch_outputs = 0;
ctx->rp_changed = true;
}
/* start rp to do all the clears */
zink_batch_rp(ctx);
ctx->fbfetch_outputs = fbfetch_outputs;
ctx->rp_changed |= fbfetch_outputs > 0;
}
if (ctx->needs_present && (flags & PIPE_FLUSH_END_OF_FRAME)) {
if (ctx->needs_present->obj->image)