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

calibrated_timestamps example error in vkGetCalibratedTimestampsEXT parameters #874

Open
robertosfield opened this issue Jan 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@robertosfield
Copy link

While working on testing calibrated timestamps I came across the timestamps example and on code review spotted a inconsistency in the code vs the specs for the VK_EXT_calibrated_timestamps docs.

The problem lines of code are (https://github.com/KhronosGroup/Vulkan-Samples/blob/main/samples/extensions/calibrated_timestamps/calibrated_timestamps.cpp#L827) :

	// Get calibrated timestamps:
		return vkGetCalibratedTimestampsEXT(get_device().get_handle(), static_cast<uint32_t>(time_domains.size()), timestamps_info.data(), timestamps.data(), max_deviations.data());

The max_deviations is initialized like it's a vector that is the same size of timestamps and as if it'll all be filled in, but the docs for vkGetCalibratedTimestampsEXT suggest a pointer to a uin64_t is required, not a vector<uint64_t>, docs on method:

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetCalibratedTimestampsEXT.html

// Provided by VK_EXT_calibrated_timestamps
VkResult vkGetCalibratedTimestampsEXT(
    VkDevice                                    device,
    uint32_t                                    timestampCount,
    const VkCalibratedTimestampInfoKHR*         pTimestampInfos,
    uint64_t*                                   pTimestamps,
    uint64_t*  

Later parameters is described as:

pMaxDeviation is a pointer to a 64-bit unsigned integer value in which the strictly positive maximum deviation, in nanoseconds, of the calibrated timestamp values is returned.

It looks to me like the code needs to be reorganized a little to pass a pointer to a single value rather than a vector.

@SaschaWillems SaschaWillems added the bug Something isn't working label Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants