zink: track start/stop of a couple query types

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24676>
This commit is contained in:
Mike Blumenkrantz 2023-08-14 13:04:34 -04:00 committed by Marge Bot
parent da5ca7529f
commit 69cacebd29
2 changed files with 12 additions and 0 deletions

View file

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

View file

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