← All issues

WebXR Quad layer support for OpenXR

a4de8c8

Source/WebCore/Modules/webxr/WebXRWebGLSwapchain.cpp

+bool WebXRWebGLSharedImageSwapchain::allTexturesAreBound() const
+{
+ return m_displayImagesSets.size() == m_imageCount && std::all_of(m_displayImagesSets.begin(), m_displayImagesSets.end(), [](const auto& imageSet) {
+ return imageSet && imageSet.colorBuffer.tex;
+ });
+}

Source/WebCore/Modules/webxr/XRCompositionLayer.h

- bool blendTextureSourceAlpha() const { return false; }
- void setBlendTextureSourceAlpha(bool) { }
- bool forceMonoPresentation() const { return false; }
- void setForceMonoPresentation(bool) { }
+ bool blendTextureSourceAlpha() const { return m_blendTextureSourceAlpha; }
+ void setBlendTextureSourceAlpha(bool blendTextureSourceAlpha) { m_blendTextureSourceAlpha = blendTextureSourceAlpha; }
+ bool forceMonoPresentation() const { return m_forceMonoPresentation; }
+ void setForceMonoPresentation(bool forceMonoPresentation) { m_forceMonoPresentation = forceMonoPresentation; }

WebXR Layers는 WebGL framebuffer를 거치지 않고 XR compositor에 직접 제출되는 GPU-composited XR layer를 web author가 생성할 수 있는 기능입니다. 각 layer에는 GPU texture를 소유하는 backing 객체가 있으며, GPU image의 ring buffer인 swapchain을 통해 관리됩니다. WebKit의 multi-process 아키텍처에서는 보안 격리를 위해 XR device가 UIProcess에서 동작하고, WebGL rendering은 WebProcess에서 수행됩니다. layer 생성 시에는 UIProcess에서 GPU 리소스를 할당하고 WebProcess에 LayerInfo handle을 반환하는 IPC round-trip이 필요합니다.

이 commit은 OpenXR용 WebXR Quad layer 지원을 구현하며, mono, top-bottom, left-right stereo layout을 모두 다룹니다. XRWebGLQuadLayerBacking를 추가하고, quad layer 생성에 필요한 UIProcess-WebProcess IPC 경로 전체를 연결했습니다. 또한 depth swapchain buffering 문제를 수정했습니다. 기존에는 모든 frame이 depth texture 하나를 공유했지만, 이제는 color texture와 1:1로 각각 할당됩니다.

depth buffer fix로 인해 allocation semantics이 암묵적으로 변경되었습니다. createDepthSwapchain()이 이제 UIProcess에서 전달된 LayerInfo::imageCount를 출처로 하는 m_imageCount를 사용하게 됩니다. 결과적으로 IPC를 통해 전달된 정수값이 WebProcess 내 GPU 리소스 할당을 직접 제어하는 구조가 됩니다.

🔒

New IPC-driven allocation paths and stereo/mono presentation switching surface several audit-worthy edge cases.

더 확인하려면 구독해 주세요