From 4f743df4f00a346a14edaccda35e035e5224233c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 14 Aug 2023 14:25:35 -0400 Subject: [PATCH] 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: 7f956435a03 ("zink: rework xfb queries for drivers with poor primgen support") Part-of: --- src/gallium/drivers/zink/zink_query.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index cb8461fa375..132eaa04023 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -1066,6 +1066,10 @@ zink_end_query(struct pipe_context *pctx, if (query->type == PIPE_QUERY_PIPELINE_STATISTICS_SINGLE && query->index == PIPE_STAT_QUERY_PS_INVOCATIONS) ctx->fs_query_active = true; + 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) { @@ -1090,6 +1094,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; }