Bug 226408

Summary: [WebXR] Recommended framebuffer width incorrectly scaled
Product: WebKit Reporter: Dean Jackson <dino>
Component: WebXRAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: adachan, ifernandez, sam, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch thorton: review+

Dean Jackson
Reported 2021-05-28 17:34:34 PDT
When WebXRWebGLLayer creates the WebXROpaqueFramebuffer, it asks the session for the recommended framebuffer size. It then multiplies the width by 2 - I assume because there are two eyes. However, the specification [1] says that it is a "best estimate of the WebGL framebuffer resolution large enough to contain all of the session’s XRViews". So it should be the session that makes account for the multiple views, not the framebuffer. Note also: "best estimate". Currently the dimensions of the framebuffer are set once as the WebGLLayer is created. I think it should be checked each frame. For example, the headset might be under load and start providing smaller textures for rendering.
Attachments
Patch (3.43 KB, patch)
2021-05-28 17:46 PDT, Dean Jackson
thorton: review+
Radar WebKit Bug Importer
Comment 1 2021-05-28 17:34:45 PDT
Dean Jackson
Comment 2 2021-05-28 17:46:31 PDT
Dean Jackson
Comment 3 2021-05-30 12:42:11 PDT
Imanol Fernandez
Comment 4 2021-05-31 02:22:37 PDT
> > Note also: "best estimate". Currently the dimensions of the framebuffer are > set once as the WebGLLayer is created. I think it should be checked each > frame. For example, the headset might be under load and start providing > smaller textures for rendering. The spec supports Dynamic viewport scaling. The benefit is that you can change the resolution on a per-frame basis without reallocating the WebGLLayer framebuffer. Right now we return nullop in WebXRView::recommendedViewportScale, so always the full viewport is used. If you have a a heuristic to determine the recommended scale per frame you can implement it already on the cocoa platform. For this to work the underlying SDK should support setting the UV rect when submitting the frame to the headset.
Note You need to log in before you can comment on or make changes to this bug.