-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebXR] Correct WebGL content over camera feed
https://bugs.webkit.org/show_bug.cgi?id=264925 rdar://118494318 Reviewed by Dean Jackson. Bug 262774 introduced rendering for WebGL content over ARKit provided camera feed using a CAMetalLayer hosted swap chain. It was intended that the MTLSharedEvent active.completionEvent would be used to pace the frames and delay the present until the frame has been rendered in the GPUP. This didn't work and would lead to Metal preventing from processing our content for misbehaving. This patch removes blocking on completionEvent and replaces it with blocking on a semaphore. This is the same approach present in the visionOS WebXR system. While this means that we could be racing the rendering, resulting in glitches, we no long lock up. In addition, set frame views and origin correctly to make the device behave as an "interactive camera" in the WebXR scene. * Source/WebCore/platform/xr/cocoa/PlatformXRPose.cpp: (PlatformXRPose::toColumnMajorFloatArray const): * Source/WebCore/platform/xr/cocoa/PlatformXRPose.h: helper toColumnMajorFloatArray() converts simd_float4x4 into a flat float[16] for serialization. * Source/WebKit/UIProcess/XR/ios/PlatformXRARKit.mm: (WebKit::ARKitCoordinator::scheduleAnimationFrame): (WebKit::ARKitCoordinator::submitFrame): (WebKit::ARKitCoordinator::renderLoop): * Source/WebKit/UIProcess/XR/ios/WKARPresentationSession.h: * Source/WebKit/UIProcess/XR/ios/WKARPresentationSession.mm: (-[_WKARPresentationSession currentFrame]): (-[_WKARPresentationSession startFrame]): (-[_WKARPresentationSession viewDidLoad]): Vertically flip the CAMetalLayer so the WebGL is displayed the correct way up. (-[_WKARPresentationSession present]): (-[_WKARPresentationSession _loadMetal]): Remote Metal command queue and command buffer. Canonical link: https://commits.webkit.org/270848@main
- Loading branch information
Showing
5 changed files
with
46 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters