Skip to content

Commit c829157

Browse files
authored
Fix up some outdated documentation (#650)
1 parent e7b109b commit c829157

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

docs/src/writing-shader-crates.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,28 @@ If you're writing a bigger application and you want to integrate SPIR-V shader
3737
crates to display, it's recommended to use `spirv-builder` in a build script.
3838

3939
1. Copy the [`rust-toolchain`] file to your project. (You must use the same version of Rust as `rust-gpu`.)
40-
2. Create a `build.rs` in your project root.
40+
2. Reference `spirv-builder` in your Cargo.toml:
41+
```toml
42+
[build-dependencies]
43+
spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu" }
44+
```
45+
(we currently do not publish spirv-builder on crates.io)
46+
3. Create a `build.rs` in your project root.
4147

4248
#### `build.rs`
4349
Paste the following into the `main` for your build script.
50+
4451
```rust,no_run
45-
SpirvBuilder::new(path_to_shader)
46-
.spirv_version(1, 0)
52+
SpirvBuilder::new(path_to_shader, target)
4753
.print_metadata(MetadataPrintout::Full)
4854
.build()?;
4955
```
5056

57+
The values available for the `target` parameter are available [here](./platform-support.md).
58+
For example, if building for vulkan 1.1, use `"spirv-unknown-vulkan1.1"`.
59+
60+
The `SpirvBuilder` struct has numerous configuration options available, see rustdoc for documentation.
61+
5162
#### `main.rs`
5263
```rust,no_run
5364
const SHADER: &[u8] = include_bytes!(env!("<shader_name>.spv"));

0 commit comments

Comments
 (0)