xref: /aosp_15_r20/external/mesa3d/src/virtio/vulkan/vn_query_pool.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright 2019 Google LLC
3  * SPDX-License-Identifier: MIT
4  *
5  * based in part on anv and radv which are:
6  * Copyright © 2015 Intel Corporation
7  * Copyright © 2016 Red Hat.
8  * Copyright © 2016 Bas Nieuwenhuizen
9  */
10 
11 #ifndef VN_QUERY_POOL_H
12 #define VN_QUERY_POOL_H
13 
14 #include "vn_common.h"
15 
16 struct vn_feedback_buffer;
17 
18 struct vn_query_pool {
19    struct vn_object_base base;
20 
21    VkAllocationCallbacks allocator;
22 
23    uint32_t query_count;
24    /* synchronize lazy init of qfb buffer */
25    simple_mtx_t mutex;
26    /* non-NULL if VN_PERF_NO_QUERY_FEEDBACK is disabled */
27    struct vn_feedback_buffer *fb_buf;
28    uint32_t result_array_size;
29    bool saturate_on_overflow;
30 };
31 VK_DEFINE_NONDISP_HANDLE_CASTS(vn_query_pool,
32                                base.base,
33                                VkQueryPool,
34                                VK_OBJECT_TYPE_QUERY_POOL)
35 
36 VkResult
37 vn_query_feedback_buffer_init_once(struct vn_device *dev,
38                                    struct vn_query_pool *pool);
39 
40 #endif /* VN_QUERY_POOL_H */
41