wesl-rs
implements the necessary tools to build complex WGSL shaders, like what naga_oil does for Bevy, but in a framework-agnostic way. Visit wesl-lang.dev to learn more about WGSL shader tools and language extensions.
Read the WESL for Rust tutorial and refer to the main crate documentation.
Try out WESL and its implementations, wesl-js
and wesl-rs
on the playground.
Note
last update: 2025-07
WESL 0.2 was released and supports the following features:
- Import statements & inline import paths
- Conditional compilation with
@if
,@elif
,@else
attributes - Cargo shader packages
The following features are experimental:
- Evaluation and Execution of WGSL code
- Lowering of const-expressions, code normalization
- Code validation
The following features are planned (to be designed with the WESL team):
- Automatic bindings, structs of bindings
- Namespaces / inline modules
- Generic functions
Contributions are welcome. Please join the discord to get in touch with the community. Read CONTRIBUTING.md before submitting Pull Requests.
Except where noted (below and/or in individual files), all code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.