Skip to content
This repository was archived by the owner on May 21, 2023. It is now read-only.

Fix validation errors with VkQuery usage#11

Open
TLaviron wants to merge 1 commit intozeux:masterfrom
TLaviron:vulkan-validation-fix
Open

Fix validation errors with VkQuery usage#11
TLaviron wants to merge 1 commit intozeux:masterfrom
TLaviron:vulkan-validation-fix

Conversation

@TLaviron
Copy link
Copy Markdown

The spec requires that Vulkan queries are reset before first use and
between uses. The validation layers would report errors if Vulkan based
GPU timers were used.

The spec requires that Vulkan queries are reset before first use and
between uses. The validation layers would report errors if Vulkan based
GPU timers were used.
@zeux
Copy link
Copy Markdown
Owner

zeux commented Jan 15, 2022

It's been a while since I've seen this code. Can you explain why the order of query result retrieval and submission of the next frame was changed? fwiw I think the old order worked correctly with frame delay set to zero (even though that's not a recommended setup it's good to check for correctness) whereas this way it won't work.

@TLaviron
Copy link
Copy Markdown
Author

This will indeed not work with a frame delay of 0. I changed the order so that I do not need to create another command buffer per frame to reset the queries.
I just found out that there is a host command to reset queries, but it requires both enabling the associated feature, and either Vulkan1.2 or the associated extension VK_EXT_host_query_reset, so I don't think its a good idea to use it.

If you would rather preserve the original order and use two command buffers per flip (one to insert the reference timestamp, one to reset queries for the next frame), I can go this way instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants