A cross-platform, safe, pure-Rust graphics API that runs natively on Vulkan, Metal, D3D12, OpenGL, and WebGPU.
wgpu is a cross-platform, safe, pure-Rust graphics API based on the WebGPU standard. It provides a low-level interface for graphics programming that runs natively on multiple backends like Vulkan, Metal, D3D12, and OpenGL, and supports WebGL2 and WebGPU on WebAssembly. It solves the problem of writing portable, performant graphics code in Rust without sacrificing safety or modern API design.
Rust developers building graphics-intensive applications, game engines, or tools that require cross-platform GPU access, as well as projects integrating WebGPU into browsers or runtime environments.
Developers choose wgpu for its safe Rust API, strict adherence to the WebGPU standard, and extensive cross-platform support without relying on unsafe code. Its integration as the core of WebGPU in Firefox, Servo, and Deno ensures reliability and forward compatibility.
A cross-platform, safe, pure-Rust graphics API.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports Vulkan, Metal, D3D12, OpenGL, and WebGL2/WebGPU, enabling consistent code across Windows, Linux, macOS, and web with minimal changes, as shown in the platform support table.
Provides a memory-safe and idiomatic Rust interface that prevents common GPU programming errors like buffer overflows, leveraging Rust's ownership model for reliability.
Implements the WebGPU API specification, ensuring compatibility with web standards and serving as the core for WebGPU in Firefox, Servo, and Deno.
Allows selection of graphics backends via environment variables (e.g., WGPU_BACKEND), facilitating testing and development across different systems without code modifications.
Since WebGPU is a working draft, wgpu's API and WGSL support can change, leading to breaking updates and potential instability, as noted in the tracking of draft specifications.
On macOS, Vulkan requires MoltenVK, and OpenGL needs ANGLE, adding extra setup steps and potential performance overhead, which is marked as downlevel support in the platform table.
As a low-level API, it lacks built-in scene graphs or asset pipelines, requiring more manual work compared to full game engines like Bevy or Unity.
WGSL shaders depend on Naga for translation, which has known bugs and may not fully support all WGSL features yet, potentially causing shader compilation errors, as mentioned in the tracking section.