#naga #back-end #naga-rust-back

naga-rust-back

Backend for the Naga shader translator which generates Rust code

1 unstable release

Uses new Rust 2024

new 0.1.0 Mar 26, 2025

#1 in #naga


Used in 3 crates (2 directly)

MIT/Apache

81KB
1.5K SLoC

naga-rust-back: translate shaders to Rust

naga backend allowing you to translate shader (GPU) code in any language supported by Naga to Rust code.

The generated code requires the naga-rust-rt library. Alternatively, you can use naga-rust-embed, which combines this library with naga-rust-rt and provides convenient macros for embedding translated WGSL in your Rust code.

This library is in an early stage of development and many features do not work yet; this may be indicated by returned errors or by the generated code failing to compile. Broadly, simple mathematical functions will work, and bindings, textures, atomics, derivatives, and workgroup operations will not.

License

Copyright 2025 Kevin Reid and the gfx-rs authors.

Licensed under either of

at your option.

Dependencies

~6–13MB
~166K SLoC