To end a query after the set of desired draw or dispatch commands is executed, call:
void vkCmdEndQuery( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query);
commandBufferis the command buffer into which this command will be recorded.
queryPoolis the query pool that is managing the results of the query.
queryis the query index within the query pool where the result is stored.
vkCmdEndQuery is equivalent to calling
vkCmdEndQueryIndexedEXT with the
index parameter set to zero.
As queries operate asynchronously, ending a query does not immediately set the query’s status to available. A query is considered finished when the final results of the query are ready to be retrieved by vkGetQueryPoolResults and vkCmdCopyQueryPoolResults, and this is when the query’s status is set to available.
Once a query is ended the query must finish in finite time, unless the state of the query is changed using other commands, e.g. by issuing a reset of the query.
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.
Copyright (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.