From d3880a632456879a1c06320879aa684c1886f438 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 13 Oct 2022 16:35:22 -0400 Subject: [PATCH] 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: --- src/gallium/drivers/zink/zink_context.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index b24f5fe8ccf..ef0325f9399 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3597,9 +3597,18 @@ zink_flush(struct pipe_context *pctx, VkSemaphore export_sem = VK_NULL_HANDLE; /* 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)