WebGLContext::BlitBackbufferToCurDriverFB blocks on background thread GL processing
Categories
(Core :: Graphics: CanvasWebGL, defect, P2)
Tracking
()
People
(Reporter: mstange, Assigned: jgilbert)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(1 external file)
The long blocking time in PWebGL::Msg_GetFrontBuffer (see bug 1820005) seems to be mostly caused by this call: mGL.GetIntAs<GLenum>(LOCAL_GL_ACTIVE_TEXTURE): https://share.firefox.dev/3SKBh2T
This is on an Apple Silicon machine.
Here's a profile taken with samply which shows the background thread work: https://share.firefox.dev/3KNkHNN
Can we avoid this mGL.GetIntAs<GLenum>(LOCAL_GL_ACTIVE_TEXTURE) call and make the new buffer available to the main thread without waiting for the background GL work?
| Reporter | ||
Comment 1•3 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #0)
Here's a profile taken with
samplywhich shows the background thread work: https://share.firefox.dev/3KNkHNN
Hmm, this URL didn't correctly apply the hidden threads. Anyway, the interesting threads here are CanvasRenderer and Thread <1256673>.
Updated•3 years ago
|
Updated•3 years ago
|
| Assignee | ||
Comment 2•3 years ago
|
||
Avoiding mGL.GetIntAs<GLenum>(LOCAL_GL_ACTIVE_TEXTURE) is super easy.
I can add a patch today, but I do expect the stall to just move elsewhere.
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 3•3 years ago
|
||
| Assignee | ||
Comment 4•3 years ago
|
||
Can you try this once it builds?
https://treeherder.mozilla.org/jobs?repo=try&revision=23e765488d80767eea45a2c89eeddca0e888bbe4
| Reporter | ||
Comment 5•3 years ago
•
|
||
The fast path doesn't seem to be hit in the React stockcharts case I was looking at, it seems like mActiveTexture might be nullopt. The profile looks the same as before: https://share.firefox.dev/3kVw8II
(I applied the patch from Phabricator locally because I wasn't ready to deal with the unsigned try build trouble on this M1 machine.)
| Assignee | ||
Comment 6•3 years ago
|
||
It's likely I think that instead, it's hitting one of the other GetInts in that function, which is what I was guessing.
Shadowing those (texture and sampler bindings) is more tricky and risky.
| Reporter | ||
Comment 7•3 years ago
|
||
I added printfs to the function and it says "fGetIntegerv(34016) took 25.4ms". 34016 is 0x84E0 which is LOCAL_GL_ACTIVE_TEXTURE.
Comment 8•3 years ago
|
||
The severity field is not set for this bug.
:jgilbert, could you have a look please?
For more information, please visit auto_nag documentation.
| Assignee | ||
Updated•2 years ago
|
Comment 9•2 years ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:jgilbert, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Updated•2 years ago
|
| Assignee | ||
Comment 10•2 years ago
|
||
The patch posted does not solve the issue. Something more invasive and risky is required.
Description
•