Skip to content

Commit 62a3f60

Browse files
shelvacueddyb
authored andcommitted
Book cleanup
Add the line to configure a crate as a dylib and update rust-toolchain file link
1 parent 7a44fa1 commit 62a3f60

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/src/writing-shader-crates.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ There are two main ways to setup your shader project locally.
3535
If you're writing a bigger application and you want to integrate SPIR-V shader
3636
crates to display, it's recommended to use `spirv-builder` in a build script.
3737

38-
1. Copy the [`rust-toolchain`] file to your project. (You must use the same
38+
1. Copy the [`rust-toolchain.toml`] file to your project. (You must use the same
3939
version of Rust as `rust-gpu`. Utimately, the build will fail with a nice
4040
error message when you don't use the exact same version)
4141
2. Reference `spirv-builder` in your Cargo.toml:
@@ -142,13 +142,16 @@ cargo build
142142
Now you should have `<project_name>.spv` SPIR-V file in `target/debug` that you
143143
can give to a renderer.
144144

145-
[`rust-toolchain`]: https://github.com/EmbarkStudios/rust-gpu/blob/main/rust-toolchain
145+
[`rust-toolchain.toml`]: https://github.com/EmbarkStudios/rust-gpu/blob/main/rust-toolchain.toml
146146

147147
## Writing your first shader
148148

149149
Configure your shader crate as a `"dylib"` type crate, and add `spirv-std` to its dependencies. The following example also enables the `glam` vector library.
150150

151151
```toml
152+
[lib]
153+
crate-type = ["dylib"]
154+
152155
[dependencies]
153156
spirv-std = { version = "0.7" }
154157
```

0 commit comments

Comments
 (0)