Skip to content

Commit 5f5f49d

Browse files
committed
readme: add readme
1 parent 65eb0dc commit 5f5f49d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
33+
We currently only have a "graphics" template, showcasing how to use rust-gpu for vertex and fragment shaders. More templates to come!
34+
35+
2. **What API?**
36+
37+
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.
38+
39+
3. **How to integrate rust-gpu?**
40+
41+
[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)