Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using get_query_pool_results with vk::QueryResultFlags::WITH_AVAILABILITY flag #900

Closed
YouSafe opened this issue Mar 31, 2024 · 3 comments
Closed

Comments

@YouSafe
Copy link

YouSafe commented Mar 31, 2024

Currently get_query_pool_results assumes a stride of mem::size_of::<T>() as _, however, when using vk::QueryResultFlags::WITH_AVAILABILITY the stride should I think be double that to account for the availability bit.

@YouSafe
Copy link
Author

YouSafe commented Mar 31, 2024

This also holds for the VK_QUERY_RESULT_WITH_STATUS_BIT_KHR flag.

See note from the specification:

Note: If VK_QUERY_RESULT_WITH_AVAILABILITY_BIT or VK_QUERY_RESULT_WITH_STATUS_BIT_KHR is set, the layout of data in the buffer is a (result,availability) or (result,status) pair for each query returned, and stride is the stride between each pair.

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetQueryPoolResults.html#_description

@MarijnS95
Copy link
Collaborator

@YouSafe we've covered this in #100 (comment), #639 (comment) and #644: use a tuple (or likewise repr(C) type) to receive the boolean. The advantage is that the T type immediately incorporates the status or availability bit (how else would you receive that with this function, otherwise?).

Closing as duplicate.

@MarijnS95 MarijnS95 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 31, 2024
@YouSafe
Copy link
Author

YouSafe commented Mar 31, 2024

I incorrectly assumed that T should only be a primitive such as u32 or u64, when a pair would also work and provide the correct stride.

Apologies for this oversight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants