Allow a single shader to decode several kinds of brush and segment data from the GPU cache
Categories
(Core :: Graphics: WebRender, task, P3)
Tracking
()
People
(Reporter: nical, Assigned: nical)
References
Details
(Keywords: perf-alert)
Attachments
(12 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
In order to add a brush shader that can render text images and solid colors, it has to be able to decode the data stored in the GPU cache, which currently depends on shader-specific #defines such as VECS_PER_SEGMENT and VECS_PER_SPECIFIC_BRUSH.
Assignee | ||
Comment 1•5 years ago
|
||
This chanes the shader parsing code to only inject #included shader sources once (the first time) if they are included multiple times.
This will allow some extra flexibility needed by the multi-brush shader.
Assignee | ||
Comment 2•5 years ago
|
||
This will allow the upcoming super-brush shader to select its behavior at runtime.
Depends on D53651
Assignee | ||
Comment 3•5 years ago
|
||
This is an experiment with only image and solid to see what the infrastructure can be like.
If it works out I'll extend the it with more brush types. More work will be needed to get text rendering in there as well.
The multi-brush shader includes all brushes that it potentially needs suport for. Which brushes actually get compiled in is then specified via WR_FEATURE defines.
Since brushes can't have the same names for their entry points, they specify the function to use via a macros (WR_BRUSH_VS_FUNCTION and WR_BRUSH_FS_FUNCTION).
TODO: VECS_PER_SPECIFIC_BRUSH needs to either be the same or be dynamically computed as well. That's not in the patch yet.
Depends on D53724
Assignee | ||
Comment 4•5 years ago
|
||
The 'multi-brush' shader will have to dynamically switch between different brushes. In order to support that without needing the sum of all brush varying locations, allow aliasing a number of generic slots.
This patch makes the assumption that one a vec2 and a vec4 cost the same amount of varying register space, which is suggested by the glsl specification about shader locations. If it is not the case we can add more granularity to the varying slots which are all vec4 at the moment. This also assumes that an unused varying is always optimized out.
Depends on D53725
Assignee | ||
Comment 5•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D53728
Assignee | ||
Comment 7•5 years ago
|
||
Depends on D53993
Assignee | ||
Comment 8•5 years ago
|
||
Depends on D53994
Assignee | ||
Comment 9•5 years ago
|
||
Depends on D53995
Assignee | ||
Comment 10•5 years ago
|
||
Depends on D53996
Assignee | ||
Comment 11•5 years ago
|
||
In GLES the default precision for ints is only 16 bits in the fragment shader.
Depends on D53998
Comment 12•5 years ago
|
||
Comment 13•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e894fff26e42
https://hg.mozilla.org/mozilla-central/rev/74554530a510
https://hg.mozilla.org/mozilla-central/rev/912718966a67
https://hg.mozilla.org/mozilla-central/rev/bb21ea50b1e9
https://hg.mozilla.org/mozilla-central/rev/0af881b4707a
https://hg.mozilla.org/mozilla-central/rev/4077b95429c0
https://hg.mozilla.org/mozilla-central/rev/a2717dc2c87b
https://hg.mozilla.org/mozilla-central/rev/a215df75f72f
https://hg.mozilla.org/mozilla-central/rev/6b339f631b3d
https://hg.mozilla.org/mozilla-central/rev/f83f356ca522
https://hg.mozilla.org/mozilla-central/rev/7a29d7acf94c
Updated•5 years ago
|
Comment 14•5 years ago
|
||
Backed out 11 changesets (bug 1594128) for several regressions
https://hg.mozilla.org/mozilla-central/rev/0a724aa35cdbb7ceef51f7af26a6aa7b5058682f
Comment 16•5 years ago
|
||
Found the root of confusion to be here:
int vecs_per_brush(int brush_kind) {
return VECS_PER_SPECIFIC_BRUSH;
}
The driver (or GLSL compiler in it) gets confused by this (seemingly useless) function and produces some garbage. Hard-coding VECS_PER_SPECIFIC_BRUSH
instead can be used to work around the issue. More specifically:
#ifndef WR_FEATURE_MULTI_BRUSH
#define MY_SUPER_VARIABLE VECS_PER_SPECIFIC_BRUSH
#endif
I added the corresponding entry to our driver issues.
Assignee | ||
Comment 17•5 years ago
|
||
The GLSL compiler appears to get confused by a function that just returns a defined constant.
See https://github.com/servo/webrender/wiki/Driver-issues#bug-1594128---glsl-on-macos-is-confused-by-a-function-that-just-returns-a-constant
Comment 18•5 years ago
|
||
Comment 19•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6762aab18459
https://hg.mozilla.org/mozilla-central/rev/6386aa316da9
https://hg.mozilla.org/mozilla-central/rev/550591122788
https://hg.mozilla.org/mozilla-central/rev/e5f6739f790d
https://hg.mozilla.org/mozilla-central/rev/ba4668d01dc5
https://hg.mozilla.org/mozilla-central/rev/0d89ea8665df
https://hg.mozilla.org/mozilla-central/rev/5768997fb391
https://hg.mozilla.org/mozilla-central/rev/54efcc9976cf
https://hg.mozilla.org/mozilla-central/rev/84e767a37637
https://hg.mozilla.org/mozilla-central/rev/beeeb1889588
https://hg.mozilla.org/mozilla-central/rev/a8ee6dbf146b
https://hg.mozilla.org/mozilla-central/rev/39f51911efa8
Comment 20•5 years ago
|
||
I can reproduce the original issue again on the 11/26 Nightly, which appears to include the workaround.
Comment 21•5 years ago
|
||
Comment 22•5 years ago
|
||
Nicolas please take a look.
Comment 23•5 years ago
|
||
Can we please avoid re-landing this until next week when nightly 73 starts? Thanks.
Comment 24•5 years ago
|
||
Assignee | ||
Comment 25•5 years ago
|
||
Can we please avoid re-landing this until next week when nightly 73 starts? Thanks.
My apologies, I missed this message. Feel free to back the patches out if you want.
Comment 26•5 years ago
|
||
Keep in mind that this bug caused some performance alerts:
Commit:
== Change summary for alert #24165 (as of Thu, 28 Nov 2019 10:00:45 GMT) ==
Regressions:
37% raptor-tp6-yahoo-mail-firefox-cold loadtime windows10-64-shippable-qr opt 1,009.42 -> 1,381.50
31% raptor-tp6-yahoo-mail-firefox-cold loadtime windows10-64-shippable-qr opt 1,058.33 -> 1,382.42
9% raptor-tp6-yahoo-mail-firefox-cold windows10-64-shippable-qr opt 535.48 -> 582.98
6% raptor-tp6-tumblr-firefox-cold loadtime windows10-64-shippable-qr opt 1,628.67 -> 1,718.75
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=24165
Backout:
== Change summary for alert #24167 (as of Thu, 28 Nov 2019 10:26:45 GMT) ==
Improvements:
28% raptor-tp6-yahoo-mail-firefox-cold loadtime windows10-64-shippable-qr opt 1,381.42 -> 995.92
28% raptor-tp6-yahoo-mail-firefox-cold loadtime windows10-64-shippable-qr opt 1,380.21 -> 996.67
8% raptor-tp6-yahoo-mail-firefox-cold windows10-64-shippable-qr opt 582.42 -> 533.90
4% raptor-tp6-wikipedia-firefox-cold windows7-32-shippable opt 1,459.28 -> 1,407.80
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=24167
Comment 27•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a1138b7e56a3
https://hg.mozilla.org/mozilla-central/rev/9e1443b6c17c
https://hg.mozilla.org/mozilla-central/rev/e55fa1d9bb89
https://hg.mozilla.org/mozilla-central/rev/e5dad5475df4
https://hg.mozilla.org/mozilla-central/rev/d4103eb1e6c5
https://hg.mozilla.org/mozilla-central/rev/dc267111d174
https://hg.mozilla.org/mozilla-central/rev/7a8c9a267876
https://hg.mozilla.org/mozilla-central/rev/2a87fc64de2f
https://hg.mozilla.org/mozilla-central/rev/ee4855adae88
https://hg.mozilla.org/mozilla-central/rev/c54980f119ab
https://hg.mozilla.org/mozilla-central/rev/576d4b85b28b
https://hg.mozilla.org/mozilla-central/rev/1bcbb2e808a7
Comment 28•5 years ago
|
||
Backed out from 72 beta as requested in bug 1600256: https://hg.mozilla.org/releases/mozilla-beta/rev/621bd2532945
Updated•5 years ago
|
Updated•5 years ago
|
Description
•