Closed Bug 1179944 Opened 7 years ago Closed 7 years ago

[webvr] Add support for Oculus 0.6.x runtime


(Core :: Graphics, defect)

Not set



Tracking Status
firefox42 --- fixed


(Reporter: vlad, Assigned: vlad)



(Whiteboard: [webvr][horizon][vrm2])


(2 files)

The Oculus 0.6.x runtime changes the way rendering is done; there is no more support for the app itself applying the distortion effect.  Instead, there is a global Oculus compositor process, and the runtime shares textures with each app where the app is supposed to render them.

This patch adds that concept of getting the textures from the oculus runtime and converting them to CompositingRenderTargets.  Then, in ContainerLayerComposite::RenderVR, if we're using an external renderer, we render to the given render targets and submit them to the Oculus compositor at the end of the call.  If a pref is set, we optionally draw the same textures using our compositor.  We could make this more efficient in the future by bypassing a lot of our own compositor setup and present, but this works for now.

The Oculus 0.6.x runtime only supports Windows; it does support OpenGL on Windows, but that path is not implemented right now -- we don't really use OpenGL on Windows anyway, and the complexity of doing that is much higher than the D3D work.

With this, we actually don't need the VR distortion effect in the compositor, but we keep it around for Oculus 0.5.x and cardboard support.
Attachment #8629047 - Flags: review?(mstange)
Oculus 0.6.x dropped support for OSX and Linux, but we want to keep it around for our own users, for a little while at least.  This patch puts back support for 0.5.x on all platforms (on Windows only if 0.6.x isn't available).  This is largely the same content as the previous gfxVROculus.cpp, just renamed, and with the dynamic linking API stuff pulled out into a separate namespace.
Attachment #8629050 - Flags: review?(mstange)
Hi Vladimir,

I am doing some Cardboard VR demos on FxOS and Android Firefox. I set canvas.webkitRequestFullscreen( { vrDisplay: vrHMD } in order to enable fullscreen and distortion effect. I find it works only on Oculus, and it doesn't work on Cardboard. Is VR distortion effect supported on these platforms? Thanks.
Whiteboard: [webvr][horizon]
Comment on attachment 8629047 [details] [diff] [review]
Add support for Oculus 0.6.0, v0

Review of attachment 8629047 [details] [diff] [review]:

I've only skimmed the ContainerRenderVR part. I noticed a few style issues (end-of-line whitespace, very long lines, if blocks without braces) but I don't think we need to fix them at this point.

::: gfx/layers/Layers.h
@@ +2267,4 @@
>      mPreTransCallbackData = closureData;
>    }
> +  const nsIntRect& GetBounds() const { return mBounds; }

I wonder why we didn't need this before. Maybe our usual Canvas Layer composition looks at the size of the ContentHost instead?
Attachment #8629047 - Flags: review?(mstange) → review+
Attachment #8629050 - Flags: review?(mstange) → review+
Whiteboard: [webvr][horizon] → [webvr][horizon][vrm2]
See Also: → 1196366
You need to log in before you can comment on or make changes to this bug.