Skip to content

ui: Enable webgl rendering by default#4746

Open
stevegolton wants to merge 19 commits intomainfrom
dev/sg/webgl-default
Open

ui: Enable webgl rendering by default#4746
stevegolton wants to merge 19 commits intomainfrom
dev/sg/webgl-default

Conversation

@stevegolton
Copy link
Member

@stevegolton stevegolton commented Feb 10, 2026

This PR simply flips the WebGL rendering flag on by default. If WebGL is not supported, we silently fallback to the canvas renderer, which is what's used when the flag is off anyway.

@stevegolton stevegolton requested a review from a team as a code owner February 10, 2026 16:36
@LalitMaganti
Copy link
Member

Really great job on this! Excited for this to be a headline feature for the next release :)

@github-actions
Copy link

github-actions bot commented Feb 10, 2026

🎨 Perfetto UI Builds

@stevegolton stevegolton force-pushed the dev/sg/webgl-default branch 2 times, most recently from 30e7234 to f4a1144 Compare February 12, 2026 10:22
@stevegolton
Copy link
Member Author

stevegolton commented Feb 16, 2026

CI Testing Notes

  • Chrome on the CI seems to want to run using Swiftshader as a WebGL fallback.
  • Swiftshader is a software rasterizer built into Chrome that's designed to be used for compositing and as a WebGL fallback when no hardware GPU is present.
# Testing Swiftshader on cloudtop
/opt/google/chrome/chrome --enable-unsafe-swiftshader --use-gl=angle --use-angle=swiftshader-webgl
  • It seems Swiftshader does not support the fragment shader we use for rendering chevrons properly, as we end up with artifacts around the edges that are supposed to be discarded or transparent. It also seems to be very very slow when testing on my cloudtop at least, and really is not a practical solution. We really don't want users to end up falling back to this. CI results.

Rendering artifacts around chevrons

image

Half finished lines

image
  • The artifacts seem to be a Swiftshader issue rather than an issue with our fragment shader, as the latter works just fine with AMD, Intel, and Apple drivers.
  • Thankfully, swiftshader has now been deprecated as a WebGL fallback due to security issues and poor performance. This started being rolled out in Chrome 139 released August 5th, 2025 source source. Thus, I don't think we need to do anything special here.
  • We were using Chrome 138 version in the CI up until yesterday when I happened to update it to 145 for unrelated reasons source. This is why there was a discrepancy between cloudtop and the CI. Now, the CI runs with our canvas2d fallback by default.

Options for testing WebGL path in the CI

  1. Run swiftshader, make our fragment shaders compatible with it.
    a. It might actually be too slow to even run on the CI - we still end up with half rendered frames when the screenshot is taken.
    b. Optimizing for a rasterizer that no one is going to be running.
  2. Run a VM with a real hardware GPU.
    a. Expensive, impractical.
  3. Run an external software implementation (e.g. llvmpipe).
    a. Tests WebGL render path, not too slow, representative of real hardware.

LLVMPipe

LLVMPipe is a software rasterizer, that actually performs better than our canvas2d fallback, and more importantly, seems to be much more compliant and works with our fragment shaders without artifacts. We can use this in headless mode on our CI using EGL, but we need to install a few more packages in the container. Chrome typically blocklists LLVMPipe as a GPU driver, so we must pass --ignore-gpu-blocklist.

# Testing LLVMPipe on cloudtop: 
/opt/google/chrome/chrome --ignore-gpu-blocklist

@LalitMaganti
Copy link
Member

So what's the plan in that case? Do we want to enable llvmpipe on the CI and then land this?

@stevegolton
Copy link
Member Author

So what's the plan in that case? Do we want to enable llvmpipe on the CI and then land this?

I think that makes the most sense. I'm attempting to update the CI container now.

- Add relevant packages to sandbox container
- Confiure integration tests to use llvmpipe

Test llvmpipe in chrome (again)
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