Closed Bug 1558374 Opened 5 years ago Closed 4 years ago

Black squares artifacts on Android webrender (Mali-G71)

Categories

(Core :: Graphics: WebRender, defect, P3)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox68 --- wontfix
firefox69 --- wontfix
firefox81 --- fixed

People

(Reporter: cpeterson, Assigned: jnicol)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

Steps to reproduce

  1. Opening a website scroll and stop

Expected behavior

No black squares rendered

Actual behavior

Black squares are rendered on screen in a seemingly random distribution. On most websites it seems to be mostly around text and div borders.

Device information

Android device: Samsung S8
Fenix version: 1.0.1923 (GeckoView 68 Beta)

This bug was originally reported on the Fenix issue tracker:
https://github.com/mozilla-mobile/fenix/issues/3270

Blocks: wr-android
Component: Graphics → Graphics: WebRender
Priority: -- → P3

Important information from the user's about:support is that webrender was enabled, and that it's the Mali-G71 version of the Samsung Galaxy S8, rather than the Adreno version.

Jessie, we probably need to get our hands on one of these phones in order to fix this.

Summary: Black squares artifacts on Android → Black squares artifacts on Android webrender (Mali-G71)
Blocks: wr-mali
No longer blocks: wr-android

I am able to reliably reproduce this issue on a Mali-G72 (Honor P10), using https://github.com/rohanrhu/gdb-frontend/blob/master/run.py

One thing I noticed, is that the black areas which appear are:

  • Anchored with the page, and can only be removed by scrolling content within the page.
  • Repeated across the page. The same black area seems to appear at multiple locations within the page. (upcoming attachments)

I haven't been able to fully ascertain what is going wrong, but it appears to be a driver bug when calling glClear() to clear the picture cache textures when a scissor rect is set. When a texture is reused for a new picture cache tile (for example when scrolling), it is not cleared correctly, which is why the black pattern repeats. You can see that the black pattern sometimes resembles the shape of the text elsewhere on the page, where that texture was originally in use. Sometimes you even see bits of text from elsewhere instead of black. It's slightly dissatisfying not knowing exactly what the problem is, but I think we know enough to work around it.

We encountered a similar issue on some intel hardware in bug 1638672. We suspected at the time that the solution there (using a shader to clear the textures) might work here, but held off on applying the workaround on Mali until we could verify that was the case. I've had some more time to look at this now, and it does indeed seem to fix it, and doesn't appear to regress performance. So let's just enable the workaround rather than wasting any more time on this.

One thing I noticed while investigating this is that we set the scissor rect and enable the scissor test even when clearing the entire texture. On Mali at least, I think we might be better to do a non-scissored glclear rather than a scissored glclear (even if it wasn't buggy) or this shader-based clear.

On Mali-G71 and G72 we see artifacts when scrolling around pages, in the form of
black squares or bits of content appearing in the wrong location. This appears
to be due to a driver bug when calling glClear() to clear a picture cache tile
texture with a scissor rect set.

We encountered a similar issue on some Intel hardware in bug 1638672, and worked
around it by using a custom shader to clear the texture rather than
glClear. This change applies this work around to Mali-Gxx devices too.

Assignee: nobody → jnicol
Status: NEW → ASSIGNED
Pushed by jnicol@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9b153212cc51
Avoid using scissored glClear() on Mali-Gxx. r=kvark,geckoview-reviewers,snorp
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch

This seems fixed on my Galaxy A40. Thanks.

See Also: → 1663355
See Also: → 1816872
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: