Lines Matching defs:qpool

45 dzn_query_pool_get_query_type(const struct dzn_query_pool *qpool,
48 switch (qpool->heap_type) {
59 dzn_query_pool_destroy(struct dzn_query_pool *qpool,
62 if (!qpool)
65 struct dzn_device *device = container_of(qpool->base.device, struct dzn_device, vk);
67 if (qpool->collect_map)
68 ID3D12Resource_Unmap(qpool->collect_buffer, 0, NULL);
70 if (qpool->collect_buffer)
71 ID3D12Resource_Release(qpool->collect_buffer);
73 if (qpool->resolve_buffer)
74 ID3D12Resource_Release(qpool->resolve_buffer);
76 if (qpool->heap)
77 ID3D12QueryHeap_Release(qpool->heap);
79 for (uint32_t q = 0; q < qpool->query_count; q++) {
80 if (qpool->queries[q].fence)
81 ID3D12Fence_Release(qpool->queries[q].fence);
84 mtx_destroy(&qpool->queries_lock);
85 vk_object_base_finish(&qpool->base);
86 vk_free2(&device->vk.alloc, alloc, qpool);
96 VK_MULTIALLOC_DECL(&ma, struct dzn_query_pool, qpool, 1);
103 vk_object_base_init(&device->vk, &qpool->base, VK_OBJECT_TYPE_QUERY_POOL);
105 mtx_init(&qpool->queries_lock, mtx_plain);
106 qpool->query_count = info->queryCount;
107 qpool->queries = queries;
110 qpool->heap_type = desc.Type = dzn_query_pool_get_heap_type(info->queryType);
117 (void **)&qpool->heap);
119 dzn_query_pool_destroy(qpool, alloc);
126 qpool->query_size = sizeof(uint64_t);
129 qpool->pipeline_statistics = info->pipelineStatistics;
130 qpool->query_size = sizeof(D3D12_QUERY_DATA_PIPELINE_STATISTICS);
140 .Width = info->queryCount * qpool->query_size,
156 (void **)&qpool->resolve_buffer);
158 dzn_query_pool_destroy(qpool, alloc);
164 rdesc.Width = info->queryCount * (qpool->query_size + sizeof(uint64_t));
171 (void **)&qpool->collect_buffer);
173 dzn_query_pool_destroy(qpool, alloc);
177 hres = ID3D12Resource_Map(qpool->collect_buffer, 0, NULL, (void **)&qpool->collect_map);
179 dzn_query_pool_destroy(qpool, alloc);
183 memset(qpool->collect_map, 0, rdesc.Width);
185 *out = dzn_query_pool_to_handle(qpool);
190 dzn_query_pool_get_result_offset(const struct dzn_query_pool *qpool, uint32_t query)
192 return query * qpool->query_size;
196 dzn_query_pool_get_result_size(const struct dzn_query_pool *qpool, uint32_t query_count)
198 return query_count * qpool->query_size;
202 dzn_query_pool_get_availability_offset(const struct dzn_query_pool *qpool, uint32_t query)
204 return (qpool->query_count * qpool->query_size) + (sizeof(uint64_t) * query);
231 VK_FROM_HANDLE(dzn_query_pool, qpool, queryPool);
233 mtx_lock(&qpool->queries_lock);
235 struct dzn_query *query = &qpool->queries[firstQuery + q];
243 mtx_lock(&qpool->queries_lock);
245 memset((uint8_t *)qpool->collect_map + dzn_query_pool_get_result_offset(qpool, firstQuery),
246 0, queryCount * qpool->query_size);
247 memset((uint8_t *)qpool->collect_map + dzn_query_pool_get_availability_offset(qpool, firstQuery),
261 VK_FROM_HANDLE(dzn_query_pool, qpool, queryPool);
268 struct dzn_query *query = &qpool->queries[q + firstQuery];
272 (uint8_t *)qpool->collect_map +
273 dzn_query_pool_get_result_offset(qpool, firstQuery + q);
281 mtx_lock(&qpool->queries_lock);
287 mtx_unlock(&qpool->queries_lock);
303 mtx_lock(&qpool->queries_lock);
309 mtx_unlock(&qpool->queries_lock);
318 if (qpool->heap_type != D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS) {
327 if (!(BITFIELD_BIT(c) & qpool->pipeline_statistics))