mirror of
https://github.com/sotrh/learn-wgpu.git
synced 2024-11-08 07:10:33 +00:00
Merge pull request #68 from guidorice/docs-beginner-vulkan-backend
Clarify what the wgpu-rs's vulkan feature does on Mac OS and other platforms
This commit is contained in:
commit
d87c22e2f3
@ -14,7 +14,14 @@ wgpu = "0.5.0"
|
|||||||
futures = "0.3.4"
|
futures = "0.3.4"
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're on MacOS, you can specify Vulkan (MoltenVK) as your desired backend instead of Metal by removing the `wgpu = "0.5.0"` and adding the following.
|
### Vulkan Portability Layer
|
||||||
|
|
||||||
|
You may also want to make the Vulkan backend available on platforms where it is by default not, e.g. Mac OS. The reason
|
||||||
|
you might want to enable the Vulkan backend is if you are doing cross-platform development and you need the
|
||||||
|
Vulkan validation layers output.
|
||||||
|
|
||||||
|
To enable the Vulkan backend, add this new section to `Cargo.toml`, and do not forget to remove `wgpu` from the earlier
|
||||||
|
`[dependencies]` section.
|
||||||
|
|
||||||
``` toml
|
``` toml
|
||||||
[dependencies.wgpu]
|
[dependencies.wgpu]
|
||||||
@ -22,6 +29,10 @@ version = "0.5.0"
|
|||||||
features = ["vulkan"]
|
features = ["vulkan"]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- This may not be necessary because normally `wgpu-rs` validation will catch problems. In fact that is one of it's
|
||||||
|
design goals.
|
||||||
|
- This is not intended for shipping code.
|
||||||
|
- See also [gfx-portability](https://github.com/gfx-rs/portability).
|
||||||
|
|
||||||
## The code
|
## The code
|
||||||
There's not much going on here yet, so I'm just going to post the code in full. Just paste this into you're `main.rs` or equivalent.
|
There's not much going on here yet, so I'm just going to post the code in full. Just paste this into you're `main.rs` or equivalent.
|
||||||
|
Loading…
Reference in New Issue
Block a user