From 9482ad212dab3d1d138f80fd38da5b2bb861be12 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 26 Jun 2025 16:55:25 -0400 Subject: [PATCH] tc: don't reuse first rp info on batch if there is work pending MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this otherwise causes a mismatch if drivers try to access previous info during a set_framebuffer_state call (e.g., to flush clears) Acked-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_threaded_context.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 58ff1ab090e..f42ec1535b3 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1452,8 +1452,10 @@ tc_set_framebuffer_state(struct pipe_context *_pipe, { struct threaded_context *tc = threaded_context(_pipe); unsigned next = tc->next; - /* always skip incrementing if this is the first call on a batch */ - bool set_skip_first_increment = !tc->batch_slots[tc->next].num_total_slots; + /* always skip incrementing if this is the first call on a batch AND there is no pending work from previous batch */ + bool set_skip_first_increment = !tc->batch_slots[tc->next].num_total_slots && + (!tc->renderpass_info_recording || + !TC_RENDERPASS_INFO_HAS_WORK(tc->renderpass_info_recording->data32[0])); struct tc_framebuffer *p = tc_add_call_no_copy(tc, TC_CALL_set_framebuffer_state, tc_framebuffer); unsigned nr_cbufs = fb->nr_cbufs;