gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
11.46k stars 855 forks source link

Allow using include_wgsl! in const contexts #5872

Closed 9SMTM6 closed 4 days ago

9SMTM6 commented 4 days ago

Its not possible to call into in const contexts. But what into does here under the hood is what i replaced in, and since thats just the creation of an enum variant, one can do that in const contexts.

Connections Nada.

Description I want my shader module in a constant (no lifetimes to deal with, can be static), and I'd like to use the provided macro for it.

Testing Try to call the old include_wgsl! to create a constant, see that it doesn't work. Repeat with this version, hussa it works now.

Checklist