zink: store vertices statistics query to context

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15401>
This commit is contained in:
Mike Blumenkrantz
2022-03-08 17:39:40 -05:00
committed by Marge Bot
parent c36f3f2db8
commit d25437d54f
2 changed files with 9 additions and 0 deletions

View File

@@ -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;

View File

@@ -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);