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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10796>
This commit is contained in:
Mike Blumenkrantz 2021-05-13 18:16:47 -04:00 committed by Marge Bot
parent cf3f17a643
commit d1e30ca120

View file

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