From c962980725ba857f9c065831afd2586786887aca Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 12 Mar 2021 09:00:16 -0500 Subject: [PATCH] zink: remove explicit fencing for query results now that the results are automatically being copied to internal buffers, mapping the buffers will handle any fencing that's required the only caveat is that the query still needs to be flushed for a result to be returned Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_query.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index dd9e6a2..26b60ec 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -479,13 +479,10 @@ force_cpu_read(struct zink_context *ctx, struct pipe_query *pquery, enum pipe_qu unsigned result_size = result_type <= PIPE_QUERY_TYPE_U32 ? sizeof(uint32_t) : sizeof(uint64_t); struct zink_query *query = (struct zink_query*)pquery; union pipe_query_result result; - uint32_t batch_id = p_atomic_read(&query->batch_id.usage); if (query->needs_update) update_qbo(ctx, query); - zink_wait_on_batch(ctx, batch_id); - bool success = get_query_result(pctx, pquery, true, &result); if (!success) { debug_printf("zink: getting query result failed\n"); @@ -752,13 +749,12 @@ zink_get_query_result(struct pipe_context *pctx, { struct zink_query *query = (void*)q; struct zink_context *ctx = zink_context(pctx); - uint32_t batch_id = p_atomic_read(&query->batch_id.usage); if (query->needs_update) update_qbo(ctx, query); - if (wait) - zink_wait_on_batch(ctx, batch_id); + if (query->batch_id.usage == ctx->curr_batch) + pctx->flush(pctx, NULL, 0); return get_query_result(pctx, q, wait, result); } -- 2.7.4