From 829b3c0106eb230eeb995e22ddb00383f12374f7 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:12:00 -0600 Subject: [PATCH] vulkan: Add common vkCmdBegin/EndQuery wrappers These are identical to the IndexedEXT versions with index == 0. Reviewed-by: Samuel Pitoiset Part-of: --- src/vulkan/runtime/vk_query_pool.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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); +} -- 2.7.4