v148 · origin trial · webgpu · graphics
WebGPU Compatibility Mode
An opt-in, lightly restricted subset of WebGPU that runs on older graphics APIs — OpenGL ES 3.1 and Direct3D 11 — expanding WebGPU reach to devices that cannot support the Vulkan, Metal, or D3D12 backends required by core WebGPU.
at a glance
| Status in Chrome 148 | Origin trial |
|---|---|
| Opt-in | navigator.gpu.requestAdapter({ featureLevel: "compatibility" }) |
| Older APIs supported | OpenGL ES 3.1 (Android), Direct3D 11 (Windows) |
| Spec | gpuweb compatibility-mode proposal |
| ChromeStatus | 6436406437871616 — WebGPU Compatibility Mode |
why it exists
Core WebGPU requires a modern GPU API: Vulkan on Linux and Android, Metal on macOS/iOS, or Direct3D 12 on Windows. These APIs cover most modern devices, but a significant installed base — older Android devices with only OpenGL ES 3.1 support, and older Windows PCs running D3D11 — cannot use WebGPU at all.
Compatibility mode defines a subset of WebGPU with slightly reduced limits and removed features that cannot be cleanly mapped to OpenGL ES 3.1 or D3D11. A site can request a compatibility adapter and write WebGPU code that runs on both modern and legacy hardware with minimal branching.
Source: gpuweb compatibility-mode spec proposal; blink-dev Intent to Experiment — WebGPU Compatibility Mode.shape of the API
Requesting a compatibility adapter
// Request a compatibility-mode adapter
const adapter = await navigator.gpu.requestAdapter({
featureLevel: "compatibility"
});
if (!adapter) {
// Compatibility mode not available on this device
return;
}
const device = await adapter.requestDevice();
// device operates under compatibility-mode restrictions
featureLevel values
| Value | Behaviour |
|---|---|
"core" (default) | Full WebGPU; returns null on devices that don't support Vulkan/Metal/D3D12. |
"compatibility" | Restricted WebGPU; works on OpenGL ES 3.1 and D3D11. A core adapter will also satisfy a compatibility request. |
Key restrictions in compatibility mode
Compatibility mode imposes reduced device limits and removes features that map poorly to OpenGL ES 3.1 / D3D11:
| Restriction | Detail |
|---|---|
| Reduced texture dimensions | maxTextureDimension1D/2D: 4096 (vs 8192) |
| Reduced compute workgroup size | maxComputeInvocationsPerWorkgroup: 128 (vs 256) |
| No cube array textures | GPUTextureViewDimension.cube-array unsupported |
| No compressed texture copy | copyTextureToTexture / copyTextureToBuffer not supported for compressed formats |
| No texture format reinterpretation | viewFormats must match base texture format exactly |
| No storage buffers in vertex stage | maxStorageBuffersInVertexStage: 0 |
| Uniform colour attachment blend state | All colour attachments in a draw must share the same blend state and write mask |
WGSL restrictions
| Restricted WGSL feature |
|---|
No sample_mask or sample_index builtins |
No linear interpolation or sample sampling mode |
No dpdxFine(), dpdyFine(), fwidthFine() |
No textureLoad() on depth textures |
| No non-comparison samplers on depth textures |
example
async function initWebGPU() {
// Try core WebGPU first, fall back to compatibility mode
let adapter = await navigator.gpu.requestAdapter({ featureLevel: "core" });
if (!adapter) {
adapter = await navigator.gpu.requestAdapter({ featureLevel: "compatibility" });
if (!adapter) {
console.error('WebGPU not available');
return null;
}
console.log('Using WebGPU compatibility mode');
}
const device = await adapter.requestDevice();
// Check if core features are available despite compatibility request
const isCore = adapter.featureLevelInfo?.featureLevel === "core";
return { adapter, device, isCore };
}
Source: gpuweb compatibility-mode explainer; chromestatus feature page.
browser support
| Browser | Support | Notes |
|---|---|---|
| Chrome 148 | Origin trial | Requires OT token; featureLevel API subject to change |
| Firefox | WebGPU not shipped | — |
| Safari | No signal | — |