Open Bug 1867791 Opened 10 months ago Updated 7 months ago

Firefox WebGL performance is poor *UNLESS* backdrop-filter: blur is used

Categories

(Core :: Graphics: CanvasWebGL, defect)

Firefox 120
defect

Tracking

()

UNCONFIRMED

People

(Reporter: haxiomic, Unassigned, NeedInfo)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:120.0) Gecko/20100101 Firefox/120.0

Steps to reproduce:

Visit https://lumalabs.ai/capture/4da7cf32-865a-4515-8cb9-9dfc574c90c2 to see WebGL website performing correctly in firefox

Visit the following link to see the same page (the above is an iframe to this page), perform terribly in Firefox

https://cdn-luma.com/public/lumalabs.ai/viewers/sparkles-20231130-9ecd360/index.html?artifacts=%7B%22light_field%22%3A%22https%3A%2F%2Fcdn-luma.com%2F1e8ad8e32de6554c4e3e6ba10f47cbe3d2d6b0513a4f53f5923346f6ca791d5e%2FArosa_H_rnli_Switzerland_light_field.zip%22%2C%22light_field_lf_meta%22%3A%22https%3A%2F%2Fcdn-luma.com%2F4a5c51177a81b42b8ffc8f75fe647a483a076a2fe97f58e56c686584496a2893%2FArosa_H_rnli_Switzerland_light_field_lf_meta.json%22%2C%22slf_model%22%3A%22https%3A%2F%2Fcdn-luma.com%2F43b76d78c222e1213afc4a3751fa4e8b0b1ed71c3999b3186e18ebff215a5b64%2FArosa_H_rnli_Switzerland_slf_model.luma%22%2C%22slf_model_bg%22%3A%22https%3A%2F%2Fcdn-luma.com%2F2e0b7f0cffdab4b3c9da8914010ce0f5e6adf7a76a965e15ac634629fadd32cf%2FArosa_H_rnli_Switzerland_slf_model_bg.luma%22%2C%22volume_model%22%3Anull%2C%22showBGByDefault%22%3Atrue%2C%22with_background%22%3A%22https%3A%2F%2Fcdn-luma.com%2F95283aa1273040105c06d2ac0d1beab461aca2fc427521df3a758602e8418800%2FArosa_H_rnli_Switzerland_with_background.mp4%22%2C%22with_background_preview%22%3A%22https%3A%2F%2Fcdn-luma.com%2F57e07e3243e3d56449e261448f9382814e8cd80224ee74b274ca7e1c926b8d71%2FArosa_H_rnli_Switzerland_with_background_preview.jpg%22%2C%22capture_meta%22%3A%7B%22date%22%3A%222023-02-15T19%3A53%3A59.000Z%22%2C%22title%22%3A%22Arosa%20H%C3%B6rnli%20-%20Switzerland%22%2C%22thumb%22%3A%22https%3A%2F%2Fcdn-luma.com%2Fb33ef8ae1a2fa375d4dc3b617da7ecc84fb21e7e3251c2954334f8306846a56a%2FArosa_H_rnli_Switzerland_thumb.jpg%22%2C%22slug%22%3A%224da7cf32-865a-4515-8cb9-9dfc574c90c2%22%2C%22username%22%3A%22splnlss%22%2C%22captureName%22%3A%22Arosa%20H%C3%B6rnli%20-%20Switzerland%22%2C%22uuid%22%3A%224da7cf32-865a-4515-8cb9-9dfc574c90c2%22%2C%22upgrade%22%3A%7B%22available%22%3Atrue%2C%22changelog%22%3A%7B%22pipeline%22%3A%5B%5D%2C%22algorithm%22%3A%5B%22Improved%20reconstruction%20for%20skies%20and%20outdoor%20scenes%22%2C%22Reduced%20floaters%20for%20interactive%20scenes%22%2C%22Minor%20improvements%20in%20reconstruction%20quality%22%5D%7D%7D%7D%2C%22point_cloud%22%3Anull%2C%22gs_web_meta%22%3A%22https%3A%2F%2Fcdn-luma.com%2Fc7980d7755442df14a345c9d82abc55b70fa742a961f71e3f8e847ddb53115d2%2FArosa_H_rnli_Switzerland_gs_web_meta.json%22%2C%22gs_web_gauss1%22%3A%22https%3A%2F%2Fcdn-luma.com%2Fbb768ed7924f5faa736ec8b2f05051d2240bb7727df5424498284382eedd5110%2FArosa_H_rnli_Switzerland_gs_web_gauss1.bin%22%2C%22gs_web_gauss2%22%3A%22https%3A%2F%2Fcdn-luma.com%2F84849989cffaf510e5a942b60d800ae0779f3384effbff8a35b0d8ed810e50b4%2FArosa_H_rnli_Switzerland_gs_web_gauss2.bin%22%2C%22gs_web_webmeta%22%3A%22https%3A%2F%2Fcdn-luma.com%2F61eb2548b939f1c180aa08fae4b8776b75e8b6f0c1a57754366426707e1da59c%2FArosa_H_rnli_Switzerland_gs_web_webmeta.json%22%2C%22gs_compressed%22%3Anull%2C%22gs_compressed_meta%22%3Anull%2C%22with_background_gs_camera_params%22%3A%22https%3A%2F%2Fcdn-luma.com%2F5624a169047f2e546f3ed1da56de5a98ecda1a305928f67a7232a2098f36a19d%2FArosa_H_rnli_Switzerland_with_background_gs_camera_params.json%22%2C%22semantics%22%3A%22https%3A%2F%2Fcdn-luma.com%2F59f8a7b305f0f06b810131ae0268d4bd60a2995b56b72a48daecd2a40a1dd507%2FArosa_H_rnli_Switzerland_semantics.bin%22%7D&src=https://cdn-luma.com/bb768ed7924f5faa736ec8b2f05051d2240bb7727df5424498284382eedd5110/Arosa_H_rnli_Switzerland_gs_web_gauss1.bin&semantics=ALL

