ovi labs

XP Max · shipped · week of

Hardware WebGPU in Chromium 160 on Windows XP

WebGPU assumes Direct3D 12, Vulkan or Metal, and Windows XP has none of them. Extending my virtual GPU's Direct3D 11 driver to Feature Level 11.1, adding a non-zero adapter LUID and bridging shared textures between ANGLE and Dawn got real hardware WebGPU rendering at 60 fps and running compute shaders on XP.

XP Max: a personal build of Windows XP with a virtual GPU (Direct3D 7, 9, 11 and OpenGL) and a compatibility layer that runs current browsers and apps · private

Windows XP shipped in 2001 with DirectX 8.1. My virtual GPU for XP Max already gave Chromium 160 hardware WebGL 1 and WebGL 2 at 60 fps through Direct3D 11. The next question was whether WebGPU could run on it too.

It now does. Chromium 160 on XP Max gets a real hardware WebGPU adapter (vendor=nvidia, architecture=lovelace, isFallbackAdapter=false), renders a live canvas at 59.1–59.8 fps, and runs GPU compute shaders with exact readback.

Chromium 160 running hardware WebGPU render and compute on Windows XP Max
Chromium 160 on Windows XP Max: a live rotating RGB triangle rendered with WebGPU (59.7 fps) alongside a 4,096-element compute shader verified with mapAsync, backed by the host RTX 4070 Ti Super through GigaMax D3D11.

What WebGPU is, and how it compares to WebGL

WebGL was built on OpenGL ES — a design from the early 1990s shaped around one global state machine. Every draw call mutates hidden context state, validation happens at draw time, and the browser has to work hard on the CPU to translate that model onto modern GPUs. Worse, WebGL has no real compute shaders: if you want general-purpose GPU math in WebGL, you have to pack numbers into textures and pretend you are drawing pixels.

WebGPU is the replacement designed around how modern GPUs actually work (Direct3D 12, Metal and Vulkan). Pipelines, shader layouts and resource bindings are compiled and validated up front into immutable objects, commands are recorded into command buffers and submitted in batches, and shaders are written in WGSL. Most importantly, WebGPU gives the browser first-class compute shaders (@compute) with read/write storage buffers and workgroup shared memory.

WebGL 1 / 2WebGPU
Underlying modelOpenGL ES global state machineModern explicit GPU APIs (D3D12 / Metal / Vulkan)
Compute shadersNone (fragment-shader texture hacks)Native @compute + read/write storage buffers
Shader languageGLSLWGSL
Validation & CPU costPer-draw state checks on the main pathUp-front immutable pipelines and bind groups
Typical native backend on WindowsANGLE over Direct3D 11Dawn over Direct3D 12 (or D3D11)

Why it matters

WebGPU is where GPU work on the web is moving. Browser-side machine learning (WebLLM, ONNX Runtime Web, Transformers.js) relies on compute shaders to run neural networks locally on the GPU instead of crawling on the CPU. Physics, particle simulations, video and audio filters, CAD tools and modern 3D engines are moving off WebGL for the same reason, and Chromium's own next-generation 2D renderer (Skia Graphite) is built on Dawn. Getting WebGPU working on XP Max means a 25-year-old operating system can run the modern GPU web natively on the host card rather than falling back to a CPU software rasterizer.

Why it did not work out of the box

On Windows, Chromium's WebGPU implementation (Dawn) defaults to Direct3D 12, and XP has no d3d12.dll and no Vulkan ICD. Firefox 160 was a dead end for a different reason: the 32-bit Windows build rejects WebGPU before choosing a backend at all (WebGPU is only available on 64-bit architectures), and its wgpu engine has no Direct3D 11 backend anyway.

Chromium's Dawn, however, does have a Direct3D 11 backend. Passing --use-webgpu-adapter=d3d11 switches Dawn onto D3D11 — and immediately exposed three gaps between our existing D3D11.0 stack (enough for ANGLE and WebGL 2) and what Dawn expects.

Chromium 160 GPU process (Windows XP Max)
+--------------------------------------------------+
| WebGL / Compositor (ANGLE)    WebGPU (Dawn)      |
|  D3D11.0 device                D3D11.1 device    |
|  creates shared BGRA tex -----> OpenSharedRes1   |
|  (NT handle + keyed mutex)     renders + compute |
+------------------+--------------------+----------+
                   |  guest dxgi.dll + d3d11.dll   |
                   +---------------+---------------+
                                   | shared memory ring (\\.\XpGpu)
