WebGPU is a web API that gives JavaScript running in a page access to the computer's graphics processor, both for drawing and for general-purpose computation. It is not a browser. Supporting browsers translate its operations to native interfaces such as Direct3D 12, Metal or Vulkan. The page works with WebGPU objects rather than choosing those backends itself. This makes graphics and compute workloads portable, although the capabilities available to a particular page still depend on its environment.
The phrase WebGPU browser usually just means a browser whose current version ships the API. What a page can do with it depends on three layers at once: the browser's implementation, the operating system's driver, and the graphics implementation, which may use an integrated GPU, a discrete GPU or a software fallback running on the CPU.
Adapters, Devices and Command Submission
The WebGPU API is organised as a short chain of objects. The entry point is navigator.gpu, which is absent in browsers without support, so the first line of any WebGPU program is a check that it exists. From there a page calls requestAdapter(), which resolves to a GPUAdapter representing an available graphics implementation. The request can express a preference for high performance or low power, which matters on laptops with two GPUs.
An adapter is a description, not a working connection. The page calls requestDevice() on it to obtain a GPUDevice, optionally listing required features and limits. The device is a logical, per-application handle; several applications can use the same physical GPU through separate logical devices. Browser and driver mechanisms enforce the boundaries between their resources. The adapter exposes the features and limits it can support so that an application can decide, before creating a device, whether a given texture size, buffer size or optional capability is available on this machine.
Work is not executed as it is written. The page creates a command encoder, opens a render pass or a compute pass on it, issues the drawing or dispatch calls, ends the pass, and calls finish() to produce a command buffer. Submitting the buffer schedules that encoded work on the device's queue. Many API validation failures are reported asynchronously and produce invalid objects, whose use can invalidate later operations. Some failures, including JavaScript argument conversion errors, can still throw synchronously. Error scopes and an uncaptured-error event let the application find out what went wrong after the fact.
Graphics and Compute Workloads
A pipeline is the fixed description of programmable stages that a pass will run. A render pipeline has a vertex stage, which positions vertices that are assembled into triangles and rasterised, and a fragment stage, which computes the colour of each covered pixel. Its output usually lands in a canvas. A page obtains that output surface by calling getContext("webgpu") on a canvas element, configuring it with the device and a texture format, typically the one reported as preferred for the platform, and then rendering into the canvas's current texture each frame.
A compute pipeline has a single compute stage and no canvas requirement. It reads buffers, runs the same shader function in parallel across many workgroups, and writes results back to buffers that the page can copy to a mappable staging buffer and read. This is browser GPU compute in the direct sense: sorting, image filters, physics, particle systems and machine-learning inference can run on the GPU and return numbers to JavaScript without ever drawing a pixel. WebGL lacks an equivalent general-purpose compute stage, although developers can express some computations through rendering operations.
Both pipeline kinds run shaders written in WebGPU Shading Language (WGSL), a Rust-flavoured language that is compiled by the browser into whatever the native API expects. Shader source is passed as a string to create a shader module, and compilation messages are available to the page if something fails. Bind groups connect buffers, textures and samplers to the slots a shader declares, which is how data gets in and out.
WebGPU vs WebGL
| Aspect | WebGL / WebGL 2 | WebGPU |
|---|---|---|
| Native model | OpenGL ES 2.0 / 3.0 | Direct3D 12, Metal, Vulkan |
| General compute | Not native; workarounds via rendering | First-class compute pipelines |
| Shader language | GLSL ES | WGSL |
| Error model | Synchronous getError(), global state | Asynchronous validation, scoped errors |
| Per-object draw cost | More mutable state and validation overhead | Explicit pipelines can reduce CPU overhead |
| Availability | Widely supported; hardware and policy restrictions apply | Current major browsers on supported platforms; gaps remain |
The WebGPU vs WebGL comparison is one of generation, not of replacement overnight. WebGL remains supported and has a mature library ecosystem. For a simple 2D chart or an existing WebGL product that works, there is no obligation to move. For compute-heavy or draw-call-heavy applications, native compute and potentially lower CPU overhead can justify adoption. A tiny workload may spend more time preparing and transferring data than it saves on the GPU, so representative measurements matter.
Browser Support and Environment Dependence
Support is defined per browser, per version and per platform, which is why the question is never just whether a browser supports WebGPU. A browser family may expose the API on one operating system while restricting it on another, or exclude particular drivers. Even an exposed navigator.gpu does not guarantee that requestAdapter() will return a usable adapter. A deployment should check the browsers and devices its users actually have, then test both the successful path and the fallback path. This is more reliable than selecting a renderer from a user-agent string.
There are also context restrictions. The API is available only in secure contexts, which in practice means HTTPS or localhost, and supporting implementations expose it in workers through their navigator object. Workers move JavaScript coordination away from the main thread; GPU execution is already separate from that thread.
Limits, Errors and Privacy Controls
Capabilities vary even where the API exists. The adapter's reported limits and optional features differ by hardware and driver; a page that assumes a large maximum texture dimension or a specific texture compression format will fail on machines that lack it. A device can be lost, for example after a driver reset. The application must detect that state, reacquire a usable device if possible and rebuild GPU resources, or show a recoverable error. Software fallback adapters exist on some platforms but may be too slow for the intended workload.
Hardware identity may be restricted. The adapter info object exposes vendor, architecture, device and description fields, but MDN states that browsers keep this information to a minimum because it could be used for fingerprinting, that any field may be an empty string, and that granularity differs between browsers. Enterprise policies, hardware-acceleration settings, privacy modes and feature flags can disable WebGPU entirely or hide the adapter, in which case requestAdapter() resolves to null and the page should fall back to WebGL or to CPU code. A well-written application treats the presence and the capabilities of WebGPU as runtime facts to detect, never as guarantees of the browser's name or version.