
Firefox 94 is coming out next week and brings awesome news. OpenGL EGL backend its enabled by default on Intel/AMD and recent Mesa for users on X11.
This project has been driven by Robert Mader (most of the EGL work), Andrew Osmond (glxtest fixes and config), Jamie Nicol (EGL/Android and partial damage), Greg V (partial damage support) and Jan Ikenmeyer (Darkspirit) (help with issues, testing).
Historically Linux comes with GLX (OpenGL X11 extension) but that era is finally ending and we’re moving forward to EGL which promises all the goodness you can expect from modern graphics subsystem…or you can create a texture over graphics memory at least 🙂
I’ll keep aside all EGL / GLX difference and focus to changes from user perspective. GLX is old, well debugged and tied closely to X11 which means seamless experience and wide support by gfx drivers (like proprietary NVIDIA ones). It’s used by most X11 applications and ‘just works’.
EGL is ‘new’ from Linux desktop perspective and used mainly by Wayland, Android and various small devices. It’s not fully supported by all desktop drivers and has glitches (broken rendering of transparent windows for instance). But as Wayland is gaining momentum also EGL is getting more attention and fixes on Linux desktop.
And why we actually want EGL? Because it gives us a cool toy – EGLImages (and EGLFence). EGLImage is an object which is created over a piece of GPU memory (which can be DMA-Buf), shared with different process, used as a frame buffer (target of GL rendering) or a texture (source of GL rendering).
EGLImage allows to use GPU memory in a very creative way. VA-API decoded video frames or WebGL scenes can be mapped as EGLImages, moved from decode process to rendering process and used as a texture. EGLFence allows to lock EGLImages across process so we don’t re-paint WebGL scene while it’s used in a different process or recycle VA-API video frames too early.
And what you can expect from EGL in Firefox? Faster WebGL rendering (used on Google Maps for instance), more effective rendering due to to partial damage support and potential VA-API video decoding (that’s blocked by Bug 1698778 on both Wayland and X11). It also unifies rendering path for Wayland and X11, which means X11 will gain features done for Wayland (suspended rendering for invisible windows, better VSync support and more).
NVIDIA is also working on EGL & DMA-Buf support in their proprietary drivers so there’s a hope for owners of such FOSS unfriendly hardware.
So give Firefox 94 a try. If anything goes wrong, please file a bug. You can also disable EGL and switch back to GLX. Go to about:config page and flip gfx.x11-egl.force-disabled preference and restart browser.
Wanted to ask, is layers.acceleration.force-enabled officially irrelevant now with hardware/software WebRender enabled everywhere?
LikeLike
layers.acceleration.force-enabled enables old OpenGL compositor so yes, it’s outdated.
LikeLike
WebGL Aquarium demo on firefox 93: 16 fps with 5000 fish
WebGL Aquarium demo on firefox 94: 45 fps with 5000 fish
So yep, pretty big performance improvement!
LikeLike
I don’t know how to check if things are activated, but in my case, my Firefox runs 40 fps with 500 fish on both version 93 and 94. Chrome can do that with 5000 fish, something must be wrong. I am on Intel laptop, Mesa driver, Ubuntu 21.10. Does anyone know what to do to check things out? Thanks!
LikeLike
Please file a bug at bugzilla.mozilla.org and attach your about:support there.
Thanks.
LikeLike
I did that. If someone else is interested, here is my bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1739259
LikeLike
I’m still using Fedora 33 with a Intel HD Graphics 5500 and Mesa 20.3.5. I just updated to Firefox 94 (thanks for maintening it!), and X11_EGL seems “blocklisted by gfxInfo”. Is it the expected behaviour? Is the version of Mesa shipped with Fedora 33 not supported for this?
LikeLike
Yes, blocklisted by gfxInfo means old Mesa/drivers. Fedora 34 has mesa-21.1 on so you may just update.
LikeLike
I’m getting blocklisted by gfxInfo for WEBRENDER_COMPOSITOR on Fedora 35 (mesa-21.2). Also, after upgrading to Fedora 35 (using X11), video accel broke on Intel Atom (5-Z8350). This worked fine with Firefox-94 on Fedora 34. Is something else needed for EGL to work on Fedora-35?
LikeLike
Please file a but at bugzilla.mozilla.org it can be investigated there.
Thanks.
LikeLike
I did filled a bug for Fedora 35:
https://bugzilla.redhat.com/show_bug.cgi?id=2020914
LikeLike
Please file at bugzilla.mozilla.org where X11/EGL experts are available.
Thanks.
LikeLike
Thanks a lot for your explanations on firefox-94 vs. EGL. I’m using nVidia 1030 with 470.82.00 driver and get the message “[GFX1-]: glxtest: libEGL missing eglGetDisplayDriverName” on starting firefox. I’m afraid this symbol is not declared in the nVidia 470.82 and 495.44 libEGL? Or might it be a configuration problem on my side? Do you have any hints for me. Thanks and kind regards, Ado
LikeLike
No idea. Please file a bug at bugzilla.mozilla.org (Core / Graphics::WebRender) and cc me there.
Thanks.
LikeLike
For anyone wondering where to try the acquarium benchmark, here is the link
https://webglsamples.org/aquarium-vr/aquarium-vr.html
@martin perhaps not a bad idea to show this link more prominently 🙂
LikeLike