Large black rectangles and screen flickering on Adreno 308 Android 9 (Fix and re-enable webrender)
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
People
(Reporter: jnicol, Assigned: jnicol)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta+
|
Details | Review |
+++ This bug was initially created as a clone of Bug #1712148 +++
See https://github.com/mozilla-mobile/fenix/issues/19360
In bug 1712148 we disabled webrender for Android 9 and later on Adreno 3xx. In this bug we should find the cause, work around it, and re-enable webrender
Assignee | ||
Comment 1•3 years ago
|
||
With webrender force-enabled, this is a regression from this commit. That made us use individual TEXTURE_2D textures for picture cache tiles, rather than layers in TEXTURE_2D_ARRAY textures. The effect of this is that each tile is composited in a separate draw call rather than being batched together. This means that we repeatedly orphan the instance VBO buffer here, with identical buffer sizes.
This seems to confuse the driver, and only the first such draw call seems to succeed. Actually, my hunch is that the subsequent draw calls are performed but using the first buffer's instance data, though I haven't verified this.
Adjusting the size of each buffer so they are unique works around this, presumably by forcing the driver to realise we want a new buffer. Though this seems fragile in case subsequent unrelated draw calls happen to use the same buffer size. The more robust workaround is to rebind all the vertex attributes after orphaning the buffer. This could theoretically be costly, but I have profiled on the device and it doesn't appear to show up
Assignee | ||
Comment 2•3 years ago
|
||
It appears that unbinding and rebinding the VAO is enough to make the driver realise that the VBO has changed. I think that should be better for performance (though neither option shows up in my profiles), and it's a bit less of an invasive change, so I'll go for that.
Assignee | ||
Comment 3•3 years ago
|
||
Prior to making a draw call, we orphan the instance data VBO and
upload the new instance data in to the new buffer. In cases where the
new buffer is the same size as a previous one (as is the case when
compositing picture cache tiles), the Adreno 3xx driver gets confused
an appears to use the old orphaned data for the draw call.
To work around this, manually unbind then rebind the VAO after the
instance VBO has been orphaned. This tricks the driver in to using the
new VBO.
Assignee | ||
Comment 4•3 years ago
|
||
Webrender had previously been disabled on Adreno 3xx devices running
Android 9 due to a rendering issue caused by a driver bug. (See bug
1712148) The issue has now been identified and a workaround put in
place, so we can re-enable webrender.
Depends on D117033
Comment 6•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cb827077b061
https://hg.mozilla.org/mozilla-central/rev/6b1803f12b5d
Assignee | ||
Comment 7•3 years ago
|
||
Comment on attachment 9225640 [details]
Bug 1712290 - Rebind VAO after VBO has been orphaned on Adreno 3xx. r?#gfx-reviewers
Beta/Release Uplift Approval Request
- User impact if declined: Adreno 3xx users running Android 9 won't get webrender, therefore worse performance. Adreno 3xx users on other Android versions will receive webrender in 90, therefore it will complicate the rollout to split them.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Only changes things on affected devices, simply calls an OpenGL command to work around a driver bug.
- String changes made/needed:
Assignee | ||
Updated•3 years ago
|
Comment 8•3 years ago
|
||
Comment on attachment 9225640 [details]
Bug 1712290 - Rebind VAO after VBO has been orphaned on Adreno 3xx. r?#gfx-reviewers
approved for fenix 90.0.0-beta.3, thanks
Updated•3 years ago
|
Comment 9•3 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/70f7ac3a0743
https://hg.mozilla.org/releases/mozilla-beta/rev/01865637a319
Description
•