Expand description
naga backend allowing you to translate shader 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. Expect compilation failures, incorrect behaviors, and to have to tweak your code to fit, if you wish to use it. Broadly:
- Simple mathematical functions will work.
- Code involving pointers is likely to fail to compile.
- Textures are supported but texture filtering is not.
- Atomics, derivatives, and workgroup operations are not supported.
- Pipelines involving multiple shaders (e.g. passing data from vertex to fragment) are not automatically executed but you can build that yourself.
Re-exports§
pub use naga;
Structs§
- Config
- Configuration/builder for options for Rust code generation.
- Writer
nagabackend allowing you to translate shader code in any language supported by Naga to Rust code.
Enums§
- Error
- Errors returned by the Rust-generating backend.
Constants§
- CAPABILITIES
- The
Capabilitiessupported by our Rust runtime library.
Functions§
- write_
string - Converts
moduleto a string of Rust code.