Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 869 Bytes

rust-shaders.md

File metadata and controls

9 lines (5 loc) · 869 Bytes

Working on Rust shaders

Add your shaders to the crates/lib/rust-shaders/ crate. Run the shader builder from crates/bin/rust-shader-builder to make sure they can be loaded at runtime. Finally, use SimpleRenderPass::new_compute_rust to create a render graph pass (see existing examples).

Rust shaders are compiled asynchronously in the background (unlike HLSL shaders, which use a blocking compilation model). The app will keep running, and once the Rust shaders are ready, they will be reloaded.

Compiled Rust shaders are currently checked into the repository assets/rust-shaders-compiled as SPIR-V binaries.

To manually build Rust shaders, navigate to crates/bin/rust-shader-builder and run cargo run --release.