gfx-rs /wgpu

A cross-platform, safe, pure-Rust graphics API.

★ 18,546⑂ 1,663👁 110⑃ 6,398● 4,060▤ 64
RustApache-2.0Created 2018-09-13wgpu.rs
下载:v30.0.2v30.0.2 ↓30.0.22026-11-12
+9
日增长
18,546
stars
1,663
forks
110
watchers
6,398
prs
4,060
issues
64
releases

README

wgpu






wgpu is a cross-platform, safe, pure-Rust graphics API. It runs natively on Vulkan, Metal, D3D12, and OpenGL; and on top of WebGL2 and WebGPU on wasm.

The API is based on the [WebGPU standard][webgpu], but is a fully native Rust library. It serves as the core of the WebGPU integration in Firefox, Servo, and Deno.

 Getting Started

See our examples online at . You can see the Rust sources at examples and run them directly with cargo run --bin wgpu-examples .

 Learning wgpu

If you are new to wgpu and graphics programming, we recommend starting with [Learn Wgpu].



Additionally, [WebGPU Fundamentals] is a tutorial for WebGPU which is very similar to our API, minus differences between Rust and Javascript.

[Learn Wgpu]: https://sotrh.github.io/learn-wgpu/
[WebGPU Fundamentals]: https://webgpufundamentals.org/

 Documentation Guides

We ship a set of documentation modules with information on useful architecture patterns, debugging tips, and more getting started information.

 Need Help? Want to Contribute?

The wgpu community uses Matrix and Discord to discuss.

-  - discussion of wgpu's development.
-  - discussion of using the library and the surrounding ecosystem.
- ![wgpu on the Rust Gamedev Discord
  ](https://discord.gg/X3MYBNXUMJ) - Dedicated support channel on the Rust Gamedev Discord.

 Other Languages

To use wgpu in C or dozens of other languages, look at wgpu-native. These are C bindings to wgpu and has an up-to-date list of libraries bringing support to other languages.

[Learn WebGPU (for C++)] is a good resource for learning how to use wgpu-native from C++.

[Learn WebGPU (for C++)]: https://eliemichel.github.io/LearnWebGPU/
[webgpu]: https://gpuweb.github.io/gpuweb/

 Quick Links

|         Docs          |         Examples          |        Changelog        |
| :-------------------: | :-----------------------: | :---------------------: |
|    [v30][rel-docs]    |    [v30][rel-examples]    |    [v30][rel-change]    |
| [trunk][trunk-docs] | [trunk][trunk-examples] | [trunk][trunk-change] |

Contributors are welcome! See [CONTRIBUTING.md][contrib] for more information.

[rel-docs]: https://docs.rs/wgpu/
[rel-examples]: https://github.com/gfx-rs/wgpu/tree/v30/examplesreadme
[rel-change]: https://github.com/gfx-rs/wgpu/releases
[trunk-docs]: https://wgpu.rs/doc/wgpu/
[trunk-examples]: https://github.com/gfx-rs/wgpu/tree/trunk/examplesreadme
[trunk-change]: https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.mdunreleased
[contrib]: CONTRIBUTING.md

 Supported Platforms

| API    | Windows             | Linux/Android   | macOS/iOS | Web (wasm)  |
| ------ | ------------------- | --------------- | --------- | ----------- |
| Vulkan | ✅                  | ✅              | 🌋        |             |
| Metal  |                     |                 | ✅        |             |
| DX12   | ✅                  |                 |           |             |
| OpenGL | 🆗 (GL 3.3+), or 📐 | 🆗 (GL ES 3.0+) | 📐        | 🆗 (WebGL2) |
| WebGPU | 

Top issues

Discussions

Latest release

v30.0.2 v30.0.2 2026-11-12
Bug Fixes

 General

- Explicitly implement Send and Sync in wgpu-core to reduce the risk of recursion_limit overflow. By @nazar-pc in 9953.
- Fix a texture id leak when surface acquire returns no texture. By @jnb in 10184.
- Fix a use after free of a mapped buffer when its device is lost or destroyed. By @uael in 10593.

 naga

- Fix a compilation error when the glsl-in feature is enabled without spv-in or wgsl-in. By @andyleiserson in 10297.

 Metal

- Fix a crash/hang when configuring a surface with the Bt2100Pq, Bt2100Hlg, or ExtendedDisplayP3 color space: the dynamically resolved CoreGrap

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON