Description
The following snippet seems to behave differently between the browser on the Apple Vision Pro and the Quest Browser:
let glLayer = new XRWebGLLayer(session, gl);
session.updateRenderState({ baseLayer: glLayer });
console.log(glLayer.framebufferWidth, glLayer.framebufferHeight);
On the quest browser it reports the actual framebuffer dimensions, whereas on the AVP it reports 1x1
initially. The values are correct in subsequent animation frames. This causes issues in Three.js as it stores the framebuffer size directly after creating the base layer.
From what I understand from the spec the framebuffer is created as part of the XRWebGLLayer
constructor (https://immersive-web.github.io/webxr/#dom-xrwebgllayer-xrwebgllayer). At that point the framebuffer dimensions should be known and can thus be reflected in the framebufferWidth/Height
properties. The spec also makes it clear that the framebuffer size can not be adjusted by the developer, though no mention if the WebXR implementation may adjust it on the fly or not.
Is the above snippet supposed to reliably report the framebuffer dimensions? Or are user agents allowed to adjust the framebuffer size on the fly?