You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
u32::leading_zeros intrinic requires weird extension to work #210
Using u32::leading_zeros() in any shader errors with:
error: extension SPV_INTEL_shader_integer_functions2 is required
[...]
note: used from within `<u32>::leading_zeros`
This should not even need some intel-specific extension, that function probably exists already in the GL450 extension. Especially since some hardware (AMD) has special instructions for bit counting.
I'm having a look at it, it seems like GLSL.std.450 do have FindILsb, FindSMsb and FindUMsb instructions for this. Though they do slightly mismatch what rust expects when 0 is passed and are limited to 32 bits.
Activity
LegNeato commentedon Jan 28, 2025
Here is the code:
rust-gpu/crates/rustc_codegen_spirv/src/builder/intrinsics.rs
Line 218 in 6e2c84d
Yeah, doesn't look right 🤔
Firestar99 commentedon Jan 29, 2025
I'm having a look at it, it seems like
GLSL.std.450do haveFindILsb,FindSMsbandFindUMsbinstructions for this. Though they do slightly mismatch what rust expects when 0 is passed and are limited to 32 bits.https://registry.khronos.org/SPIR-V/specs/unified1/GLSL.std.450.html