Intermittently distorted or missing glyphs on Adreno 330
Categories
(Core :: Graphics: WebRender, defect, P3)
Tracking
()
People
(Reporter: h.winnemoeller, Assigned: jnicol)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Steps to reproduce
- Set
gfx.webrender.all
totrue
andgfx.webrender.allow-partial-present-buffer-age
tofalse
(see Bug 1695771) and restart Fenix. - Open https://www.swr.de/swraktuell/rheinland-pfalz/zahl-der-corona-infizierten-in-rheinland-pfalz-100.html or https://www.swr.de/swraktuell/rheinland-pfalz/index.html or https://edition.cnn.com/
Expected result
Websites are displayed normally with all glyphs visible.
Actual result
Intermittently, glyphs are missing or distorted, see the attached images, red boxes have been added by me. gfx.webrender.allow-partial-present-buffer-age
can be set to false
(see Bug 1695771) or true
. Thus, at least changing the flag does not regress this bug further.
Device Info
Vendor and Model: Sony Xperia Z2
OS version: Android 6.0.1
GPU model: Adreno 330 (WebRender Compositing)
Number of cores: 4 (Snapdragon 801)
Fenix version
Nightly 210301 17:01 (Build #2015796169)
AC: 74.0.20210301143120, 8a55899f2
GV: 88.0a1-20210301093612
AS: 72.1.0
Reporter | ||
Comment 1•4 years ago
|
||
Example image for distorted glyphs on https://www.swr.de/swraktuell/rheinland-pfalz/index.html
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
How frequently do you see this, and is it reliably reproducible?
If you enable gfx.webrender.batched-texture-uploads
and restart, does that fix it?
Reporter | ||
Comment 3•4 years ago
|
||
While always loading https://www.swr.de/swraktuell/rheinland-pfalz/zahl-der-corona-infizierten-in-rheinland-pfalz-100.html, I did first try it on non-wr stable 86.1.1 (Build #2015794881), AC: 72.0.16, f4aa67a9c, GV: 86.0-20210222142601, AS: 67.2.0 for 10 times and force-reloading in between: no issues
Using Nightly 210310 17:03 (Build #2015797897), AC: 74.0.20210310112134, 7e3b6102a, GV: 88.0a1-20210309094921, AS: 72.1.0, and always force-reloading between steps, I saw the following results:
STR: (y = issue is present, n = issue is not present, all glyphs visible)
- Set
gfx.webrender.all
totrue
- Open https://www.swr.de/swraktuell/rheinland-pfalz/zahl-der-corona-infizierten-in-rheinland-pfalz-100.html
- y
- y (missing glyphs changed)
- y (missing glyphs changed)
- y (missing glyphs changed)
- [background-foreground Fenix]
- n
- n
- n
- n
- n
- n
- Restart Fenix
- Open https://www.swr.de/swraktuell/rheinland-pfalz/zahl-der-corona-infizierten-in-rheinland-pfalz-100.html
- y
- y (missing glyphs unchanged)
- y (missing glyphs unchanged)
- y (missing glyphs unchanged)
- y (missing glyphs unchanged)
- y (missing glyphs unchanged)
- y (missing glyphs unchanged)
- y (missing glyphs unchanged)
- y (missing glyphs unchanged)
- y (missing glyphs unchanged)
- [background-foreground Fenix]
- y (other glyphs now missing)
- y (missing glyphs unchanged)
- [background-foreground Fenix]
- y (other glyphs now missing)
- [background-foreground Fenix]
- y (same glyphs still missing)
I did not find gfx.webrender.batched-texture-uploads
but gfx.webrender.debug.batched-texture-uploads
and set the latter to true
and restarted Fenix. The results were the following:
- n
- n
- n
- n
- n
- n
- n
- n
- n
- n
- [background-foreground Fenix] -> no change
- Restart fenix
- Open https://www.swr.de/swraktuell/rheinland-pfalz/zahl-der-corona-infizierten-in-rheinland-pfalz-100.html
- n
- n
- n
- n
- n
Thus, enabling gfx.webrender.debug.batched-texture-uploads
seems to resolve the missing glyphs issue. I have tried all my regular websites and did not experience any additional issues.
Assignee | ||
Comment 4•4 years ago
•
|
||
Thanks. I suspect we might want to enable batched uploads anyway on Adreno 3xx for performance reasons, but I worry that the bug could still exist and affect users in the wild, just be much less likely to occur due to performing fewer uploads.
So I'm going to hold off on making that change for now as I'd like to figure out the underlying bug first. But feel free to keep that pref enabled for your own use.
You mention that the glyphs which are missing change occasionally when you refresh. Can you see any pattern to it? Does it happen to some glyphs more than others, or does it just seem random?
Reporter | ||
Comment 5•4 years ago
•
|
||
(In reply to Jamie Nicol [:jnicol] from comment #4)
You mention that the glyphs which are missing change occasionally when you refresh. Can you see any pattern to it? Does it happen to some glyphs more than others, or does it just seem random?
It seemed quite random which glyphs went missing but there was a pattern to the overall position of the issues. It only happened in the subelements of the website that contain graphs, not in the larger text parts. Also, I observed that some elements like "Landesweite
Neuinfektinsrate von 50" [sic] had all glyphs the moment it first was rendered, but then it went through some relayouting, jumped around and then was e.g. missing its "k"-glyph. So maybe an issue with elements that get loaded in by the website?
When Bug 1695912 and Bug 1507074 are resolved, I will start using WR as a daily driver and hopefully catch any remaining issues.
Reporter | ||
Comment 6•4 years ago
•
|
||
I've been using WR for the last 2 weeks with gfx.webrender.debug.batched-texture-uploads
set to True
and I have not seen any glyph issues although I was looking for them. I still may have missed some missing/distorted glyphs, but at least on this configuration on this device it seems to be quite rare.
Updated•4 years ago
|
Assignee | ||
Comment 7•4 years ago
|
||
Thanks for that information Henrik. I've been doing some profiling, however, and actually I'm not convinced that batched texture uploads help performance. They might in fact even hurt it slightly, though either way texture upload performance on Adreno 3xx is sub par...
So for now at least I think it's best to fix the bug with regular uploads rather than switching to batched uploads. Thankfully it didn't turn out to be very hard to figure out the issue.
I noticed that when using RGBA8 glyphs I could never reproduce the corruption, it only reproduced with (the default setting) R8 glyphs. The important difference here is the stride which we pack data in to the PBOs to upload to the texture. On Adreno we currently ensure that the stride is equivalent to 64 pixels (for performance reasons on later adreno devices). With R8 that is 64 bytes, with RGBA8 that is 256 bytes.
I verified that using R8 format glyphs and rounding to 128 bytes (or a higher power of 2) avoids the corruption, but 64 bytes or lower reproduces the corruption.
I also verified that the performance is unaffected by the stride on Adreno 3xx, unlike on Adreno 5xx and 6xx for which we added the 64-pixel alignment in the first place.
So basically, on Adreno 3xx we should align the stride to 128 bytes.
Assignee | ||
Comment 8•4 years ago
|
||
On Adreno 3xx we see intermittently corrupted or missing glyphs due to
texture uploads failing. This has only started occuring since glyphs
were switched to using R8 format textures, from RGBA8.
Due to performance reasons on other Adreno devices, we currently
ensure texture data has a stride aligned to 64 pixels. So the effect
of switching texture format is that the alignment switched from 256
bytes to 64 bytes.
It appears that PBO texture uploads must be performed with an
alignment of 128 bytes on Adreno 3xx, otherwise this corruption may
occur. Additionally, the 64 pixel requirement to hit the fast path
does not seem to apply to Adreno 3xx. Therefore this patch sets the
requirement to 128 bytes on Adreno 3xx, and leaves it as 64 pixels on
other Adreno devices.
It also renames optimal_pbo_stride to required_pbo_stride, to better
reflect the fact that this is now sometimes required for correctness
reasons, not just performance.
Updated•4 years ago
|
Comment 10•4 years ago
|
||
bugherder |
Assignee | ||
Comment 11•4 years ago
|
||
So on Adreno 300, if you don't align the stride to 128 pixels you hit this bug, and if you do align the stride to 128 pixels you hit bug 1513185. What fun! :)
(Luckily bug 1513185 no longer applies to us as we no longer use texture arrays.)
Henrik, once this patch lands in Fenix nightly I'd be grateful if you could disable batched uploads and test whether this issue is indeed resolved. Thanks!
Updated•4 years ago
|
Reporter | ||
Comment 12•4 years ago
|
||
This has now landed in Fenix Nightly 210416 17:01 (Build #2015805001), AC: 75.0.20210415213638, 4ad86e3b2, GV: 89.0a1-20210415133200, AS: 74.0.1.
Steps to reproduce
- Set
gfx.webrender.all
totrue
and ensure thatgfx.webrender.debug.batched-texture-uploads
is set tofalse
, restart Fenix. - Open https://www.swr.de/swraktuell/rheinland-pfalz/zahl-der-corona-infizierten-in-rheinland-pfalz-100.html repeatedly and check for missing or distorted glyphs, force-reload between checks, restart Fenix after 5 runs.
After 3 complete runs and 15 checks, the glyphs are all rendered correctly. Great work! :)
Reporter | ||
Updated•4 years ago
|
Description
•