KhronosGroup / Vulkan-ValidationLayers

Vulkan Validation Layers (VVL)
https://vulkan.lunarg.com/doc/sdk/latest/linux/khronos_validation_layer.html
Other
727 stars 396 forks source link

Incorrect message/handling of VUID-vkCmdBeginQuery-None-00807 #8211

Open jeroenbakker-atmind opened 1 week ago

jeroenbakker-atmind commented 1 week ago

Environment:

Describe the Issue

When using vkCmdBeginQuery on a just created pool (VK_QUERY_TYPE_OCCLUSION) without VK_EXT_host_query_reset/hostQueryReset=false. the VUID-vkCmdBeginQuery-None-00807 is raised. In the vulkan specification the description of this error is All queries used by the command must be unavailable. However the actual message currently shown is

VUID-vkCmdBeginQuery-None-00807(ERROR / SPEC): msgNum: 680962600 - Validation Error: [ VUID-vkCmdBeginQuery-None-00807 ] Object 0: handle = 0x7fff5bc4ec40, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xc6745600000013fb, type = VK_OBJECT_TYPE_QUERY_POOL; | MessageID = 0x2896aa28 | vkCmdBeginQuery(): VkQueryPool 0xc6745600000013fb[] and query 0: query not reset. After query pool creation, each query must be reset before it is used. Queries must also be reset between uses. The Vulkan spec states: All queries used by the command must be unavailable (https://vulkan.lunarg.com/doc/view/1.3.283.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdBeginQuery-None-00807).

Resetting the state of the queries seems onlyu possible by enabling the VK_EXT_host_query_reset extension/feature and calling vkResetQueryPool. Which seems like a bit strange as it makes occlusion queries unusable without this extension/feature.

Expected behavior

I am not sure if this is a false positive, or that the documentation is unclear what the minimum setup of using occlusion queries is. But I expected that all values where unavailable.

Additional context

spencer-lunarg commented 6 days ago

@jeroenbakker-atmind the idea is you need to go

vkCmdResetQueryPool();
vkCmdBeginQuery()

Resetting the state of the queries seems onlyu possible by enabling the VK_EXT_host_query_reset extension/feature and calling vkResetQueryPool

so there is a vkCmdResetQueryPool ... I guess a simple improvement would to say that more clearly in the error message

jeroenbakker-atmind commented 6 days ago

Ah will check on Monday. Might be that I misread the specs. 'each query' might point into a certain direction in the message.

jeroenbakker-atmind commented 4 days ago

I retested and of course there was an error on our side. Thanks for pointing it out! The validation is correct, the message can be improved a bit to point the developer into the right direction as you already stated.

spencer-lunarg commented 3 days ago

I have said it and will say again - A bad validation error message IS a bug ... please feel free to open issues or ping me anytime