zink: sync queries at the end of cmdbufs

with tc, query results can be fetched async, and it's impossible to
sync tc in this scenario. to avoid needing to sync when a sync is not
possible, sync ahead of time in all cases

Fixes: 7c96e98975 ("zink: always start/stop/resume queries inside renderpasses")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22827>
This commit is contained in:
Mike Blumenkrantz
2023-05-03 10:39:55 -04:00
committed by Marge Bot
parent 738c2eacf3
commit 2e3ce614b9
3 changed files with 17 additions and 1 deletions
+5
View File
@@ -684,6 +684,11 @@ zink_end_batch(struct zink_context *ctx, struct zink_batch *batch)
if (screen->device_lost)
return;
if (ctx->tc) {
set_foreach(&bs->active_queries, entry)
zink_query_sync(ctx, (void*)entry->key);
}
if (screen->threaded_submit) {
util_queue_add_job(&screen->flush_queue, bs, &bs->flush_completed,
submit_queue, post_submit, 0);
+10 -1
View File
@@ -1106,8 +1106,10 @@ zink_get_query_result(struct pipe_context *pctx,
return result->b;
}
if (query->needs_update)
if (query->needs_update) {
assert(!ctx->tc || !threaded_query(q)->flushed);
update_qbo(ctx, query);
}
if (zink_batch_usage_is_unflushed(query->batch_uses)) {
if (!threaded_query(q)->flushed)
@@ -1251,6 +1253,13 @@ zink_set_active_query_state(struct pipe_context *pctx, bool enable)
zink_resume_queries(ctx, batch);
}
void
zink_query_sync(struct zink_context *ctx, struct zink_query *query)
{
if (query->needs_update)
update_qbo(ctx, query);
}
void
zink_start_conditional_render(struct zink_context *ctx)
{
+2
View File
@@ -46,6 +46,8 @@ zink_resume_cs_query(struct zink_context *ctx);
void
zink_prune_query(struct zink_batch_state *bs, struct zink_query *query);
void
zink_query_sync(struct zink_context *ctx, struct zink_query *query);
void
zink_query_update_gs_states(struct zink_context *ctx);