Skip to content

Commit 1bc46af

Browse files
committed
Update the README
1 parent 0f60759 commit 1bc46af

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

rust-gpu-toy/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Compute shader toy based on wgpu
22

3-
This is a starting point for running compute shaders and drawing the image output into a window, based on [wgpu]. You should be able to change the shader (paint.wgsl) and run using simply `cargo run`.
3+
This is a starting point for running compute shaders and drawing the image output into a window, based on [wgpu] and [rust-gpu]. You should be able to change the [`shader`] and run using simply `cargo run --release`.
44

5-
If there are syntax errors in the shader, the error message can be pretty cryptic. It might be useful to run [naga] from the commandline to validate the shader code.
5+
Using release mode is recommended because the compilation backend (`rustc_codegen_spirv`) runs very slowly when compiled without optimisations.
66

7-
The shading language for this example is [WGSL], translated by naga, but it is possible to run wgpu in native mode with SPIR-V shaders as well. At the time of this writing, compute shaders are blocked on [naga#875], but when the fix for that lands, the experience should be better, and that will also open up features like atomics (and possibly subgroup operations) that are not presently supported by the wgpu stack.
7+
The shading language for this example is [rust-gpu], which produces SPIR-V shaders.
8+
9+
These shaders are reloaded automatically upon saving, without needing to restart the window.
810

9-
[naga]: https://github.com/gfx-rs/naga
1011
[wgpu]: https://wgpu.rs/
12+
[rust-gpu]: https://github.com/EmbarkStudios/rust-gpu
13+
[naga]: https://github.com/gfx-rs/naga
1114
[WGSL]: https://gpuweb.github.io/gpuweb/wgsl/
1215
[naga#975]: https://github.com/gfx-rs/naga/issues/875
16+
[`shader`]: ./shaders/src/lib.rs

0 commit comments

Comments
 (0)