EmbarkStudios / rust-gpu

🐉 Making Rust a first-class language and ecosystem for GPU shaders 🚧
https://shader.rs
Apache License 2.0
7.35k stars 245 forks source link

adding spirv-std anywhere in the worskspace, slows down the CPU code due to libm feature #1121

Closed cybersoulK closed 8 months ago

cybersoulK commented 9 months ago

https://github.com/EmbarkStudios/rust-gpu/blob/1a9c8b8ba1dfb4b7dbe26d0fd55265de6b36d00f/crates/spirv-std/Cargo.toml#L14-L15

it was slowing down my cpu code by 3x, specifically the glam Vec3::distance. it's really bad because new users might enable it in the shaders crate within the workspace early in development, without realizing the impact in performance.

Possible solution: spirv-std crate should only enable libm for spirv target in Cargo.toml