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. It serves as the core of the WebGPU integration in Firefox and Deno.
Repo Overview
The repository hosts the following libraries:
- - User facing Rust API.
- - Internal safe implementation.
- - Internal unsafe GPU API abstraction layer.
- - Rust types shared between all crates.
- - Stand-alone shader translation library.
- - Collection of thin abstractions over d3d12.
- - WebGPU implementation for the Deno JavaScript/TypeScript runtime
The following binaries:
- - Tool for translating shaders between different languages using
naga
. - - Tool for getting information on GPUs in the system.
cts_runner
- WebGPU Conformance Test Suite runner usingdeno_webgpu
.player
- standalone application for replaying the API traces.
For an overview of all the components in the gfx-rs ecosystem, see the big picture.
Getting Started
Rust
Rust examples can be found at wgpu/examples. You can run the examples on native with cargo run --bin wgpu-examples
. See the list of examples.
To run the examples in a browser, run cargo xtask run-wasm
. Then open http://localhost:8000
in your browser, and you can choose an example to run. Naturally, in order to display any of the WebGPU based examples, you need to make sure your browser supports it.
If you are looking for a wgpu tutorial, look at the following:
No reviews found!
No comments found for this product. Be the first to comment!