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
23 * DEALINGS IN THE SOFTWARE.
26 #include "tu_private.h"
34 #include "nir/nir_builder.h"
37 tu_CreateQueryPool(VkDevice _device
,
38 const VkQueryPoolCreateInfo
*pCreateInfo
,
39 const VkAllocationCallbacks
*pAllocator
,
40 VkQueryPool
*pQueryPool
)
42 TU_FROM_HANDLE(tu_device
, device
, _device
);
43 struct tu_query_pool
*pool
=
44 vk_alloc2(&device
->alloc
, pAllocator
, sizeof(*pool
), 8,
45 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT
);
48 return vk_error(device
->instance
, VK_ERROR_OUT_OF_HOST_MEMORY
);
50 *pQueryPool
= tu_query_pool_to_handle(pool
);
55 tu_DestroyQueryPool(VkDevice _device
,
57 const VkAllocationCallbacks
*pAllocator
)
59 TU_FROM_HANDLE(tu_device
, device
, _device
);
60 TU_FROM_HANDLE(tu_query_pool
, pool
, _pool
);
65 vk_free2(&device
->alloc
, pAllocator
, pool
);
69 tu_GetQueryPoolResults(VkDevice _device
,
70 VkQueryPool queryPool
,
76 VkQueryResultFlags flags
)
82 tu_CmdCopyQueryPoolResults(VkCommandBuffer commandBuffer
,
83 VkQueryPool queryPool
,
87 VkDeviceSize dstOffset
,
89 VkQueryResultFlags flags
)
94 tu_CmdResetQueryPool(VkCommandBuffer commandBuffer
,
95 VkQueryPool queryPool
,
102 tu_CmdBeginQuery(VkCommandBuffer commandBuffer
,
103 VkQueryPool queryPool
,
105 VkQueryControlFlags flags
)
110 tu_CmdEndQuery(VkCommandBuffer commandBuffer
,
111 VkQueryPool queryPool
,
117 tu_CmdWriteTimestamp(VkCommandBuffer commandBuffer
,
118 VkPipelineStageFlagBits pipelineStage
,
119 VkQueryPool queryPool
,