From 81dd39de0198d1cd4497c7553da5e2347528e2a2 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 14 Sep 2023 11:40:29 -0400 Subject: [PATCH] aux/tc: fix rp info handling around tc_sync calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if a set_framebuffer_state call has occurred but no draws have been triggered, the rp info must be preserved for the driver to (eventually) use after the sync Fixes: 07017aa137b ("util/tc: implement renderpass tracking") Acked-by: Marek Olšák Reviewed-by: Dave Airlie Part-of: --- src/gallium/auxiliary/util/u_threaded_context.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 3423a8ea89b..9a3d85fb895 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -695,8 +695,13 @@ _tc_sync(struct threaded_context *tc, UNUSED const char *info, UNUSED const char if (tc->options.parse_renderpass_info) { int renderpass_info_idx = next->renderpass_info_idx; if (renderpass_info_idx > 0) { + /* don't reset if fb state is unflushed */ + bool fb_no_draw = tc->seen_fb_state && !tc->renderpass_info_recording->has_draw; + uint32_t fb_info = tc->renderpass_info_recording->data32[0]; next->renderpass_info_idx = -1; tc_batch_increment_renderpass_info(tc, tc->next, false); + if (fb_no_draw) + tc->renderpass_info_recording->data32[0] = fb_info; } else if (tc->renderpass_info_recording->has_draw) { tc->renderpass_info_recording->data32[0] = 0; }