aux/tc: fix renderpass tracking fb state clobber scenario

in a stream like:
* set fb state (A)
* flush
* set fb state (B)
* draw -> driver query
* flush

the "driver query" should return the tc info corresponding to the most
recent fb state (B). previously this would increment to C because
the flag for incrementing at the start of a batch was set

Fixes: 07017aa137 ("util/tc: implement renderpass tracking")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25206>
(cherry picked from commit 9399165bd4)
This commit is contained in:
Mike Blumenkrantz 2023-09-11 09:41:37 -04:00 committed by Eric Engestrom
parent 282540ae9e
commit 84b7f700bb
2 changed files with 8 additions and 1 deletions

View file

@ -1975,7 +1975,7 @@
"description": "aux/tc: fix renderpass tracking fb state clobber scenario",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "07017aa137b9fa48ec25ef5d1e3fd2d137beb651"
},

View file

@ -1458,6 +1458,13 @@ tc_set_framebuffer_state(struct pipe_context *_pipe,
if (tc->options.parse_renderpass_info) {
/* ensure this is treated as the first fb set if no fb activity has occurred */
if (!tc->renderpass_info_recording->has_draw &&
!tc->renderpass_info_recording->cbuf_clear &&
!tc->renderpass_info_recording->cbuf_load &&
!tc->renderpass_info_recording->zsbuf_load &&
!tc->renderpass_info_recording->zsbuf_clear_partial)
tc->batch_slots[tc->next].first_set_fb = false;
/* store existing zsbuf data for possible persistence */
uint8_t zsbuf = tc->renderpass_info_recording->has_draw ?
0 :