Skip to content
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

Specify the simulated device viewport #37

Open
asajeffrey opened this issue Jul 23, 2019 · 3 comments
Open

Specify the simulated device viewport #37

asajeffrey opened this issue Jul 23, 2019 · 3 comments

Comments

@asajeffrey
Copy link

Over in web-platform-tests/wpt#18004, a test that checks that the test device viewport matches the requested resolution was reverted:

-        assert_equals(viewport.width, params.resolution.width);
-        assert_equals(viewport.height, params.resolution.height);
+        assert_greater_than_equal(viewport.width, 1);
+        assert_greater_than_equal(viewport.height, 1);

The reason for reverting it is the spec text:

// This represents the native resolution of the device, but may not reflect the viewport exposed to the page.
// https://immersive-web.github.io/webxr/#xrviewport
dictionary FakeXRDeviceResolution {
    required long width;
    required long height;
};

Can this be changed to specify that the requested resolution should be the resolution of the viewport?

The reason for wanting this is to catch a WebXR implementation bug, where the framebuffer provided to WebXR has a viewport sized to the canvas, rather than for the device (Servo had this bug until recently, which is why I added this test).

@alcooper91
Copy link
Contributor

I’m unable to find anything in the WebXR spec calling out any requirements for sizing the canvas/viewport, so the output size is largely up to the UAs. While the device has a native resolution the UA can decide to scale it up or down based on what they think is the best resolution (potentially modulo memory or other user settings). Something like this would actually be a restriction on the spec implementation and not something that the test api should be able to specify.
If you can find spec text to back either of those restrictions, let me know.

@asajeffrey
Copy link
Author

Indeed, the WebXR spec specifies the native framebuffer resolution https://immersive-web.github.io/webxr/#native-webgl-framebuffer-resolution, but not a native viewport size. I'll open an issue on the WebXR spec about this.

@asajeffrey
Copy link
Author

Filed immersive-web/webxr#777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants