Guide for using gfx-rs's wgpu library.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Benjamin Hansen 2bb2f8373b restored happy-tree.png 2 months ago
.cargo more-testing 2 years ago
.github/workflows attempting to fix deploy.yml 1 year ago
code restored happy-tree.png 2 months ago
docs fixes #504 3 months ago
run-wasm more-testing 2 years ago
.gitignore adding wgpu to fully qualify `include_wgsl!` macro as part of #423 1 year ago
.yarnrc.yml adding wgpu to fully qualify `include_wgsl!` macro as part of #423 1 year ago
Cargo.lock Bump openssl from 0.10.48 to 0.10.60 4 months ago
Cargo.toml fixed pong 4 months ago
FEATURES.md some fixes to web 2 years ago
LICENSE.md license 4 years ago
build-wasm.sh switched to custom wasm-builder instead of wasm-pack for examples 1 year ago
index.template.html wasm is building 2 years ago
package-lock.json Merge pull request #515 from sotrh/dependabot/npm_and_yarn/browserify-sign-4.2.2 4 months ago
package.json try using yarn for deploy.yml 1 year ago
run-all.sh 0.18 and hdr tutorial 5 months ago
rustfmt.toml rustfmt 4 years ago
wasm-targets.json finished hdr writeup 5 months ago
yarn.lock Merge pull request #515 from sotrh/dependabot/npm_and_yarn/browserify-sign-4.2.2 4 months ago

docs/README.md

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!

Translations

Special thanks to these patrons!

  • David Laban
  • Lennart
  • Ian Gowen
  • Aron Granberg
  • Bernard Llanos
  • Jan Šipr
  • Zeh Fernando
  • Youngsuk Kim
  • オリトイツキ
  • Andrea Postal
  • Julius Liu
  • Feng Liang
  • Mattia Samiolo
  • Joris Willems
  • Jani Turkia
  • papyDoctor
  • Filip