Host presenter (Windows 11)        v
+--------------------------------------------------+
| d3d11host.inc -> real host D3D11.1 on RTX 4070Ti |
|  MISC_SHARED cross-device texture + KM_SYNC wait |
+--------------------------------------------------+

What had to be implemented

  1. A real adapter LUID and DXGI 1.2–1.4 (dxgi.dll). Our virtual DXGI adapter previously reported an AdapterLuid of zero. Chromium reads ANGLE's active adapter LUID and treats zero as "no GPU", aborting WebGPU before Dawn even starts (Failed to query ID3D11Device from ANGLE). Giving the adapter a fixed non-zero LUID and implementing IDXGIAdapter2/3 (GetDesc2, QueryVideoMemoryInfo) and IDXGIFactory3/4 (EnumAdapterByLuid) let Dawn find the card. Two interfaces were deliberately left unclaimed: omitting IDXGIAdapter4 tells Dawn to run fence-less (avoiding ID3D11Device5 and ID3D11Fence), and omitting IDXGIFactory2 keeps ANGLE on its existing swap-chain path.
  2. Direct3D 11.1–11.3 (d3d11.dll). Dawn asks D3D11CreateDevice specifically for {11_1, 11_0} — Feature Level 11_1 is required for WebGPU core, with ConstantBufferOffsetting reported TRUE from CheckFeatureSupport. We added FL 11_1 selection for Dawn's probe (leaving ANGLE untouched at 11_0), plus ID3D11Device1..3, ID3D11DeviceContext1..3, ID3D11Multithread, ID3DUserDefinedAnnotation, constant-buffer binding with offsets (*SetConstantBuffers1), UpdateSubresource1 and CopySubresourceRegion1, Create*View1, CreateDeviceContextState / SwapDeviceContextState, Flush1(event), and raised UAV slot counts from 8 to 64.
  3. Shared textures between ANGLE and Dawn (d3d11.dll + host presenter). Once compute shaders passed, presenting a WebGPU <canvas> crashed the GPU process: Chromium creates the canvas backing texture on ANGLE's D3D11 device with SHARED_NTHANDLE | SHARED_KEYEDMUTEX, asks it for IDXGIResource1::CreateSharedHandle, and hands that handle to Dawn's separate D3D11 device via OpenSharedResource1. We implemented IDXGIResource1 and IDXGIKeyedMutex on shared guest textures: CreateSharedHandle returns a real named kernel event encoding the texture id so Chromium can duplicate and close it normally, and OpenSharedResource1 recovers the id via NtQueryObject. Two new wire ops (OPEN_SHARED and KM_SYNC) let the host presenter map guest NT-handle textures to host MISC_SHARED textures, open them on the target host device, and synchronize on keyed-mutex release.

What was verified, and what is still rough

In a Chromium 160 VM launched with --enable-unsafe-webgpu --use-webgpu-adapter=d3d11:

  • Adapter: vendor=nvidia, architecture=lovelace, isFallbackAdapter=false, maxTextureDimension2D=16384, maxComputeInvocationsPerWorkgroup=1024, with float32-blendable, depth32float-stencil8, rg11b10ufloat-renderable, bgra8unorm-storage, texture-formats-tier1 and depth-clip-control.
  • Render: rotating RGB triangle on a bgra8unorm canvas at 59.1–59.8 fps, zero uncaptured errors, no device loss; two screenshots 2 seconds apart differ in 50.9k pixels.
  • Compute: a @workgroup_size(64) WGSL shader computing v * 2 + id across 4,096 u32 values, copied to a MAP_READ buffer and read back with mapAsync, returned 4,096 of 4,096 exact values (14, 21, 28, 35 ... 28679).
  • Regressions: d11test native passed 9/9 with 0 differing pixels, d11test presenter passed with 0 differing pixels, and WebGL 2 stayed at 60.0 fps with zero errors.

The rough edges are clear: Chromium still needs --enable-unsafe-webgpu --use-webgpu-adapter=d3d11 because D3D11 is not selected by default on Windows and the adapter sits behind Chromium's WebGPU blocklist; IDXGIKeyedMutex::ReleaseSync currently costs one host GPU wait per canvas frame; shared textures are same-process only for now; and SwapDeviceContextState swaps only the state object (fine for Dawn's dedicated device, not yet general). Even with those limits, real hardware WebGPU rendering and compute shaders now run on Windows XP.

I'm Ovi. I recompile old Windows games to run in a browser, build a virtual GPU for Windows XP, and write tools for my own machines, with AI since 2020. Projects and the latest log