Skip to content

wgsl-tooling-wg/wesl-rs

Repository files navigation

WESL-Rust

crates.io docs.rs

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.

Status

(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

Usage

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.

crates.io docs.rs The crate wesl is a WGSL compiler that implements the WESL specification.

crates.io docs.rs The crate wesl-cli is the command-line tool to run the compiler.

crates.io docs.rs The crate wgsl-parse is a WGSL-compliant syntax tree and parser, with optional syntax extensions from the WESL specification.

Contributing

Contributions are welcome. Please join the discord to get in touch with the community. Read CONTRIBUTING.md before submitting Pull Requests.

License

Except where noted (below and/or in individual files), all code in this repository is dual-licensed under either:

at your option.

Your contributions

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.

About

wesl-rs: a compiler for WESL (WGSL Extended) shaders.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5