From 2fa52bf6e5db5eab9af697ea67af506d7967dd31 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 19 Aug 2024 13:30:29 -0400 Subject: [PATCH] tc: set resolve on renderpass info if blit terminates the renderpass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this avoids a scenario where invalidate happens after a non-winsys blit for a renderpass and the driver skips storing framebuffer contents because the invalidate flag is set cc: mesa-stable Acked-by: Marek Olšák Part-of: --- .../auxiliary/util/u_threaded_context.c | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 715e1b0338f..6f6ae039bd1 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -4527,10 +4527,22 @@ tc_blit(struct pipe_context *_pipe, const struct pipe_blit_info *info) tc_set_resource_batch_usage(tc, info->src.resource); tc_set_resource_reference(&blit->info.src.resource, info->src.resource); memcpy(&blit->info, info, sizeof(*info)); - if (tc->options.parse_renderpass_info) { - tc->renderpass_info_recording->has_resolve = info->src.resource->nr_samples > 1 && - info->dst.resource->nr_samples <= 1 && - tc->fb_resolve == info->dst.resource; + + /* filter out untracked non-resolves */ + if (!tc->options.parse_renderpass_info || + info->src.resource->nr_samples <= 1 || + info->dst.resource->nr_samples > 1) + return; + + if (tc->fb_resolve == info->dst.resource) { + tc->renderpass_info_recording->has_resolve = true; + } else { + for (unsigned i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { + if (tc->fb_resources[i] == info->src.resource) { + tc->renderpass_info_recording->has_resolve = true; + break; + } + } } }