From 68a631947f417d7b19e8b80e30f0e98284b12ef0 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 21 Aug 2024 11:14:29 -0400 Subject: [PATCH] tc: optimize out tracked winsys resolves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drivers using renderpass tracking can rely on having pipe_framebuffer_state::resolve + tc_info::has_resolve to indicate a winsys blit, which means they don't actually need the blit call Acked-by: Marek Olšák Part-of: --- .../auxiliary/util/u_threaded_context.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 38a78c83a85..9c11604b462 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -4532,24 +4532,27 @@ static void tc_blit(struct pipe_context *_pipe, const struct pipe_blit_info *info) { struct threaded_context *tc = threaded_context(_pipe); - tc_blit_enqueue(tc, info); /* filter out untracked non-resolves */ if (!tc->options.parse_renderpass_info || info->src.resource->nr_samples <= 1 || - info->dst.resource->nr_samples > 1) + info->dst.resource->nr_samples > 1) { + tc_blit_enqueue(tc, info); return; + } if (tc->fb_resolve == info->dst.resource) { + /* optimize out this blit entirely */ 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; - } + return; + } + 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; } } + tc_blit_enqueue(tc, info); } struct tc_generate_mipmap {