Key points
- WebGPU replaces WebGL as the modern GPU API for the Web. Enabled by default in Chrome 113 (April 2023), it was developed by the W3C "GPU for the Web" working group from 2016 to 2026, and is currently a Candidate Recommendation Draft (29 January 2026): https://www.w3.org/TR/webgpu/
- Why WebGL had to go: its OpenGL ES heritage created driver overhead ("driver roulette"), CPU-side bottlenecks, and no real support for general-purpose GPU compute (GPGPU).
- Design philosophy: a clean-slate API modeled on post-2014 native APIs (Vulkan, Metal, D3D12), trading driver-side magic for predictable performance and low CPU overhead.
- Adapter/Device model:
navigator.gpu.requestAdapter()discovers hardware;adapter.requestDevice()acquires a logicalGPUDevicewith requested features/limits. An adapter is "consumed" after creating one device, anddevice.losthandles driver resets gracefully. - Three timelines (spec §3.4): the Content Timeline (JS calls), Device Timeline (validation, driver interaction), and Queue Timeline (actual GPU execution). Pre-recording commands into
GPUCommandBufferand submitting once minimizes CPU–GPU synchronization;GPURenderBundleextends this for reusable render commands. - Pipelines: a fully specified render pipeline (vertex shader → primitive assembly → rasterization → fragment shader → output merge, including defined MSAA sample positions) and a compute pipeline with workgroups mapping to CUDA blocks / Metal threadgroups / Vulkan subgroups.
- Resource binding: three layers —
GPUBindGroupLayout(blueprint),GPUBindGroup(instance),GPUPipelineLayout— enabling cheap pipeline switches without rebinding. - WGSL: a Rust-inspired shading language with well-defined behavior for all valid programs, translatable to SPIR-V, MSL, and HLSL. Notable features: pipeline-overridable constants (
@id),shader-f16(half-precision floats for AI inference),subgroups(warp-level operations),clip-distances, anddual-source-blending. - All API calls are strictly validated; out-of-bounds shader access returns zeros/discards writes (robust buffer access) — no undefined behavior allowed.
- Timestamp queries are coarsened to mitigate side-channel timing attacks; COOP/COEP cross-origin isolation does not protect device/queue timelines.
- Anti-fingerprinting: user agents must not expose more than 32 distinguishable GPU configurations and may report binned values instead of real hardware limits.
- Web 3D: Three.js and Babylon.js support WebGPU backends, with significant frame-rate gains over WebGL (e.g., the "WebGPU Forest" demo).
- Browser-side AI: compute pipelines enable on-device LLM inference via MediaPipe, ONNX.js, and WebLLM — data never leaves the device.
subgroupsandshader-f16are key for matrix-heavy workloads. - Science and media: molecular dynamics, FEA, and fluid simulation ported to the browser;
GPUExternalTextureenables zero-copy GPU video processing. - Future work: new texture formats,
texture-component-swizzle,primitive-index, a Compatibility Mode for older GPUs (featureLevel: "compatibility"), deeper WebXR integration, WebNN collaboration, and potential ray tracing extensions.
Core architecture
Security and privacy
Browser implementations
| Browser | Backend | Status | |---|---|---| | Chrome/Edge | Dawn (C++ → Metal/D3D12/Vulkan) | Stable on Windows/macOS/ChromeOS since Chrome 113; Android since Chrome 121; Linux stable since Chrome 144 | | Firefox | wgpu (Rust) | Stable on Windows (Firefox 141) and macOS Apple Silicon (Firefox 145); Linux/Android in development | | Safari | Metal | Stable across macOS/iOS/iPadOS/visionOS with Safari 26 |
Applications and outlook
References
1. W3C GPU for the Web Working Group. (2026). *WebGPU — W3C Candidate Recommendation Draft, 29 January 2026*. https://www.w3.org/TR/2026/CRD-webgpu-20260129/ 2. Ninomiya, K., Jones, B., & Blandy, J. (Eds.). (2026). *WebGPU — Editor's Draft, 25 February 2026*. https://gpuweb.github.io/gpuweb/ 3. W3C GPU for the Web Working Group. (2026). *WebGPU Implementation Status*. https://github.com/gpuweb/gpuweb/wiki/Implementation-Status 4. Baker, A., Derin, M. O., & Neto, D. (Eds.). (2026). *WebGPU Shading Language (WGSL) — W3C Candidate Recommendation Draft*. https://www.w3.org/TR/WGSL/ 5. WebGPU Working Group. (2023). *WebGPU Explainer — Why WebGPU?* https://gpuweb.github.io/gpuweb/explainer/