Guide for using gfx-rs's wgpu library.
Go to file
2022-01-04 03:44:01 +09:00
.github/workflows trying to fix wasm deploy 2021-12-03 12:44:16 -07:00
code Fix typo: w -> we 2022-01-04 03:44:01 +09:00
docs Fix typo: know -> known 2022-01-02 16:52:20 +09:00
.gitignore Some small fixes for beginner tutorials 1 to 5 2021-12-18 17:18:21 +01:00
.travis.yml travis now installs libasound2-dev 2020-12-20 00:49:02 -07:00
build-wasm.sh example loading in vuepress 2021-11-06 18:30:22 -06:00
Cargo.lock added 0.12.md and examples now compile 2021-12-27 13:48:52 -07:00
Cargo.toml fixed pong 2021-09-21 20:43:22 -06:00
deploy.sh updated deploy.sh to cleanup dist git repo 2020-11-23 23:43:35 -07:00
FEATURES.md some fixes to web 2021-12-03 14:18:06 -07:00
index.template.html wasm is building 2021-10-22 15:55:39 -06:00
LICENSE.md license 2020-09-02 12:59:22 -06:00
package-lock.json updating package-lock.json 2021-12-03 14:22:16 -07:00
package.json Merge branch 'web' 2021-12-03 14:23:47 -07:00
run-all.sh added 0.12.md and examples now compile 2021-12-27 13:48:52 -07:00
rustfmt.toml rustfmt 2020-09-27 23:24:43 -06:00

Introduction

What is wgpu?

Wgpu is a Rust implementation of the WebGPU API spec. WebGPU is a specification published by the GPU for the Web Community Group. It aims to allow web code access to GPU functions in a safe and reliable manner. It does this by mimicking the Vulkan API, and translating that down to whatever API the host hardware is using (ie. DirectX, Metal, Vulkan).

Wgpu is still in development, so some of this doc is subject to change.

Why Rust?

Wgpu actually has C bindings to allow you to write C/C++ code with it, as well as use other languages that interface with C. That being said, wgpu is written in Rust, and it has some convenient Rust bindings that don't have to jump through any hoops. On top of that, I've been enjoying writing in Rust.

You should be fairly familiar with Rust before using this tutorial as I won't go into much detail on Rust syntax. If you're not super comfortable with Rust you can review the Rust tutorial. You should also be familiar with Cargo.

I'm using this project to learn wgpu myself, so I might miss some important details, or explain things badly. I'm always open to constructive feedback.

Contribution and Support

  • I accept pull requests (GitHub repo) for fixing issues with this tutorial such as typos, incorrect information, and other inconsistencies.
  • Due to wgpu's rapidly changing api, I'm not accepting any new pull requests for showcase demos.
  • If you want to support me directly, check out my patreon!

Special thanks to these patrons!

In no particular order

  • Zeh Fernando
  • The toddling chaos
  • Jan Šipr
  • Bernard Llanos
  • Aron Granberg
  • Ian Gowen
  • Paul E Hansen
  • Lennart
  • Gunstein Vatnar
  • David Laban