From 3fac6fa023c422d58fe309df0aef2ed7f634dcde 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: (cherry picked from commit 81dd39de0198d1cd4497c7553da5e2347528e2a2) --- .pick_status.json | 2 +- src/gallium/auxiliary/util/u_threaded_context.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 87312777bb8..461d46d5684 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2234,7 +2234,7 @@ "description": "aux/tc: fix rp info handling around tc_sync calls", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "07017aa137b9fa48ec25ef5d1e3fd2d137beb651", "notes": null diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 0e949823f03..a396324396d 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; }