Improve radial gradient performance in swgl
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
People
(Reporter: jrmuizel, Assigned: lsalzman)
References
Details
(Keywords: perf-alert)
Attachments
(3 files)
Radial gradient are always going to be hard on the CPU. We might be able to do better, but we should try to avoid having to draw them whenever possible too.
Updated•5 years ago
|
Comment 1•5 years ago
|
||
We don't currently have a fast path for radial gradients (or conic gradients). For linear gradients, we draw a small gradient that we persist to the texture cache. This is then drawn in the main scene as an image with the assistance of the GPU scaling / filtering hardware. We should do something similar for radial gradients. There are a few complexities with things like hard stops, but it should be easy to handle the common cases at lease.
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Hey Nical, Lee thought you might be able to help here once we get the texture work landed.
Comment 3•5 years ago
|
||
Keeping the needinfo as a reminder. I want to investigate bug 1681339 first (unless someone else beats me to it), I can look into this one afterward.
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 4•5 years ago
|
||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 5•5 years ago
|
||
For right now it looks like many of the test cases use 3 or more gradient stops, so writing a simple fast-path that just deals with 2-stop gradients wouldn't have helped in these situations. However, it looks like a lot of these same test-cases use transparent colors in their stops and cause us to punt to the alpha-pass shader for gradients. This alpha-pass shader does everything including clip masking, anti-aliasing, and repetitions, which is expensive if none of those features are necessary. So as an experiment I am putting up an initial patch that seems to help with some of those cases, that if a gradient was punted to the alpha-pass only because of a transparent stop, but not because of needing any of those features, it will instead revert to using the opaque shader even though there is a blend mode active, which should alleviate some of the overhead.
| Assignee | ||
Updated•5 years ago
|
Comment 7•5 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 8•5 years ago
|
||
| Assignee | ||
Comment 9•5 years ago
|
||
Comment 10•5 years ago
|
||
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
| bugherder | ||
Comment 13•5 years ago
|
||
== Change summary for alert #28553 (as of Thu, 28 Jan 2021 07:09:11 GMT) ==
Improvements:
| Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|---|
| 4% | raptor-tp6-microsoft-firefox-cold | fcp | windows10-64-shippable-qr | nocondprof webrender | 557.83 -> 538.17 |
| 3% | raptor-tp6-microsoft-firefox-cold | fcp | windows10-64-shippable-qr | nocondprof webrender | 554.25 -> 538.00 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28553
Comment 14•5 years ago
|
||
== Change summary for alert #28555 (as of Thu, 28 Jan 2021 18:52:08 GMT) ==
Improvements:
| Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|---|
| 68% | rasterflood_gradient | linux64-shippable-qr | e10s stylo webrender-sw | 269.33 -> 453.17 | |
| 61% | rasterflood_gradient | windows10-64-shippable-qr | e10s stylo webrender-sw | 251.08 -> 405.33 | |
| 55% | rasterflood_gradient | macosx1014-64-shippable-qr | e10s stylo webrender-sw | 229.92 -> 356.58 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28555
| Assignee | ||
Comment 15•5 years ago
|
||
It seems that the interventions I made in this bug resulted in significant enough improvements in gradient performance that it is reasonable to close out this bug for now. It might be possible to make further improvements to gradient performance in the future if necessary via even more specialized fast-paths, but those would be better addressed as a follow-up bug rather than continuing to overload this bug.
Updated•5 years ago
|
Description
•