zink: unset primgen suspended flag when ending a primgen query

this otherwise could result in rast-discard being permanently enabled
in certain corner cases

Fixes: 7f956435a0 ("zink: rework xfb queries for drivers with poor primgen support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24676>
(cherry picked from commit 4f743df4f0)
This commit is contained in:
Mike Blumenkrantz 2023-08-14 14:25:35 -04:00 committed by Eric Engestrom
parent 19d2cdcf38
commit b761892f43
2 changed files with 8 additions and 1 deletions

View file

@ -679,7 +679,7 @@
"description": "zink: unset primgen suspended flag when ending a primgen query",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "7f956435a039f4729c776a0172bffe7c8b6207b7"
},

View file

@ -1048,6 +1048,10 @@ zink_end_query(struct pipe_context *pctx,
/* FIXME: this can be called from a thread, but it needs to write to the cmdbuf */
threaded_context_unwrap_sync(pctx);
bool unset_null_fs = query->type == PIPE_QUERY_PRIMITIVES_GENERATED && (ctx->primitives_generated_suspended || ctx->primitives_generated_active);
if (query->type == PIPE_QUERY_PRIMITIVES_GENERATED)
ctx->primitives_generated_suspended = false;
if (list_is_linked(&query->stats_list))
list_delinit(&query->stats_list);
if (query->suspended) {
@ -1072,6 +1076,9 @@ zink_end_query(struct pipe_context *pctx,
end_query(ctx, batch, query);
}
if (unset_null_fs)
zink_set_color_write_enables(ctx);
return true;
}