moz://gfx newsletter #50

Hi there! Another gfx newsletter incoming.

Glenn and Sotaro’s work on integrating WebRender with DirectComposition on Windows is close to being ready. We hope to let it ride the trains for Firefox 75. This will lead to lower GPU usage and energy consumption. Once this is done we plan to follow up with enabling WebRender by default for Windows users with (some subset of) Intel integrated GPUs, which is both challenging (these integrated GPUs are usually slower than discrete GPUs and we have run into a number of driver bugs with them on Windows) and rewarding as it represents a very large part of the user base.

Edit: Thanks to Robert in the comments section of this post for mentioning the Linux/Wayland progress! I copy-pasted it here:

Some additional highlights for the Linux folks: Martin Stránský is making good progress on the Wayland front, especially concerning DMABUF. It will allow better performance for WebGL and hardware decoding for video (eventually). Quoting from https://bugzilla.mozilla.org/show_bug.cgi?id=1586696#c2:

> there’s a WIP dmabuf backend patch for WebGL, I see 100% performance boost with it for simple WebGL samples at GL compositor (it’s even faster than chrome/chromium on my box).

And there is active work on partial damage to reduce power consumption: https://bugzilla.mozilla.org/show_bug.cgi?id=1484812

What’s new in gfx

  • Handyman fixed fixed a crash in the async plugin infrastructure.
  • Botond fixed (2) various data races in the APZ code.
  • Sean Feng fixed another race condition in APZ code.
  • Andrew fixed a crash with OMTP and image decoding.
  • Sotaro fixed a crash with the GL compositor on Wayland.
  • Botond worked with Facebook developers to resolve a scrolling-related usability problem affecting Firefox users on messenger.com, primarily on MacOS.
  • Botond fixed (2) divisions by zero various parts of the APZ.
  • Sean Feng added some telemetry for touch input latency.
  • Timothy made sure all uses of APZCTreeManager::mGeckoFixedLayerMargins are protected by the proper mutex.
  • Boris Chiou moved animations of transforms with preserve-3d off the main thread
  • Jamie clamped some scale transforms at 32k to avoid excessively large rasterized areas.
  • Jonathan Kew reduced the emboldening strength used for synthetic-bold faces with FreeType.
  • Andrew implemented NEON accelerated methods for unpacking RGB to RGBA/BGRA.
  • Alex Henrie fixed a bug in Moz2D’s Skia backend.

What’s new in WebRender

WebRender is a GPU based 2D rendering engine for the web written in Rust, currently powering Firefox‘s rendering engine as well as Mozilla’s research web browser servo.

  • Miko avoided calculating snapped bounds twice for some display items.
  • Kris fixed snapping and rounding errors causing picture caching invalidation when zoomed in.
  • Glenn fixed a picture caching invalidation bug.
  • Kvark ensured shader programs are bound after changing the blend mode. While not necessary for OpenGL, this makes it easier to efficiently implement backends for vulkan and other modern GPU APIs.
  • Glenn refactored the OS compositor abstraction.
  • Jamie implemented a texture upload path that plays better with Adreno OpenGL drivers.
  • Jonathan Kew reduced the emboldening strength used for synthetic-bold faces with FreeType.
  • Nical prevented invalid glyphs from generating expensive rasterization requests every frame.
  • Nical reduced the number of memory allocations associated with clip chain stacks.
  • Nical reduced the number of memory allocations in various parts of the picture caching code.
  • Glenn fixed a picture caching invalidation issue when scrollbars are disabled.
  • Glenn and Andrew adjusted tradeoffs between text rendering quality and performance.
  • Miko simplified some of the scene building code.
  • Jamie switched to local raster space when animating a double tap zoom to avoid uploading glyphs continuously on Android.
  • Glenn fixed an intermittent compositor surface creation bug.
  • Andrew fixed a shader compilation error on some Android devices.
  • Bert improved the way picture cache tile sizes are selected for scroll bars.
  • Gankra removed some unsafe code in wrench.
  • Glenn fixed an issue with picture cache tile merging heuristics.
  • Glenn fixed tile opacity getting out of sync with compositor surfaces.
  • Glenn added an API for tagging image descriptors as candidates for native compositor surfaces (typically video frames).
  • Sotaro followed up by tagging the approriate image descriptors on the content side.
  • Andrew removed removed pixel snapping from most shaders, now that it is handled earlier in the pipeline.
  • Glenn improved the invalidation logic for images with picture caching.
  • Glenn improved the logic to detect identical frames and skip composition.
  • Glenn fixed the shader implementation of rounded rectangles with very small radii.
  • Kris fixed misplaced text selection popup with GeckoView.
  • Markus fixed a ton of issues with WebRender/CoreAnimation integration.
  • Markus shared the depth buffer between OS compositor tiles on MacOS to save memory.
  • Sotaro fixed image bitmap canvases with WebRender.
  • Sotaro fixed a crash at the intersection between picture-in-picture and WebRender frame throttling.
  • Timothy implemented support for respecting fixed layer margins during hit-testing.
  • Timothy implemented GeckoView’s setVerticalClipping API for WebRender.
  • Jeff fixed an SVG rendering bug.
  • Jamie fixed an issue where the screen would remain black after resuming Firefox for Android.

To enable WebRender in Firefox, in the about:config page, enable the pref gfx.webrender.all and restart the browser.

WebRender is available under the MPLv2 license as a standalone crate on crates.io (documentation) for use in your own rust projects.

What’s new in Wgpu

  • Kvark implemented buffer creation and mapping, with an ability to both provide data and read it back from the GPU.
  • Kvark set up the synchronization from Mozilla Central to Github repository.
  • jdashg created a separate category for WebGPU mochitests.
  • Kvark heavily reworked lifetime and usage tracking of resources.
  • Many fixes and improvements were made by the contributors to wgpu (thank you!)

 

