-
Notifications
You must be signed in to change notification settings - Fork 905
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
Timestamps need to be in nanoseconds #3741
Comments
I'm honestly not convinced that this is something we should require this on native. We need the functionality in wgpu-core so moz can implement it for WebGPU, but on native, "compute shader injection" isn't going to sit terribly well with our users. |
To note - this get_timestamp_period was specifically designed to work fine with the WebGPU model as well while giving us a overhead free version on native (webgpu always reports 1). Honestly I don't get why the committee settled on this rather silly (imo) design. |
Oh I see, though this is just an artifact of how things developed over time. Isn't this also an issue for correctly implementing the webgpu native header correctly? Not a hill I'll die on as I wouldn't want to volunteer for that compute shader either 😄 |
No matter what, wgpu-core needs to implement this in resolve, if only for the needs of firefox and maybe wgpu-native. I'm basically of the mind where if there is an api we can design that allows our native users to not have to suffer the consequences of interesting WebGPU decisions, I'd much rather see that then us just fully copy WebGPU. |
My terminology might be a bit out of date, but when creating a device users could request what timestamp period to use, with two options, "Native" or "Nanosecond". If the user requests "Nanosecond" then "get_timestamp_period" would be guaranteed to return 1. |
thought about this again and agreeing with @cwfitzgerald . Updating comment on |
Timestamp values are supposed to represent nanosecond values, see https://gpuweb.github.io/gpuweb/#timestamp
Meaning that
get_timestamp_period
has to go.Instead,
wgpu-core
needs to add a compute shader that converts timestamps with a previously acquired tick->ns ratio upon query resolve. See also gpuweb/gpuweb#1325 (comment)Related to
The text was updated successfully, but these errors were encountered: