From d1e30ca120a3f94ec9c70e1feee7b1cd36e86c99 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 13 May 2021 18:16:47 -0400 Subject: [PATCH] zink: immediately return false when getting query result if it's not gonna happen this is a small optimization for the no-wait case when unflushed usage exists since it's impossible for a qbo update to happen instantly no functionality will be fixed by this, it's just a very minor optimization Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_query.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index e14a58edbbd..f6cda574724 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -780,8 +780,12 @@ zink_get_query_result(struct pipe_context *pctx, if (query->needs_update) update_qbo(ctx, query); - if (!threaded_query(q)->flushed && query->batch_id.usage == ctx->curr_batch) - pctx->flush(pctx, NULL, 0); + if (query->batch_id.usage == ctx->curr_batch) { + if (!threaded_query(q)->flushed) + pctx->flush(pctx, NULL, 0); + if (!wait) + return false; + } return get_query_result(pctx, q, wait, result); }