← Glossary

What Is WebGPU in a Browser?

WebGPU is a web API that lets a page use the device's graphics processor for rendering and general-purpose computation through a model of adapters, devices, pipelines and command queues, with capabilities that depend on the browser, operating system and hardware.

Updated:

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

AspectWebGL / WebGL 2WebGPU
Native modelOpenGL ES 2.0 / 3.0Direct3D 12, Metal, Vulkan
General computeNot native; workarounds via renderingFirst-class compute pipelines
Shader languageGLSL ESWGSL
Error modelSynchronous getError(), global stateAsynchronous validation, scoped errors
Per-object draw costMore mutable state and validation overheadExplicit pipelines can reduce CPU overhead
AvailabilityWidely supported; hardware and policy restrictions applyCurrent 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.

Frequently asked questions

Is WebGPU a browser?

No. WebGPU is an API implemented by supporting browsers. It provides a common programming model above native graphics interfaces such as Direct3D 12, Metal and Vulkan. A WebGPU browser means a browser build with a usable implementation on the current device.

Does WebGPU replace every WebGL application?

No. WebGL remains widely supported, and an existing application may have no reason to change. WebGPU adds native compute and a more explicit graphics model, but migration takes work and does not guarantee faster performance. Many applications still need a fallback for unsupported environments.

Can browser settings restrict GPU capabilities?

Yes. Disabled hardware acceleration, enterprise policies, privacy modes and feature flags can remove WebGPU entirely or return no adapter. Even when available, the adapter's limits, optional features and identifying information vary by browser, driver and hardware, so pages must detect them at runtime.

Why does WebGPU require HTTPS?

WebGPU is restricted to secure contexts to reduce exposure of powerful capabilities to pages delivered over insecure connections. HTTPS is the normal production route; localhost can qualify during development. This restriction does not make all HTTPS code trustworthy or remove the need for browser validation.

Does WebGPU reveal my exact graphics card?

That depends on the implementation. Adapter information can include a vendor, architecture, device identifier and description, but browsers may limit or omit fields. It is unsafe to assume either a precise model disclosure or complete anonymity: available features and performance can provide additional clues.