You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,18 @@
3
3
`rust-gpu` helper program for automating shader crate compilation.
4
4
5
5
Can compile once, or run in daemon mode and recompile in response to filesystem changes.
6
+
7
+
## Usage
8
+
9
+
`rust-gpu-builder` relies on the `spirv-builder` crate, which in turn relies on the cargo ecosystem
10
+
to configure the appropriate nightly toolchain for `rust-gpu`. As such, it needs to be run from inside a workspace via `cargo run`.
11
+
12
+
Thus, it's recommended to add `rust-gpu-builder` as a a git submodule of your cargo workspace, and set it up as the default binary target.
13
+
14
+
### One-shot compilation
15
+
16
+
`cargo run --release -- <path-to-shader-crate>` will compile the provided shader crate and output `<crate-name>.spv` and `<crate-name>.spv.json` to `target/spirv-unknown-spv1.5/release/deps/`.
17
+
18
+
### Hot-recompile
19
+
20
+
`cargo run --release -- <path-to-shader-crate> -w <path-to-watch>` will compile as per the above, then watch the provided path and recompile whenever it changes.
0 commit comments