diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2024-08-19 13:30:29 -0400 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2024-08-22 10:47:34 +0200 |
commit | 0f82e067417b419d5ccd96ad22e50b6e255f5051 (patch) | |
tree | 04aaaaf6b95e2dcab87cd4cc758691f3fdcf9db1 /src/gallium | |
parent | f79163d200d800c4f25b1615a7d071dce7f7a066 (diff) |
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>
(cherry picked from commit 2fa52bf6e5db5eab9af697ea67af506d7967dd31)
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/util/u_threaded_context.c | 20 |
1 files 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; + } + } } } |