}
static void
-unref_vk_pool(struct zink_screen *screen, struct zink_query_pool *pool)
+unref_vk_pool(struct zink_context *ctx, struct zink_query_pool *pool)
{
if (!pool || --pool->refcount)
return;
- VKSCR(DestroyQueryPool)(screen->dev, pool->query_pool, NULL);
+ VKCTX(DestroyQueryPool)(zink_screen(ctx->base.screen)->dev, pool->query_pool, NULL);
if (list_is_linked(&pool->list))
list_del(&pool->list);
FREE(pool);
}
static void
-unref_vk_query(struct zink_screen *screen, struct zink_vk_query *vkq)
+unref_vk_query(struct zink_context *ctx, struct zink_vk_query *vkq)
{
if (!vkq)
return;
- unref_vk_pool(screen, vkq->pool);
+ unref_vk_pool(ctx, vkq->pool);
vkq->refcount--;
if (vkq->refcount == 0)
FREE(vkq);
}
static void
-destroy_query(struct zink_screen *screen, struct zink_query *query)
+destroy_query(struct zink_context *ctx, struct zink_query *query)
{
+ struct zink_screen *screen = zink_screen(ctx->base.screen);
assert(zink_screen_usage_check_completion(screen, query->batch_uses));
struct zink_query_buffer *qbo, *next;
unsigned num_starts = query->starts.capacity / sizeof(struct zink_query_start);
for (unsigned j = 0; j < num_starts; j++) {
for (unsigned i = 0; i < PIPE_MAX_VERTEX_STREAMS; i++) {
- unref_vk_query(screen, starts[j].vkq[i]);
+ unref_vk_query(ctx, starts[j].vkq[i]);
}
}
vkq->query_id = pool->last_range;
}
- unref_vk_query(zink_screen(ctx->base.screen), start->vkq[i]);
+ unref_vk_query(ctx, start->vkq[i]);
start->vkq[i] = vkq;
}
}
}
return (struct pipe_query *)query;
fail:
- destroy_query(screen, query);
+ destroy_query(zink_context(pctx), query);
return NULL;
}
zink_destroy_query(struct pipe_context *pctx,
struct pipe_query *q)
{
- struct zink_screen *screen = zink_screen(pctx->screen);
struct zink_query *query = (struct zink_query *)q;
/* only destroy if this query isn't active on any batches,
return;
}
- destroy_query(screen, query);
+ destroy_query(zink_context(pctx), query);
}
void
return;
query->batch_uses = NULL;
if (query->dead)
- destroy_query(screen, query);
+ destroy_query(bs->ctx, query);
}
static void