Actual results:

Our WebGL website runs very poorly only in firefox, freezing up the whole computer and rendering 1-2 fps on high-end hardware (whereas it's 120 fps in Safari and Chrome on the same machine).

However, we can fix the issue by using backdrop-filter: blur on the webpage. I first thought this was acting as a high-power use hint for firefox but I'm starting to think it's a deeper threading edge case bug as the whole machine is brought to a crawl in the poor performance case

Expected results:

Both links load exactly the same content performance should be the same on both. One page however adds some UI which uses CSS backdrop-blur, this page performs much much better and does not lockup the machine

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: CanvasWebGL' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: CanvasWebGL
Product: Firefox → Core
Flags: needinfo?(jgilbert)

On my windows and macos systems this reduced test case looks great. What platform and hardware are you seeing poor performance on? Can you post the about:support from that device? Thanks!

Flags: needinfo?(jgilbert) → needinfo?(haxiomic)

Seeing it on macOS 13.2.1, M1 Pro Macbook though I had reports from others

The behavior suggests to me a threading issue, what's unusual about this demo compared to most WebGL content is it uses a webworker for a slow sort operation. It seems that the main thread gets blocked on this worker unless css backdrop blur is used somewhere

The poor performance page (super long link) reliably reproduces for me – I've made a video so you can see the experience

Here is a screen recording where I show the two links
https://drive.google.com/file/d/173RoICGxKXllhYGZp3Lfw1KgpIx6q__R/view?usp=sharing

The link that performs well is simply an iframe to the slow page but it adds css backdrop blur

(I have reduced the test case to confirm it the backdrop-blur is definitely the operative trigger that seems to 'fix' the performance though some means)

Flags: needinfo?(haxiomic)

Here I use the inspector to toggle backdrop-blur on and off and you can see the performance impact immediately
https://drive.google.com/file/d/1Y33G-p2F7k9ytnmMiv73mlAf1ZJGn6rP/view?usp=sharing

To reproduce, the backdrop-blur element must be visible, so I've made it 10x10px

The severity field is not set for this bug.
:jgilbert, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jgilbert)

@ahale Any ideas why backdrop-blur would help perf? Maybe because it forces synchronization, and without it we are overproducing?

Flags: needinfo?(jgilbert) → needinfo?(ahale)
You need to log in before you can comment on or make changes to this bug.