Closed Bug 1560520 Opened 5 years ago Closed 5 years ago

Text animation is choppy with webrender enabled because of texture cache polution

Categories

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

All
Windows 10
defect

Tracking

()

VERIFIED FIXED
mozilla70
Tracking Status
firefox67 --- disabled
firefox68 --- wontfix
firefox69 --- verified
firefox70 --- verified

People

(Reporter: tbabos, Assigned: lsalzman)

References

Details

(Keywords: perf)

Attachments

(2 files)

Affected versions
Nightly 69.0a1 (2019-06-20)

Affected platforms
Windows 10 - Intel graphics card - Webrender ON

Steps to reproduce

Expected result
The text animation should be smooth as on Firefox with webrender disabled

Actual Result
Text animation is choppy, not as smooth with webrender enabled, check the recording: https://streamable.com/ig5oh

It looks like this might be a texture upload problem. The profile is a bit difficult to interpret.

Timea, do you only see this problem on Intel?

Flags: needinfo?(tbabos)

Yes, this is reproducible on Intel graphics cards:

  • Intel(R) HD Graphics 4600
  • Intel(R) UHD Graphics 620

Will check it on AMD and NVIDIA cards too.

Flags: needinfo?(tbabos)

Also reproducible on:

  • AMD RX 550
  • Nvidia Ge Force GT 730 - the animation is not loaded at all

Not reproducible on:

  • Nvidia GeForce GT 1030

This issue is also reproducible on Firefox 68.0b13 (20190624133534) with AMD R7 360 and AMD Rx 550

(In reply to Timea Babos from comment #4)

Also reproducible on:

  • AMD RX 550
  • Nvidia Ge Force GT 730 - the animation is not loaded at all

Can you file a separate bug for the animation not loading on the GT 730?

Flags: needinfo?(tbabos)

Yes, my colleague with that NVIDIA card submitted Bug 1561914.

Flags: needinfo?(tbabos)

This is also choppy on MBP with external 4K monitor. The profile shows that composites are taking between 30-40ms: https://perfht.ml/2IRTSrm.

Priority: -- → P3
Keywords: perf
See Also: → 1561914
Summary: Text animation is choppy with webrender enabled → Text animation is choppy with webrender enabled because of texture upload

Hey Lee - could you take a look at this bug please?

Flags: needinfo?(lsalzman)

The example shows an animated variation font, which means we have no choice but to re-rasterize the font every time the variation values change, since it is essentially a different ScaledFont we're working with every frame, same as Gecko would see. The glyphs in question are also extremely big, both of which are working against this.

Dzmitry, is there anything obvious we could do to make the upload suck less here?

Flags: needinfo?(lsalzman) → needinfo?(dmalyshau)

Turning on the texture cache debugging makes what I think is the problem more obvious. We're basically just blowing up the texture cache a whole bunch.

Summary: Text animation is choppy with webrender enabled because of texture upload → Text animation is choppy with webrender enabled because of texture cache polution

For bulk upload speed on Windows, I don't think there are any immediate plans to make it better. For upload on macs, swizzling would help - bug 1548339

For Jeff's observation (if it's not about swizzling at all) - sounds like we should tweak the eviction policy for re-rasterized glyphs.

Flags: needinfo?(dmalyshau)
Attachment #9077928 - Attachment description: Bug 1560520 - limit the size of WebRender's glyph cache. r?jrmuizel → Bug 1560520 - limit the size of WebRender's glyph cache. r?kvark
Blocks: wr-69
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ca1ff794e472
limit the size of WebRender's glyph cache. r=kvark
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b2f7f31d6781
limit the size of WebRender's glyph cache. r=kvark
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7596163c881a
limit the size of WebRender's glyph cache. r=kvark
Backout by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/66e163051112
Backed out changeset b2f7f31d6781 for wrench bustage. CLOSED TREE
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → lsalzman

Is this something we should consider uplifting to Beta for Fx69?

Flags: needinfo?(lsalzman)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #21)

Is this something we should consider uplifting to Beta for Fx69?

Yes. Just want to let it simmer on nightly a couple of days before we uplift.

Flags: needinfo?(lsalzman)

Comment on attachment 9077928 [details]
Bug 1560520 - limit the size of WebRender's glyph cache. r?kvark

Beta/Release Uplift Approval Request

  • User impact if declined: Jank when using pages with animated text or lots of different fonts.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Lowers memory usage of WR glyph cache to be more in line with the non-WR path, but should not otherwise change semantics of how text is rendered.
  • String changes made/needed:
Attachment #9077928 - Flags: approval-mozilla-beta?

Verified - fixed on latest Nightly 70.0a1 (2019-07-22) (64-bit) on Windows 10 with the following cards:

  • AMD RX550
  • Intel Intel(R) HD Graphics 4600
  • GeForce GT 730

Waiting for uplift to Beta.

Comment on attachment 9077928 [details]
Bug 1560520 - limit the size of WebRender's glyph cache. r?kvark

Fixes a WR memory usage regression which can cause jank when using pages with animated text or lots of different fonts. Verified by QA on Nightly. Approved for 69.0b8.

Attachment #9077928 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified - fixed on latest Beta 69.0b8 (64-bit) on Windows 10 with the following cards:

AMD RX550
Intel Intel(R) HD Graphics 4600
GeForce GT 730

Status: RESOLVED → VERIFIED
Regressions: 1569954

Hey Jeff,

We could reproduce this issue again on latest Nightly, Beta and Release on Windows with Intel, AMD and Nvidia cards. (force enbled webrender)
Now it affects all the font animations, here is a reduced testcase where it is clearly visible: https://codepen.io/MSEdgeDev/pen/mxeOGW

Disabling WebRender will solve the issue.
Should we submit a new issue or re-open this one?

Flags: needinfo?(jmuizelaar)

Please open a new bug and ideally find a regression window for when things got worse again.

Flags: needinfo?(jmuizelaar)
Blocks: 1596460

Submitted Bug 1596460 with additional info. Thanks!

See Also: → 1677551
Attached file testcase

The original URL is gone, but luckily the demos were open sourced on github, so there's a copy at https://github.com/MicrosoftEdge/Demos/blob/master/variable-fonts/index.html . It's missing the fonts though, so I had to find the decovar font separately and put it in the right place.
In this testcase I've set the font size to 159px, because otherwise we hit the 320 limit on @2x HiDPI and rasterize the font as blobs rather than glyphs.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: