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.
update: 2025-04
- WESL recently released its first M1 release. It includes imports, Conditional Compilation and Packaging.
- Experimental support for WESL in Bevy was merged.
Currently implemented:
- Imports & Modules
- Conditional Compilation
Experimental:
- Cargo Packages
- Validation
- Compile-time Evaluation and Execution
- Polyfills
Probable future work:
- Namespaces
- Generics
Read the WESL for rust tutorial.
This project can be used as a rust library or as a standalone CLI, refer to the following crates documentation.
The crate
wesl
is a WGSL compiler that implements the WESL specification.
The crate
wesl-cli
is the command-line tool to run the compiler.
The crate
wgsl-parse
is a WGSL-compliant syntax tree and parser, with optional syntax extensions from the WESL specification.
Contributions are welcome. Please join the discord to get in touch with the community. Read [CONTRIBUTING.md][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.