diff --git a/.pick_status.json b/.pick_status.json index 99c70029b6b..db856f673ae 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -724,7 +724,7 @@ "description": "zink: pass ctx through query destroy paths", "nominated": false, "nomination_type": null, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index 86da0160c6f..ee8e931f28a 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -383,30 +383,31 @@ fail: } 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; @@ -414,7 +415,7 @@ destroy_query(struct zink_screen *screen, struct zink_query *query) 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]); } } @@ -482,7 +483,7 @@ query_pool_get_range(struct zink_context *ctx, struct zink_query *q) 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; } } @@ -534,7 +535,7 @@ zink_create_query(struct pipe_context *pctx, } return (struct pipe_query *)query; fail: - destroy_query(screen, query); + destroy_query(zink_context(pctx), query); return NULL; } @@ -542,7 +543,6 @@ static void 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, @@ -553,7 +553,7 @@ zink_destroy_query(struct pipe_context *pctx, return; } - destroy_query(screen, query); + destroy_query(zink_context(pctx), query); } void @@ -563,7 +563,7 @@ zink_prune_query(struct zink_screen *screen, struct zink_batch_state *bs, struct return; query->batch_uses = NULL; if (query->dead) - destroy_query(screen, query); + destroy_query(bs->ctx, query); } static void