Skip to content

Commit baf2e0a

Browse files
committed
add readme
1 parent 2658b73 commit baf2e0a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# rust-gpu templates
2+
3+
Examples on how to setup rust-gpu with various APIs, use-cases and integration paths.
4+
5+
## Generating a project
6+
7+
Install cargo-generate
8+
9+
```sh
10+
cargo install cargo-generate
11+
```
12+
13+
or if you have [no time, use cargo-binstall](https://github.com/cargo-bins/cargo-binstall):
14+
15+
```sh
16+
cargo binstall cargo-generate
17+
```
18+
19+
Then generate this template and answer the questions to configure it: (more details below)
20+
21+
```sh
22+
cargo generate --git https://github.com/Rust-GPU/rust-gpu-template
23+
```
24+
25+
If you don't want to install `cargo generate`, you can also go to the
26+
[
27+
`generated/` folder](https://github.com/Rust-GPU/rust-gpu-template/tree/main/generated/) and navigate its subfolders, each level corresponding to the questions below.
28+
29+
## Questions
30+
31+
1. Which sub-template should be expanded?
32+
We currently only have a "graphics" template, showcasing how to use rust-gpu for vertex and fragment shaders. More templates to come!
33+
34+
2. What API?
35+
You can choose between the high-level [wgpu](https://github.com/gfx-rs/wgpu) API with browser support and [ash](https://github.com/ash-rs/ash), a lightweight wrapper around the low level Vulkan API. If you're new to graphics, we recommend you start at [learn wgpu](https://sotrh.github.io/learn-wgpu/), and once you have a basic triangle or compute shader working, return here.
36+
37+
3. How to integrate rust-gpu?
38+
[cargo-gpu](https://github.com/Rust-GPU/cargo-gpu) is a rust-gpu installation manager, which isolates the specific nightly toolchain that rust-gpu requires, thus allowing the rest of your project to remain on a stable toolchain (or any other toolchain). In addition, it is also a command line tool you can use. Whereas the "raw" [spirv-builder](https://github.com/Rust-GPU/rust-gpu/tree/main/crates/spirv-builder) setup requires your entire project to be compiled using the specific nightly rust-gpu toolchain. Note that cargo-gpu merely wraps spirv-builder, making it easy to switch and keep most of your configuration between both platforms.

0 commit comments

Comments
 (0)