EmbarkStudios / rust-gpu

🐉 Making Rust a first-class language and ecosystem for GPU shaders 🚧

Home Page:https://shader.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

cybersoulK opened this issue · comments

num-traits = { version = "0.2.15", default-features = false, features = ["libm"] }
glam = { version = ">=0.22, <=0.24", default-features = false, features = ["libm"] }

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