Performance on https://old.reddit.com/r/skyrim/ is really bad with WebRender because of border-image-repeat: round fallback
Categories
(Core :: Graphics: WebRender, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: jrmuizel, Assigned: nical)
References
(Blocks 2 open bugs)
Details
Attachments
(6 files, 2 obsolete files)
Here's a profile: https://perfht.ml/2QFavJA
Reporter | ||
Comment 1•5 years ago
|
||
This seems to be caused by a large border image: https://b.thumbs.redditmedia.com/U5jlRp-3nGyTlK3j82v6t8XYlRWjS0mvh4ldtC3Yxgo.png
Reporter | ||
Comment 2•5 years ago
|
||
It would be interesting to know why this isn't being handled by bug 1409773
Reporter | ||
Comment 3•5 years ago
|
||
And the answer is because the repeat style is "round".
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Reporter | ||
Comment 5•5 years ago
|
||
For the record Chrome solves this problem by supporting image subsets. (sk_sp<SkImage> SkImage::makeSubset()
) This lets it do subimage tiling and sampling without having to make copies. We could do something similar that would eliminate the performance disaster even if we were still using blob images.
Assignee | ||
Comment 6•5 years ago
|
||
Unlike the border areas that only nead their own dimensions, the middle area of a border-image determines its repetition parameter based on the size of the borders. A new flag is provided for the brush_image shader to know whether to use the segment's own rect or look at the borders when computing the pattern's size.
Depends on D59370
Assignee | ||
Comment 7•5 years ago
|
||
It is common for a border image pattern to be exactly a multiple of its containing rect. In these cases it is important that when we compute the floor() of the number of times the pattern fits, the result lands back to the whole number. However, floating point inaccuracie can cause us to get a number of patterns almost equal to the expected whole number but slighly below, off by an epsilon, which removes an entire repetition. Worse, this can play out differently for different borders of a same rechangle because the width or height of the segment's source UVs used in the computation can be different by an epsilon while they should be equal in theory.
This patch works around the issue by biasing the floor() operation by a small amount.
Depends on D59675
Assignee | ||
Comment 8•5 years ago
|
||
Depends on D59900
Assignee | ||
Comment 9•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 11•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 12•5 years ago
|
||
Depends on D59901
Assignee | ||
Comment 13•5 years ago
|
||
The computation of the repetition depends on the aspect ratio of the segment's uv rectangle, which was previously represented by the dx/dy variables in the shader. These were mistakenly computing the ratio of the normalized uvs within the primitive's total uv rect, which was incorrect since the normalization introduces a non-uniform scale.
This patch fixes it by taking the uv size in device pixels instead of the the normalized textel rect. dx and dy are also renamed into segment_uv_size which is a more informative name.
Depends on D60487
Comment 14•5 years ago
|
||
Comment 15•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6b61867f80b1
https://hg.mozilla.org/mozilla-central/rev/834d49acd3c0
https://hg.mozilla.org/mozilla-central/rev/fcea11e2d25a
https://hg.mozilla.org/mozilla-central/rev/b77165c76450
https://hg.mozilla.org/mozilla-central/rev/5ad1eff4ce66
https://hg.mozilla.org/mozilla-central/rev/ee4b15857843
Assignee | ||
Comment 16•5 years ago
|
||
The page is not a blob image festival anymore and works smoothly on today's Nightly.
Updated•4 years ago
|
Description
•