20 thoughts on “moz://gfx newsletter #50

    1. Maybe eventually. The long term goal is to move all Firefox users to WebRender. For now we are concentrating on the more recent versions of OS/hardware/driver configurations.

  1. Some additional highlights for the Linux folks: Martin Stránský is making good progress on the Wayland front, especially concerning DMABUF. It will allow better performance for WebGL and hardware decoding for video (eventually). Quoting from https://bugzilla.mozilla.org/show_bug.cgi?id=1586696#c2:

    > there’s a WIP dmabuf backend patch for WebGL, I see 100% performance boost with it for simple WebGL samples at GL compositor (it’s even faster than chrome/chromium on my box).

    And there is active work on partial damage to reduce power consumption: https://bugzilla.mozilla.org/show_bug.cgi?id=1484812

    1. The about:config pref is “gfx.webrender.compositor”. You’ll have to restart the browser for the pref to take effect.

      1. How does webrender handle PC with embedded graphics(intel) with no driver installed? most non IT peoples just install a fresh OS and they are done they have no clue they need drivers for graphics performance and screen aspect ratio correction. is webrender still able to handle that scenario?

      2. WebRender currently relies on an OpenGL or D3D context with certain capabilities (these capabilities are available for the majority of Firefox’s user base but there is indeed a portion of users with too old or buggy hardware/driver configurations for WebRender to work). If the OS can’t provide the requested context, WebRender initialization fails and Firefox falls back to another rendering backend.

        Several folks in the team are working on a fully software implementation for webrender which will not boast ground breaking performance but will let WebRender work on configurations without a GPU or incompatible hardware/drivers.

  2. Hi Nical
    Thank you for the newsletter. I’m writing this reply on my hp Windows 10 1909 update laptop. with inteli7th gen. I still like reading the newsletters… even though I still have my lg Phoenix plus android phone os9. gpu adreno308. And last my Kindle Fire HD8 os lollipop android tablet And the GPU for my tablet is…. malit-720. And yes I do have google play store side loaded on my tablet. And in subject line of reports like I reported for issue adreno308 gpu gets reported as adreno3++. My issues on my phone is… that when I try to load about:config my phone using Firefox nightly preview my browser closes… no crash report just close… and on the Firefox reference browser the doesen”t just close from trying to load about:config it restarts the phone. So in short I can’t disable webrender to see if that will help. And my tablet and laptop About:config and webrender work fine.
    And yes I did report the issues with my phone before I posted here. And I have Firefox preview, Firefox nightly preview, and Firefox reference browser on both my phone and tablet. And I have Firefox Nightly on all my devices and Firefox asan build on my laptop. And yes I do have webrender enable on every thing I can.

    1. Thanks for your long time testing and support Christina. If the issue persist, I would suggest filing a bug on bugzilla.mozilla.org under the GeckoView :: General component. Someone from the GeckoView team will heopefully be able diagnose the problem with your help.

      1. Nicel thank you for replying and the newsletters. Which I still like reading.
        Thank you again for replying. But on both of my issues have all ready been reported. I reported the one for the and on google groups my user name is RoseKitsune1
        Firefox reference browser thought google groups mozilla -reference-browser. And I was sent an e-mail that my issue was filed for me at githhub 3days ago. Link https://github.com/mozilla-mobile/reference-browser/issues/986
        Im also on the Fenix Nightly using the name Rosekitsue1
        And my issue for Firefox nightly preview browser was already sent to github for me from bug I filed at bugzilla 2days ago. Using the name Christina. The url is from the bugzilla being moved for me from bugzilla to github for me.
        https://github.com/mozilla-mobile/fenix/issues/7662

      2. I did report the issues with my phone. The reference brower issue got reported 3days ago. And the Firefox nightly preview issue got reported 2days ago.

  3. I did report the issues with my phone before I posted here. The reference brower issue got reported 3days ago. And the Firefox nightly preview issue got reported 2days ago.

  4. ive noticed webrender is very difficult to disable now, ive got no idea what ive done – is this intended — false report in about support? — ive tried to troubleshoot back to dx for testing, as ive noticed some behaviors i wanted to duplicate like fullscreen videos blinking/syncing the screen increasing input latency etc, wanted to find a way to navigate through this. 18363.476 / nv 442.19 new, acer x34 dp, ss tv hdmi, expressvpn etc

    thanks

  5. also another wierd question; having bookmark toolbar icons added from the overflow menu to the same row as the address bar and the addons visable toolbar, does that create any input lag? ive noticed allot of black frames but im guessing thats just a teething thing

    1. I don’t think that the layout of the UI elements affect webrender in any significant way. Black frames sounds like bugs to me, though. Worth filing a bug on bugzilla.mozilla.org.

  6. WebRender performs really poorly on my old laptop with an Ivy Bridge CPU. The HD4000 GPU probably won’t be suitable for it ;)

    Scrolling performance is bad – it stutters and generates at least +5 degrees C more on my CPU than a similarly configured “normal” Firefox (release channel, same extensions, only with WR disabled). Enabling DirectComposition does not seem to have an effect.

    My question is — are you planning to optimize WebRender for such old chips or are you going to focus on more recent ones only? What kind of issues are you facing with Intel’s integrated graphics? Is the “advanced layers” renderer going away in the future, to be completely replaced by WebRender? Aaaaand is there a preview available of the software based WebRender implementation or is this something that’s too far into the future at this moment?

    Thanks in advance and sorry if this ain’t the right place for such inquiries :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s