tc: set resolve on renderpass info if blit terminates the renderpass

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 <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30750>
This commit is contained in:
Mike Blumenkrantz 2024-08-19 13:30:29 -04:00 committed by Marge Bot
parent 38f4501a5c
commit 2fa52bf6e5

View file

@ -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;
}
}
}
}