diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h index 68e24e4d041..cb925f1f5d0 100644 --- a/src/gallium/drivers/zink/zink_context.h +++ b/src/gallium/drivers/zink/zink_context.h @@ -289,6 +289,7 @@ struct zink_context { struct list_head suspended_queries; struct list_head primitives_generated_queries; + struct zink_query *vertices_query; bool queries_disabled, render_condition_active; struct { struct zink_query *query; diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index f4f2e43eea5..1376a74c913 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -686,6 +686,10 @@ begin_query(struct zink_context *ctx, struct zink_batch *batch, struct zink_quer } if (q->vkqtype != VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT) VKCTX(CmdBeginQuery)(batch->state->cmdbuf, q->query_pool, q->curr_query, flags); + if (q->type == PIPE_QUERY_PIPELINE_STATISTICS_SINGLE && q->index == PIPE_STAT_QUERY_IA_VERTICES) { + assert(!ctx->vertices_query); + ctx->vertices_query = q; + } if (needs_stats_list(q)) list_addtail(&q->stats_list, &ctx->primitives_generated_queries); zink_batch_usage_set(&q->batch_id, batch->state); @@ -749,6 +753,10 @@ end_query(struct zink_context *ctx, struct zink_batch *batch, struct zink_query if (q->vkqtype != VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT && !is_time_query(q)) VKCTX(CmdEndQuery)(batch->state->cmdbuf, q->query_pool, q->curr_query); + if (q->type == PIPE_QUERY_PIPELINE_STATISTICS_SINGLE && + q->index == PIPE_STAT_QUERY_IA_VERTICES) + ctx->vertices_query = NULL; + if (needs_stats_list(q)) list_delinit(&q->stats_list);