Skip to content

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

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

wgsl-tooling-wg/wesl-rs

Folders and files

NameName
Last commit message
Last commit date
Feb 14, 2025
Feb 3, 2025
Feb 14, 2025
Feb 14, 2025
Aug 19, 2024
Feb 6, 2025
Feb 14, 2025
Feb 5, 2025
Feb 6, 2025
Feb 6, 2025
Feb 6, 2025

Repository files navigation

WESL-Rust

A work in progress!

This project implements the necessary tools to build complex shaders, like what naga_oil does for bevy, but in a framework-agnostic way. At wgsl-tooling-wg we aim at standardizing a few language extensions to facilitate the work of engine developers and shader wizards.

Current and planned extensions: imports, conditional compilation, generics, modules.

Usage

This project can be used as a rust library or as a standalone CLI.

Using the CLI

  • Install cargo install --git https://github.com/wgsl-tooling-wg/wesl-rs
  • Compile a WESL shader wesl compile <entrypoint.wgsl>
  • Run eval() wesl eval <entrypoint.wgsl> <expression to eval>

Using the Crate

Refer to the crate documentation on docs.rs.

Status

update: 2025-01

We are working towards an MVP release planned for 2025 Q1. It includes imports, conditional compilation and packaging.

The crate wgsl-parse contains a WGSL-compliant syntax tree and parser, with optional syntax extensions from the WESL specification.

The crate wesl contains an implementation of the WESL specification, i.e. a compiler that takes WESL files and generates valid WGSL.

This crate contains a CLI to run the compiler and the parser.

See also:

Contributing

Contributions are welcome. Please join the discord server and introduce yourself first, or contact via email.

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