Skip to content

perf(driver): render WebGL via Mesa llvmpipe#791

Merged
Kikobeats merged 1 commit into
masterfrom
webgl
Jun 14, 2026
Merged

perf(driver): render WebGL via Mesa llvmpipe#791
Kikobeats merged 1 commit into
masterfrom
webgl

Conversation

@Kikobeats

@Kikobeats Kikobeats commented Jun 14, 2026

Copy link
Copy Markdown
Member

Swap the SwiftShader fallback for ANGLE -> system GL (--use-angle=gl), which resolves to Mesa llvmpipe. On GPU-less hosts this renders WebGL ~4x faster (measured ~7s vs ~30s for a 3D chart).

Requires Mesa (libgl1-mesa-dri) and an X display (Xvfb) so ANGLE can bind a GL surface; without one, WebGL silently falls back to a 2D view. Drops --disable-gpu/--in-process-gpu, which force SwiftShader and kill the GL surface respectively.


Note

Medium Risk
Default browser launch behavior changes for all consumers: headless Linux without Mesa/Xvfb may get weaker WebGL or 2D fallbacks instead of SwiftShader, while CI and local dev assumptions shift.

Overview
Switches default Chromium launch flags from the SwiftShader stack (--disable-gpu, --use-angle=swiftshader, --in-process-gpu) to --use-angle=gl, routing WebGL through ANGLE → system OpenGL (Mesa llvmpipe on GPU-less Linux) for much faster software WebGL. Comments in driver.js document that Mesa and a display (e.g. Xvfb) are required so ANGLE can bind a GL surface.

CI (main.yml, pull_request.yml) conditionally ensures libgl1-mesa-dri is present and runs tests under xvfb-run.

Tests stop asserting brittle chrome://gpu strings or exact SwiftShader renderer text. They now check live WebGL/WebGL2 via ANGLE (no SwiftShader), with CI-only checks for Mesa llvmpipe. Screencast tests await start(), use waitUntil: 'load', and animate the page until at least one frame is captured under the GL compositor. screenshot drops the unused cheerio devDependency.

Reviewed by Cursor Bugbot for commit dd772aa. Bugbot is set up for automated code reviews on this repo. Configure here.

@coveralls

coveralls commented Jun 14, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 87.597%webgl into master. No base build found for master.

Comment thread packages/goto/test/unit/evasions/index.js Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7929fdd. Configure here.

for (const type of ['webgl', 'webgl2']) {
const { vendor, renderer } = await read(type)
t.is(vendor, 'Google Inc. (Mesa)', type)
t.is(normalize(renderer), expected, `${type}: ${renderer}`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unpinned Mesa pinned OpenGL

Medium Severity

The new pinned WebGL renderer test normalizes the LLVM segment but requires an exact OpenGL 4.5 suffix, while CI installs unpinned libgl1-mesa-dri from apt. When the runner’s Mesa build advertises a different GL version or profile text, the test can fail without any repository change.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7929fdd. Configure here.

Swap the SwiftShader fallback for ANGLE -> system GL (--use-angle=gl),
which resolves to Mesa llvmpipe. On GPU-less hosts this renders WebGL
~4x faster (measured ~7s vs ~30s for a 3D chart).

Requires Mesa (libgl1-mesa-dri) and an X display (Xvfb) so ANGLE can
bind a GL surface; without one, WebGL silently falls back to a 2D view.
Drops --disable-gpu/--in-process-gpu, which force SwiftShader and kill
the GL surface respectively.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Kikobeats Kikobeats merged commit c803b9b into master Jun 14, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants