diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index 5713ff2f719..59bc5757f58 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -468,8 +468,6 @@ query_pool_get_range(struct zink_context *ctx, struct zink_query *q) vkq->pool->refcount++; } else { struct zink_query_pool *pool = find_or_allocate_qp(ctx, q, pool_idx); - pool->refcount++; - pool->last_range++; if (pool->last_range == NUM_QUERIES) { list_del(&pool->list); pool = find_or_allocate_qp(ctx, q, pool_idx); @@ -480,12 +478,12 @@ query_pool_get_range(struct zink_context *ctx, struct zink_query *q) return; } + pool->refcount++; vkq->refcount = 1; vkq->needs_reset = true; vkq->pool = pool; vkq->started = false; - vkq->query_id = pool->last_range; - + vkq->query_id = pool->last_range++; } unref_vk_query(ctx, start->vkq[i]); start->vkq[i] = vkq;