1 /* 2 * Copyright © 2022 Collabora, Ltd. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 * IN THE SOFTWARE. 22 */ 23 #ifndef VK_QUERY_POOL_H 24 #define VK_QUERY_POOL_H 25 26 #include "vk_object.h" 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 struct vk_query_pool { 33 struct vk_object_base base; 34 35 /** VkQueryPoolCreateInfo::queryType */ 36 VkQueryType query_type; 37 38 /** VkQueryPoolCreateInfo::queryCount */ 39 uint32_t query_count; 40 41 /** VkQueryPoolCreateInfo::pipelineStatistics 42 * 43 * If query_type != VK_QUERY_TYPE_PIPELINE_STATISTICS, this will be zero. 44 */ 45 VkQueryPipelineStatisticFlags pipeline_statistics; 46 }; 47 48 void vk_query_pool_init(struct vk_device *device, 49 struct vk_query_pool *query_pool, 50 const VkQueryPoolCreateInfo *pCreateInfo); 51 void vk_query_pool_finish(struct vk_query_pool *query_pool); 52 void *vk_query_pool_create(struct vk_device *device, 53 const VkQueryPoolCreateInfo *pCreateInfo, 54 const VkAllocationCallbacks *alloc, 55 size_t size); 56 void vk_query_pool_destroy(struct vk_device *device, 57 const VkAllocationCallbacks *alloc, 58 struct vk_query_pool *query_pool); 59 60 #ifdef __cplusplus 61 } 62 #endif 63 64 #endif /* VK_QUERY_POOL_H */ 65