2 * Copyrigh 2016 Red Hat Inc.
4 * Copyright © 2015 Intel Corporation
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
32 #include "tu_private.h"
33 #include "nir/nir_builder.h"
36 tu_CreateQueryPool(VkDevice _device
,
37 const VkQueryPoolCreateInfo
*pCreateInfo
,
38 const VkAllocationCallbacks
*pAllocator
,
39 VkQueryPool
*pQueryPool
)
41 TU_FROM_HANDLE(tu_device
, device
, _device
);
42 struct tu_query_pool
*pool
= vk_alloc2(&device
->alloc
,
46 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT
);
49 return vk_error(device
->instance
, VK_ERROR_OUT_OF_HOST_MEMORY
);
51 *pQueryPool
= tu_query_pool_to_handle(pool
);
56 tu_DestroyQueryPool(VkDevice _device
,
58 const VkAllocationCallbacks
*pAllocator
)
60 TU_FROM_HANDLE(tu_device
, device
, _device
);
61 TU_FROM_HANDLE(tu_query_pool
, pool
, _pool
);
66 vk_free2(&device
->alloc
, pAllocator
, pool
);
70 tu_GetQueryPoolResults(VkDevice _device
,
71 VkQueryPool queryPool
,
77 VkQueryResultFlags flags
)
83 tu_CmdCopyQueryPoolResults(VkCommandBuffer commandBuffer
,
84 VkQueryPool queryPool
,
88 VkDeviceSize dstOffset
,
90 VkQueryResultFlags flags
)
95 tu_CmdResetQueryPool(VkCommandBuffer commandBuffer
,
96 VkQueryPool queryPool
,
103 tu_CmdBeginQuery(VkCommandBuffer commandBuffer
,
104 VkQueryPool queryPool
,
106 VkQueryControlFlags flags
)
111 tu_CmdEndQuery(VkCommandBuffer commandBuffer
,
112 VkQueryPool queryPool
,
118 tu_CmdWriteTimestamp(VkCommandBuffer commandBuffer
,
119 VkPipelineStageFlagBits pipelineStage
,
120 VkQueryPool queryPool
,