tc: optimize out tracked winsys resolves

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 <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30772>
This commit is contained in:
Mike Blumenkrantz
2024-08-21 11:14:29 -04:00
committed by Marge Bot
parent 3b198d5392
commit 68a631947f

View File

@@ -4532,24 +4532,27 @@ static void
tc_blit(struct pipe_context *_pipe, const struct pipe_blit_info *info) tc_blit(struct pipe_context *_pipe, const struct pipe_blit_info *info)
{ {
struct threaded_context *tc = threaded_context(_pipe); struct threaded_context *tc = threaded_context(_pipe);
tc_blit_enqueue(tc, info);
/* filter out untracked non-resolves */ /* filter out untracked non-resolves */
if (!tc->options.parse_renderpass_info || if (!tc->options.parse_renderpass_info ||
info->src.resource->nr_samples <= 1 || info->src.resource->nr_samples <= 1 ||
info->dst.resource->nr_samples > 1) info->dst.resource->nr_samples > 1) {
tc_blit_enqueue(tc, info);
return; return;
}
if (tc->fb_resolve == info->dst.resource) { if (tc->fb_resolve == info->dst.resource) {
/* optimize out this blit entirely */
tc->renderpass_info_recording->has_resolve = true; tc->renderpass_info_recording->has_resolve = true;
} else { return;
for (unsigned i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { }
if (tc->fb_resources[i] == info->src.resource) { for (unsigned i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
tc->renderpass_info_recording->has_resolve = true; if (tc->fb_resources[i] == info->src.resource) {
break; tc->renderpass_info_recording->has_resolve = true;
} break;
} }
} }
tc_blit_enqueue(tc, info);
} }
struct tc_generate_mipmap { struct tc_generate_mipmap {