Closed Bug 1559284 Opened 5 years ago Closed 5 years ago

WebRender picture caching implementation results in extremely choppy YouTube videos unless the mouse cursor is actively over the viewport.

Categories

(Core :: Graphics: WebRender, defect, P2)

69 Branch
x86_64
Windows 10
defect

Tracking

()

VERIFIED FIXED
mozilla69
Tracking Status
firefox-esr60 --- unaffected
firefox67 --- unaffected
firefox68 --- unaffected
firefox69 + verified

People

(Reporter: Ross.McCluskie, Assigned: sotaro)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0

Steps to reproduce:

Latest Nightly build. WebRender in use.

Open any YouTube video - preferebably of reasonable quality.

Note when the cursor is over the video viewport the playback will be as expected.

When you remove the cursor from the viewport it will immediately become very choppy and stuttery. Stats for Nerds shows no dropped frames.

Confirmed to be in relation to 1558106 as when gfx.webrender.picture-caching is set to false the issue is resolved.

Actual results:

Moving the cursor away from the video viewport results in massive reduction in video playback performance.

Expected results:

Video would playback as expected. Expected results can be reproduced by setting gfx.webrender.picture-caching to false (and restarting Firefox).

OS: Unspecified → Windows 10
Regressed by: 1558106
Hardware: Unspecified → x86_64

This sounds like it might be related to the code that checks if a tile can be cached at all (cache tiles get disabled when there is content that contains a video). I don't see anything immediately obvious in the patch above that would have changed how that is handled. I'll do a local build now and see I can reproduce here locally.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core

This reproduces on a Windows build, but not on a Linux build. Doing local builds of both now to see what the difference is.

I wonder if the problem might happen when only update is an update of WebRenderTextureHostWrapper. In this case, native texture is updated outside of WR. In this case, aMaybeFastTxn.InvalidateRenderedFrame() forces frame rendering in next generate frame. update_document() make sure WR frame rendering by "doc.rendered_frame_is_valid".

https://dxr.mozilla.org/mozilla-central/source/gfx/layers/wr/AsyncImagePipelineManager.cpp#321
https://dxr.mozilla.org/mozilla-central/source/gfx/wr/webrender/src/render_backend.rs#1446

Yes, I think it will be related to this. The picture caching code does have a special case to avoid caching when it encounters a tile that has a native / external image affecting it though. This check should be applying here, but I suspect it's not working.

Oh wait, I see what you mean - it completely skips the frame build altogether in this case, right? Hmm, yes, that's going to break with picture caching if I understand that code fragment correctly...

Sotaro is exactly right about the cause of this. The optimization above means the picture caching code doesn't run, which means we end up with stale tiles. Sotaro will temporarily disable this optimization for now, as a quick fix, and we will work out a better long term fix.

Assignee: nobody → sotaro.ikeda.g

This issue is also happening with Twitter videos as well. Cursor over the video doesn't fix the issue like YouTube however

Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
See Also: → 1558678
Blocks: 1559294

Created Bug 1559294, for re-enable fast path for async native texture updates

Pushed by sikeda@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/37cdc2b89e3c
Disable fast path for async native texture updates r=gw
Blocks: wr-69
Severity: normal → major
Priority: -- → P2

Looks like this fix is only aimed towards Webrender. I checked with Webrender disabled and the YT videos are also bugged for me with 20190613 NIGHTLY.

(In reply to gixxpunk from comment #14)

Looks like this fix is only aimed towards Webrender. I checked with Webrender disabled and the YT videos are also bugged for me with 20190613 NIGHTLY.

Please open about:support and check the value of "Compositing". If it's not "WebRender", please file a new bug. Thanks!

Tracking this for 69 for now as WR is still mostly opt-in. I'll bump this to blocker status if it turns out to affect non-WR also.

Severity: major → critical
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Flags: qe-verify+

Hello!
Successfully reproduced the issue using Firefox 69.0a1 (20190613215335) on Windows 10x64.
The issue is verified fixed with Firefox 69.0b6 (20190718172058) on Windows 10x64.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: