From: Faith Ekstrand Date: Tue, 31 Jan 2023 02:12:00 +0000 (-0600) Subject: vulkan: Add common vkCmdBegin/EndQuery wrappers X-Git-Tag: upstream/23.3.3~4907 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=829b3c0106eb230eeb995e22ddb00383f12374f7;p=platform%2Fupstream%2Fmesa.git vulkan: Add common vkCmdBegin/EndQuery wrappers These are identical to the IndexedEXT versions with index == 0. Reviewed-by: Samuel Pitoiset Part-of: --- diff --git a/src/vulkan/runtime/vk_query_pool.c b/src/vulkan/runtime/vk_query_pool.c index 4a4b73a..4ab3b90 100644 --- a/src/vulkan/runtime/vk_query_pool.c +++ b/src/vulkan/runtime/vk_query_pool.c @@ -23,6 +23,10 @@ #include "vk_query_pool.h" +#include "vk_command_buffer.h" +#include "vk_common_entrypoints.h" +#include "vk_device.h" + void * vk_query_pool_create(struct vk_device *device, const VkQueryPoolCreateInfo *pCreateInfo, @@ -53,3 +57,28 @@ vk_query_pool_destroy(struct vk_device *device, { vk_object_free(device, alloc, query_pool); } + +VKAPI_ATTR void VKAPI_CALL +vk_common_CmdBeginQuery(VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t query, + VkQueryControlFlags flags) +{ + VK_FROM_HANDLE(vk_command_buffer, cmd_buffer, commandBuffer); + const struct vk_device_dispatch_table *disp = + &cmd_buffer->base.device->dispatch_table; + + disp->CmdBeginQueryIndexedEXT(commandBuffer, queryPool, query, flags, 0); +} + +VKAPI_ATTR void VKAPI_CALL +vk_common_CmdEndQuery(VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t query) +{ + VK_FROM_HANDLE(vk_command_buffer, cmd_buffer, commandBuffer); + const struct vk_device_dispatch_table *disp = + &cmd_buffer->base.device->dispatch_table; + + disp->CmdEndQueryIndexedEXT(commandBuffer, queryPool, query, 0); +}