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
double precision trig and exponentials is not implemented #712
Double-precision versions of angle, trigonometry, and exponential functions are not supported.
Expected Behaviour
64 bit trig functions should compile. If nothing can be done here, glam should use the libm sinf rather than a single spirv instr
Example & Steps To Reproduce
Attempt to compile a shader with something like: DVec2::splat(0.0).sin();
(Float64 capability required)
The shader will not compile.
System Info
Rust: [rustc 1.98.1 (48a229cea 2026-09-01)]
OS: [Kubuntu 26.04 LTS]
GPU: [NVIDIA GeForce GTX 1650]
SPIR-V: [SPIRV-Tools v2026.4 v2026.4-0-gef96ed76]
Error message
cargo::warning=error: error:0:0 - GLSL.std.450 Sin: expected Result Type to be a 16 or 32-bit scalar or vector float type
cargo::warning= %139 = OpExtInst %double %1 Sin %134
I don't think spirv can even express f64 sin / cos. And given my current time allotted to rust-gpu being effectively 0, there's little chance I can get around fixing this.
Glam uses libm (for spirv), and libm uses a fallback. I can't see why it isn't already using the fallback, but if it could use the fallback that would fix the issue
Activity
Firestar99 commentedon Dec 2, 2026
I don't think spirv can even express f64 sin / cos. And given my current time allotted to rust-gpu being effectively 0, there's little chance I can get around fixing this.
joshuamday commentedon Dec 2, 2026
Glam uses libm (for spirv), and libm uses a fallback. I can't see why it isn't already using the fallback, but if it could use the fallback that would fix the issue