SYSTEM Cited by 1 source
WebGPU¶
WebGPU is the modern browser graphics API standardized at the W3C, shipped in Chromium in 2023 as the successor to WebGL. It exposes GPU compute and rendering capabilities much closer to native graphics APIs (Vulkan / Metal / D3D12) than WebGL did, at the cost of a substantially different programming model.
What it adds over WebGL¶
- Compute shaders — arbitrary GPU compute kernels separated from the fixed-function rendering pipeline. Lets workloads move CPU work to the GPU, e.g. image filters or blur. (See concepts/compute-shader.)
- Explicit per-draw state — no global "bound" resources that persist across draws; every draw specifies its pipeline state, bind groups, and vertex buffers upfront. This eliminates a whole class of bugs caused by WebGL's implicit state. See concepts/explicit-graphics-state.
- Modern error handling — errors surface asynchronously with
helpful messages rather than requiring synchronous polling for
glGetError. WebGL's synchronous error-check model made frequent validation expensive in practice. - Uniform buffers only — shader uniforms are uploaded via a
buffer rather than individual
uniformXfcalls. Forces batching discipline on the producer; see concepts/uniform-buffer and patterns/uniform-buffer-batching. - WGSL shading language — a new language designed for WebGPU, distinct from WebGL's GLSL dialect.
- MSAA, RenderBundles, and other features not available in WebGL.
What it removes¶
- Synchronous readback — reading pixels back from GPU to CPU is
async-only. This breaks the conventional "render →
readPixels→ inspect" flow and forces applications into async patterns. See concepts/synchronous-vs-asynchronous-readback. - Global state — simpler but also familiar to anyone who had WebGL, so migrations require rethinking how draws are issued.
Implementations¶
- Browsers: Chromium-based browsers via Dawn; Safari and Firefox via other engines.
- Native (C++ / Rust apps): via Dawn (Chromium's
WebGPU impl shared as a C++ library) or
wgpu-rs(Rust impl under gfx-rs).
Seen in¶
- sources/2026-04-21-figma-rendering-powered-by-webgpu — Figma's year-long C++/WASM canvas migration from WebGL → WebGPU while keeping WebGL as a peer backend. Canonical production-scale- web-canvas WebGPU migration on the wiki: API-abstraction redesign (patterns/graphics-api-interface-layer), shader translation via naga, uniform batching (patterns/uniform-buffer-batching), dynamic mid-session WebGL fallback (patterns/runtime-backend-swap-on-failure), telemetry-driven device blocklist (patterns/device-blocklist-from-telemetry).
Related¶
- systems/webgl — the API WebGPU replaces.
- systems/dawn — Chromium's WebGPU implementation.
- systems/wgsl — WebGPU's shading language.
- systems/naga — shader translator (GLSL ↔ WGSL ↔ HLSL / MSL / SPIR-V).
- concepts/compute-shader
- concepts/explicit-graphics-state
- concepts/uniform-buffer
- concepts/synchronous-vs-asynchronous-readback
- patterns/graphics-api-interface-layer
- patterns/uniform-buffer-batching