From 69cacebd29a234e6af10de1d9c21d20a6a750bf5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 14 Aug 2023 13:04:34 -0400 Subject: [PATCH] zink: track start/stop of a couple query types Part-of: --- src/gallium/drivers/zink/zink_query.c | 10 ++++++++++ src/gallium/drivers/zink/zink_types.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index 08cc34d..cb8461f 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -961,6 +961,11 @@ zink_begin_query(struct pipe_context *pctx, /* drop all past results */ reset_qbo(query); + if (query->vkqtype == VK_QUERY_TYPE_OCCLUSION) + ctx->occlusion_query_active = true; + if (query->type == PIPE_QUERY_PIPELINE_STATISTICS_SINGLE && query->index == PIPE_STAT_QUERY_PS_INVOCATIONS) + ctx->fs_query_active = true; + query->predicate_dirty = true; util_dynarray_clear(&query->starts); @@ -1056,6 +1061,11 @@ 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); + if (query->vkqtype == VK_QUERY_TYPE_OCCLUSION) + ctx->occlusion_query_active = true; + if (query->type == PIPE_QUERY_PIPELINE_STATISTICS_SINGLE && query->index == PIPE_STAT_QUERY_PS_INVOCATIONS) + ctx->fs_query_active = true; + if (list_is_linked(&query->stats_list)) list_delinit(&query->stats_list); if (query->suspended) { diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index 99c91ac..c28d833 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -1881,6 +1881,8 @@ struct zink_context { struct zink_query *vertices_query; bool disable_color_writes; bool was_line_loop; + bool fs_query_active; + bool occlusion_query_active; bool primitives_generated_active; bool primitives_generated_suspended; bool queries_disabled, render_condition_active; -- 2.7.4