Bug 314069

Summary: [WebXR Layers] Crashes in OpenXRLayer's endFrame() for various layer types
Product: WebKit Reporter: Sergio Villar Senin <svillar>
Component: WebXRAssignee: Sergio Villar Senin <svillar>
Status: RESOLVED FIXED    
Severity: Normal CC: djg, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Sergio Villar Senin
Reported 2026-05-05 05:31:25 PDT
OpenXRxxxLayer::endFrame() crashes in releaseImage() because acquireImage() (called inside beginFrame() via populateFrameData()) was never called for that layer in the current frame. The root cause is that beginFrame() is called from inside renderLoop(), which is called from the submitFrame() dispatch. At that point activeLayerHandles contains the **previous** frame's layer list. The new layer added by applyPendingRenderState() is only reflected in activeLayerHandles when the **next** scheduleAnimationFrame() dispatch runs which is always too late. Something like this submitFrame dispatch → endFrame() → renderLoop() → beginFrame() ↑ snapshots OLD activeLayerHandles scheduleAnimationFrame dispatch → activeLayerHandles = FRESH → renderLoop() ↑ pendingFrame=true, exits early There is a clear mismatch between the layers known by WebXR and the ones used by OpenXR to render
Attachments
Sergio Villar Senin
Comment 1 2026-05-06 08:15:46 PDT
EWS
Comment 2 2026-05-07 02:29:39 PDT
Committed 312788@main (b0baaeaf0cd8): <https://commits.webkit.org/312788@main> Reviewed commits have been landed. Closing PR #64370 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2026-05-07 02:30:14 PDT
Note You need to log in before you can comment on or make changes to this bug.