Avoid doing clip/aa work in ALPHA_PASS shaders if we know we don't need it in VS
Categories
(Core :: Graphics: WebRender, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: jrmuizel, Assigned: lsalzman)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Attachments
(4 files)
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
•
|
||
init_transform_fs() is the remaining alpha-pass shader bottleneck since bug 1688104 sped up clip-masking. Most of the brush shaders have fast-paths now that gate the inner loops with a call to has_valid_transform_bounds(), so that at least in the axis-aligned case, we avoid calling init_transform_fs() for every pixel. However, in cases where things are not axis-aligned, we could do better here finding some way to constrain the init_transform_fs() overhead to only those pixels bounding each span that actually need it, while skipping it entirely for inside/opaque pixels.
Assignee | ||
Comment 2•3 years ago
|
||
The main goal of this patch is to move all the complexity of optionally
handling anti-aliasing out of the GLSL drawSpan fast-paths and into SWGL
itself into specific blend-mode handling of anti-aliasing. Mainly this
adds a swgl_antiAlias() extension to be called from the GLSL vertex shader,
after which no further involvement is necessary from the shader to work.
This also enables SWGL to better track those areas of a span that don't
need any anti-aliasing applied, and so can potentially be faster.
Some massaging of blend_pixels() was necessary to get it to inline properly
with all the extra cases added. This is mainly a consequence of the DO_AA
macro that lives inside BLEND_CASE, which is used to handle the dispatching
of new AA_BLEND_KEY and AA_MASK_BLEND_KEY cases. The parameters for these
AA modes are mostly handled in SWGL via the aa_span() function, which computes
the area of the span where non-opaque AA weights are necessary and where it can
skip over the opaque interior.
There are some incidental drive-by cleanups that were necessary of bvecs and
pack_pixels.
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
This cleans up the WR brush shaders to not have to use its own
implementation of init_transform_fs() for anti-aliasing when SWGL
is available. To enable this, most of the details of AAing have
been moved into brush.glsl to simplify the control knobs and
allow easier modifications.
With swgl_antiAlias() used, the drawSpan fast-paths no longer have to
care about whether ot not AA is enabled, so we can more easily stay
on these fast-paths without worry.
Depends on D104492
Assignee | ||
Comment 4•3 years ago
|
||
Depends on D104493
Assignee | ||
Comment 5•3 years ago
|
||
Now that most of the complicated alpha-pass features such as clip-masking and anti-aliasing
are handled in SWGL during the blend stage, most of the fast-paths are identical and only call
swgl_commitTextureLinear in a tight loop. We can do a lot better here by just moving that loop
into SWGL, not only making it faster but removing all the redundant boiler-plate code out of
the shaders.
Depends on D104494
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b9dce9d33351 Implement native anti-aliasing in SWGL. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/16b232a35692 Use swgl_antiAlias() in WR brush shaders. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/163ea6e7bcc2 Update reftest fuzz for SWGL anti-aliasing. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/c93691df2440 Simplify SWGL image fast-paths since complex blending is no longer required. r=jrmuizel
Comment 7•3 years ago
|
||
Backed out for causing build bustage on brush_blend.h.
Backout link: https://hg.mozilla.org/integration/autoland/rev/bbf93a0976c95c8f8e7ccdd905ff69ad3564a443
Failure log: https://treeherder.mozilla.org/logviewer?job_id=329723252&repo=autoland&lineNumber=26426
Assignee | ||
Updated•3 years ago
|
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/97bbb1c5a386 Implement native anti-aliasing in SWGL. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/2c477ec6ac24 Use swgl_antiAlias() in WR brush shaders. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/545e2c8b42ba Update reftest fuzz for SWGL anti-aliasing. r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/1602ec8392d6 Simplify SWGL image fast-paths since complex blending is no longer required. r=jrmuizel
Comment 9•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/97bbb1c5a386
https://hg.mozilla.org/mozilla-central/rev/2c477ec6ac24
https://hg.mozilla.org/mozilla-central/rev/545e2c8b42ba
https://hg.mozilla.org/mozilla-central/rev/1602ec8392d6
Comment 10•3 years ago
|
||
== Change summary for alert #28785 (as of Sat, 13 Feb 2021 07:05:08 GMT) ==
Improvements:
Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|---|
2% | rasterflood_svg | linux64-shippable-qr | e10s stylo webrender-sw | 9,549.73 -> 9,320.79 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28785
Updated•3 years ago
|
Description
•