Robots Atlas>ROBOTS ATLAS
Standard

WebGPU

2023ActivePublished: 30 November 2026Updated: 30 November 2026Published
Key innovation
Brought a modern, low-level GPU API aligned with Vulkan/Metal/Direct3D 12 to the browser โ€” with first-class general-purpose compute (GPGPU) alongside rendering โ€” as the successor to the older, OpenGL ES-based WebGL.
Category
Standard
Abstraction level
Standard
Operation level
ApplicationToolingInference
Use cases
3D graphics rendering in the browserGeneral-purpose GPU computation (GPGPU)Client-side machine-learning inference in the browserReal-time visualization and simulationBrowser-based gamesGPU-accelerated image and video processing

How it works

The entry point is navigator.gpu. You call navigator.gpu.requestAdapter() to obtain a GPUAdapter, then adapter.requestDevice() to get a GPUDevice โ€” the main interface for most WebGPU functionality. Shaders (in WGSL) are loaded via device.createShaderModule() and assembled into a pipeline: a render pipeline (GPURenderPipeline) or a compute pipeline (GPUComputePipeline). Commands are recorded with a GPUCommandEncoder (render/compute passes) and submitted to the GPU through the device.queue (GPUQueue) via submit(). To render to a canvas, you call canvas.getContext("webgpu") (returns a GPUCanvasContext) and configure the context (context.configure) with the device and a texture format (navigator.gpu.getPreferredCanvasFormat()). In a compute pipeline, a compute shader processes data in parallel across a specified number of workgroups and writes results into buffers. WebGPU requires a secure context (HTTPS).

Problem solved

The older, OpenGL ES-based WebGL did not keep up with the architecture of modern GPUs: it had limited general-purpose compute support, more overhead, and no access to advanced GPU features. WebGPU provides a modern API compatible with Vulkan/Metal/Direct3D 12, with first-class GPGPU support, faster operation, and access to newer GPU capabilities.

Components

navigator.gpu (GPU)API entry point

The WebGPU entry point exposed on navigator; provides requestAdapter() and getPreferredCanvasFormat().

GPUAdapterGPU adapter representation

Represents a GPU adapter; from it you request a GPUDevice and read adapter info, features and limits.

GPUDeviceMain access interface

A logical GPU device โ€” the main interface through which most WebGPU functionality is accessed (creating buffers, shaders, pipelines).

GPUQueueCommand execution queue

Controls execution of encoded commands on the GPU; commands are submitted via device.queue.submit().

GPUCommandEncoderCommand encoder

Encodes commands (render and compute passes) to be issued to the GPU; the finish() result is submitted to the queue.

Render pipeline (GPURenderPipeline)Graphics rendering

Renders graphics, typically into a <canvas> element, but can also render offscreen.

Official

Compute pipeline (GPUComputePipeline)General-purpose computation (GPGPU)

A general-purpose compute pipeline: a compute shader processes data in parallel across workgroups and writes the result into buffers.

Official

WGSL (WebGPU Shading Language)Shading language

A low-level, Rust-like shading language; shader code is loaded via device.createShaderModule(). It has a separate W3C specification.

GPUCanvasContextCanvas rendering surface

The WebGPU rendering context of a <canvas> element, obtained via canvas.getContext("webgpu"); configured through context.configure({ device, format }).

Official

Implementation

Implementation pitfalls
Limited browser availabilityMedium

WebGPU is not Baseline and does not work in some of the most widely-used browsers โ€” support depends on browser and platform.

Fix:Feature-detect navigator.gpu and provide a fallback (e.g. WebGL, WebAssembly or CPU computation).
Secure context (HTTPS) requiredMedium

WebGPU is only available in a secure context, so it will not work on pages served without HTTPS (other than localhost).

Fix:Serve the application over HTTPS (or use localhost during development).
requestAdapter() may return no adapterMedium

navigator.gpu may be undefined and requestAdapter() may return null when no compatible GPU/driver is present โ€” skipping this check causes runtime errors.

Fix:Check navigator.gpu and the requestAdapter() result before requesting a device.

Evolution

2021
First Public Working Draft (W3C)

W3C publishes the First Public Working Draft of the WebGPU specification (18 May 2021).

2023
WebGPU shipped by default in Chrome 113
Inflection point

WebGPU becomes available by default in Chrome 113 (ChromeOS with Vulkan, Windows with Direct3D 12, macOS) โ€” the first shipment in a major browser.

2024
W3C Candidate Recommendation Snapshot

W3C publishes the Candidate Recommendation Snapshot of the WebGPU specification (19 December 2024).

Hyperparameters (configurable axes)

Workgroup count / sizeHigh

The number of workgroups across which a compute shader processes data in parallel. Determines how GPU computation is parallelized.

Canvas context texture formatMedium

The texture format of the <canvas> context set in context.configure(). The recommended value is returned by navigator.gpu.getPreferredCanvasFormat().

navigator.gpu.getPreferredCanvasFormat()Recommended, platform-dependent canvas texture format.
Canvas context alpha modeLow

How the alpha channel is handled when compositing canvas content, set in context.configure() (e.g. "premultiplied").

premultipliedExample alphaMode value from the MDN documentation.

Hardware requirements

Good fit

WebGPU abstracts over different native GPU backends (Vulkan, Metal, Direct3D 12) independently of the card vendor; it does, however, require GPU hardware and a compatible driver.