-
Notifications
You must be signed in to change notification settings - Fork 244
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
Add an read_clock_khr
function that calls OpReadClockKHR
#757
Conversation
Please also add compiletests |
Hmm, |
... oh, ugh, right, since we build spirv-std without those flags, but the test itself with those flags (something that never happens, and cannot happen, in the real world - can only happen here since we're directly invoking rustc instead of going through cargo). uuuuh, hmm, going to try to think of a way to resolve it... |
Co-authored-by: Ashley Hauck <[email protected]>
nanosecond timing will be useful. Timestamp values in this time domain are in units of nanoseconds and are comparable with platform timestamp values captured using the POSIX clock_gettime API. This extension advertises the SPIR-V ShaderClockKHR capability for Vulkan, which allows a shader to query a real-time or monotonically incrementing counter at the subgroup level or across the device level. The two valid SPIR-V scopes for OpReadClockKHR are Subgroup and Device. |
This is a horrible no-good very bad solution, and I'm really hoping I can think of something better, but right now my only thought to fix it is adding ShaderClockKHR and the ext to here. |
That doesn't look too too bad to me :) Another think that I thought off that could to have a seperate feature flag just for the compiletests: #[cfg(any(
all(
target_feature = "Int64",
target_feature = "ShaderClockKHR",
target_feature = "ext:SPV_KHR_shader_clock"
),
target_feature = "compiletests"
)] That way we don't have to shove a whole lot of features into that line you linked. |
@khyperia Happy to go with either idea, or to put this on-hold for a bit. |
Whatever you think is best works! |
Actually, that doesn't work. We just run into an invalid capability error: rust-gpu/crates/rustc_codegen_spirv/src/target_feature.rs Lines 15 to 21 in 4e5f347
|
…flags and bless the changed test errors
Reading from the shader clock lets us create heatmaps for ray tracing as seen here: https://developer.nvidia.com/blog/profiling-dxr-shaders-with-timer-instrumentation/.