New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test infrastructure for WebVR reftests #22840
Conversation
This PR is based on #22825 so should land after it does. |
tests/wpt/mozilla/tests/mozilla/webvr/reftests/webvr-baseline.html
Outdated
Show resolved
Hide resolved
As @jdm said on IRC (https://mozilla.logbot.info/servo/20190206#c15932019) we should get feedback from @paulrouget about whether we should enter fullscreen + use the browser's rAF for all devices without an external display, or whether we should add another property to the rust-webvr |
☔ The latest upstream changes (presumably #22825) made this pull request unmergeable. Please resolve the merge conflicts. |
ede4822
to
336769d
Compare
Rebased. #22825 has landed, so this can land too, once @paulrouget has commented. |
Also cc @kearwood. |
☔ The latest upstream changes (presumably #22773) made this pull request unmergeable. Please resolve the merge conflicts. |
IRC conversation with @paulrouget at https://mozilla.logbot.info/servo/20190207#c15934602 TL;DR: We should update rust-webvr to have three kinds of displays: external, internal-using-webrender, and internal-without-webrender. That last kind is used by oculusvr and googlevr. |
336769d
to
da78317
Compare
… responsible for presenting
@paul: Added a flag to rust-webvr over in servo/rust-webvr#49, and used it here to decide whether or not to do presentation inside servo. |
let js_sender = self.global().script_chan(); | ||
let address = Trusted::new(&*self); | ||
let near_init = self.depth_near.get(); | ||
let far_init = self.depth_far.get(); | ||
let pipeline_id = self.global().pipeline_id(); | ||
|
||
// For displays with no external display, we use the regular window | ||
// rAF, so we don't need to spin up a dedicated thread. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How hard would it be to make the TestDisplay sync_poses behave in a way that we would not need to have this specific code path? I'm asking because the test will cover less code by re-using the window's rAF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IRC conversation: https://mozilla.logbot.info/servo/20190208#c15940619
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed most of the comments, just got sync_poses
to deal with.
☔ The latest upstream changes (presumably #22861) made this pull request unmergeable. Please resolve the merge conflicts. |
Here are some questions:
This general approach feels a bit like a work-around to me. And ML and FxR share a similar setup, so whatever we end-up doing for ML, we will do the same for FxR. I think your approach might be incompatible with 2 parts of a longer term plan:
I'll be happy to r+ this as long as that we agree that it might be a temporary approach until we manage to make WebGL draw directly on a shared surface texture. |
I talked with Paul this morning. Adding some feedback/questions:
I agree IF we can't avoid the Magic Leap main thread limitations. Other platforms should not be affected by this. For Firefox Reality backends I think the best render path would be to use the render target provided by the SDK (e.g. the SurfaceTexture swapChain from Oculus) and make WebGL render directly to that Surface, bypassing all the extra blits required on other situations. |
The goal of minimizing the overhead of each rAF loop seems like a good one to me. AFAICT there's two sources of overhead:
I'm not sure what the trade-off is between these, e.g. how much of a bottleneck there is in waiting for WR. |
The ideal path would be that WebGL renders to a surface provided by the VR SDK (e.g a swapChain on Oculus). That would be 0 blits. Adding WR would add a extra blit in that situation., WebGL renders to a texture, and the the texture is blit on the WR surface. For the 2 blits |
Should we keep this PR open? |
This PR can close, but there may still be an issue around WebXR ref tests.@Manishearth, are there any WebXR ref tests, or are they all tests of the JS APIs? |
JS APIs only. A Webxr reftest would be interesting. |
Adds a
dom.webvr.test
pref, which puts WebVR content into fullscreen mode, so we can use our shiny new fullscreen reftesting apparatus for writing WebVR reftests../mach build -d
does not report any errors./mach test-tidy
does not report any errorsThis change is