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: docs/src/introduction.md
+9-4
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ how to use and develop on Rust-GPU.
22
22
23
23
1. Install [SPIRV-Tools](https://github.com/KhronosGroup/SPIRV-Tools#downloads) and add it to your PATH (for now, eventually we will automatically build and link it instead of calling executables)
24
24
25
-
1. Next, look at the [examples](examples) folder. There are two projects here: [examples/example-shader](examples/example-shader) and [examples/example-runner](examples/example-runner). The example-shader project is a "GPU crate", one that will be compiled to a SPIR-V module. The example-runner project is a normal, CPU crate that uses vulkan to consume the example-shader SPIR-V module to display a shader.
25
+
1. Next, look at the [examples] folder. There are two projects here: [examples/example-shader] and [examples/example-runner]. The example-shader project is a "GPU crate", one that will be compiled to a SPIR-V module. The example-runner project is a normal, CPU crate that uses vulkan to consume the example-shader SPIR-V module to display a shader.
26
26
27
27
Run the example:
28
28
@@ -32,10 +32,11 @@ how to use and develop on Rust-GPU.
32
32
33
33
This will build `rustc_codegen_spirv`, the compiler, then use that compiler to build `example-shader` into a SPIR-V module, then finally, build a vulkan sample app (taken from [ash's examples](https://github.com/MaikKlein/ash/blob/master/examples/src/bin/triangle.rs)) using the built SPIR-V module to display the shader in a window.
34
34
35
-
All of this is orchestrated by the [spirv-builder](spirv-builder) crate, which is used in example-runner's `build.rs` file. Please look at that file, as well as both example projects in general, to see how to set up your own shaders!
35
+
All of this is orchestrated by the [spirv-builder] crate, which is used in example-runner's `build.rs` file. Please look at that file, as well as both example projects in general, to see how to set up your own shaders!
36
36
37
37
Be aware that this project is in a very early phase - if the above doesn't work, please [file an issue](https://github.com/EmbarkStudios/rust-gpu/issues)!
38
38
39
+
39
40
## Getting started, for power users who don't want to use spirv-builder.
40
41
41
42
If you would like to build the compiler, `rustc_codegen_spirv` is the relevant folder. Install the prerequisites, as above, then, `cd rustc_codegen_spirv && cargo build`. This produces an .so file, located at `./target/debug/librustc_codegen_spirv.so` (or `.dll`/`.dylib` depending on your platform).
This will produce a `target/spirv-unknown-unknown/release/crate_name.spv` file.
59
60
60
-
To create a GPU crate, look at the [examples/example-shader](examples/example-shader) crate. In short, reference the `spirv-std` crate, and use intrinsics defined there to create your shader.
61
+
To create a GPU crate, look at the [examples/example-shader] crate. In short, reference the `spirv-std` crate, and use intrinsics defined there to create your shader.
61
62
62
-
This is all a little convoluted, hence the [spirv-builder](spirv-builder) crate handles a lot of this.
63
+
This is all a little convoluted, hence the [spirv-builder] crate handles a lot of this.
0 commit comments