Files
velzieandClaude Opus 5 d4539a168d GL on WebGPU through Mesa: the gex_wgpu driver, its harness, and a native target
Runs real OpenGL applications on WebGPU by putting Mesa's st/mesa in front of
a new Gallium driver, gex_wgpu, which lives in the mesa submodule (now
MercuryWorkshop/mesa-wink, branch gex-wgpu -- the work cannot go to upstream
Mesa, and pointing the submodule at the fork is what makes a fresh clone
build).

Working applications: SuperTuxKart, glxgears, es2gears, es2tri, glxinfo,
eglinfo, glmark2 (29 of 30 scenes), and -- through the native target --
Minecraft 1.8.8.

The guest side. libGL.so.1 with GLX over EGL, so X11 GL programs run at all;
client-side vertex arrays uploaded into scratch buffers rather than travelling
as a bogus offset; swap pacing, which took es2gears from 17 to 60 fps and cut
round trips 33x; twenty fixed-function entry points; and an extension list
generated from the Khronos registry and filtered against the guest's own
exports, replacing the three entries it used to report whatever the host had.

A native target. gex_wgpu also builds for the desktop against Dawn, with
softpipe alongside it. That turns a black canvas and a stack of wasm frame
numbers into a symbolised backtrace, a GALLIUM_TRACE of the exact st/mesa call
stream, and a reference implementation one environment variable away. Six
driver bugs came out of the first afternoon of it, every one of them
pre-existing and invisible in the browser -- see docs/gl-webgpu-handoff.md.

Signals worth more than the CTS pass rate, which is why >95% of KHR-GL33 was
passing while SuperTuxKart still looked wrong: tools/surface-diff.py compares
two backends' surfaces and erodes the difference, so rasteriser tie-breaks on
primitive edges do not drown out real ones; a refusal gate, because a declined
draw is invisible in a frame that still presents at full rate; and about
thirty self-checking probes under tests/integration/programs, each built twice
and required to agree with native Mesa.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KPX8TWunJNt4FwqbYDgTyz
2026-09-01 16:31:36 -04:00
..