Closed
Bug 1492554
Opened 6 years ago
Closed 6 years ago
Not composited canvas doesn't work in WebVR
Categories
(Core :: WebVR, defect)
Core
WebVR
Tracking
()
RESOLVED
FIXED
mozilla64
People
(Reporter: mortimergoro, Assigned: mortimergoro)
References
Details
(Whiteboard: [geckoview:fxr:p1])
Attachments
(1 file)
If we don't add a canvas to the DOM and use it in VR, FxR always renders a black screen. I tried the same on Oculus Go and it works ok. Also related problem in Firefox Reality. In Hubs (or WebVR link traversal) there is a race condition in which the canvas is not composited because when we enter VR we pause the FxR compositor. As Hubs (or link traversal) doesn't show the final canvas in a WebGL 2D scene before entering VR, the change of this issue happening is higher. Once a canvas is composited once (HTMLCanvasElement::GetCanvasLayer called), we can remove it from the DOM and it works ok during the WebVR session. I tested this on Android. It may happen also on desktop, I'll try it.
Assignee | ||
Updated•6 years ago
|
Whiteboard: [geckoview:fxr:p1]
Comment 1•6 years ago
|
||
Imanol, snorp recommends talking to Lee Salzman on the gfx team.
Assignee | ||
Comment 2•6 years ago
|
||
Lee, do you know why this could happen? We are using a WebGL canvas for WebVR, the problem is that when it's not composited at least once (e.g. not added to the DOM) all the SurfaceTextures are black, with not apparent errors. WebGL content seems right (checked via readPixels). The thing is that once the canvas is composited once., then it works ok even if removed from DOM again. Do you now if skia/compositor does something? eg. the target texture might be lazily created, etc
Flags: needinfo?(lsalzman)
Comment 3•6 years ago
|
||
(In reply to Imanol Fernandez from comment #2) > Lee, do you know why this could happen? > > We are using a WebGL canvas for WebVR, the problem is that when it's not > composited at least once (e.g. not added to the DOM) all the > SurfaceTextures are black, with not apparent errors. WebGL content seems > right (checked via readPixels). The thing is that once the canvas is > composited once., then it works ok even if removed from DOM again. > > Do you now if skia/compositor does something? eg. the target texture might > be lazily created, etc I am confused. You mention WebGL, Skia, canvas, and possibly 2D, but are you talking about Canvas2D, or something else? WebGL doesn't use Skia, and accelerated layers wouldn't be compositing it with Skia either. This would all be going through OpenGL. Can you be more specific about what's going on here, and what components are involved?
Flags: needinfo?(lsalzman)
Assignee | ||
Comment 4•6 years ago
|
||
Sorry for the confusion. I was talking about WebGL only, not Canvas2D. We thought that skia may still be involved someway for layers... But I continued the research and found that it happens because WebGLContext::InitializeCanvasRenderer is only called when 2D compositor renders it for the first time. I confirmed that the problem happens on destkop too (tested on Windows) I found a workaround trying to mimic what WebGLContext::InitializeCanvasRenderer does internally when we use the WebGLCanvas in that situation. I'll upload a patch soon.
Assignee | ||
Comment 5•6 years ago
|
||
WebGL canvases not composited (e.g. not added to the DOM) don't work in WebVR. WebGLContext::InitializeCanvasRenderer is only called when 2D compositor renders a WebGL canvas for the first time. I tried to mimic what InitializeCanvasRenderer does internally as a workaround.
Comment 6•6 years ago
|
||
I've confirmed that this fixes the issue on Windows as well (Tested in OpenVR with a Windows MR headset). Thanks for fixing this, Imanol!
Comment 7•6 years ago
|
||
Comment on attachment 9012214 [details] Bug 1492554 - Make not composited WebGL canvas work with WebVR :kip (Kearwood Gilbert) has approved the revision.
Attachment #9012214 -
Flags: review+
Updated•6 years ago
|
Assignee: nobody → imanol
Comment 8•6 years ago
|
||
Comment on attachment 9012214 [details] Bug 1492554 - Make not composited WebGL canvas work with WebVR Jeff Gilbert [:jgilbert] has approved the revision.
Attachment #9012214 -
Flags: review+
Pushed by rbarker@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9dbf3ababbfe Make not composited WebGL canvas work with WebVR r=kip,jgilbert
Comment 10•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9dbf3ababbfe
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•