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 allows web authors to create GPU-composited XR layers submitted directly to the XR compositor rather than going through the WebGL framebuffer. Each layer has a "backing" object that owns GPU textures via a swapchain — a ring buffer of GPU images. In WebKit's multi-process architecture, the XR device lives in the UIProcess for security isolation, while WebGL rendering happens in the WebProcess; layer creation requires an IPC round-trip that allocates GPU resources in UIProcess and returns a LayerInfo handle to WebProcess.
This commit implements WebXR Quad layer support for OpenXR, covering mono, top-bottom, and left-right stereo layouts. It adds XRWebGLQuadLayerBacking, wires up the full UIProcess-WebProcess IPC path for quad layer creation, and fixes depth swapchain buffering so depth textures are allocated 1:1 with color textures instead of sharing a single one across all frames.
Significance
The depth buffer fix silently changes allocation semantics: createDepthSwapchain() now uses m_imageCount sourced from the UIProcess-supplied LayerInfo::imageCount, meaning a new IPC-sourced integer drives GPU resource allocation in the WebProcess.
Audit directions
Aaa Aaaaaa Aaaa a Aaaaaa Aaaaa Aaaaaaa Aa a Aaaaa Aaaaaaaa Aaaaa Aaaaaaaaaaaaaaaaaaaaaaaa Aaa Aaaa Aaaaaaaaaaaaaa Aaaa Aaaaaaaaaaaaaaaaaa Aaaaaaaaaaaa Aa Aaaaaaaaaaaa Aa a Aa Aaaaaaaaaaaa Aaaaaa Aaa Aaaaaaaaaa Aaaa Aaaaa Aaaaaaaaaaaaaa Aa Aaaaaaaaaaaaa a Aaaaaa Aaaaaa Aaaaaaaa Aaaaaa Aa Aaaaaa Aaaaaaa Aaaaaaaaaaa Aaa Aaa Aaaaaaaaaaaaaaaaaaaaaaa Aaaa Aaaaaa a Aaaaaa Aaaaa Aa Aa Aaaaaaaa Aa Aaaa Aa Aaaaaaaa Aaa Aaaaaaaaa Aaa Aaaaaaaaa Aaa Aaaaaa Aaaaaaaaa Aaaaaaaaaaaaaa Aaa Aaaa Aaaaaaaaaaaa Aaaaaaaa Aaaa Aaaa a Aaaaa Aaaaaaa Aaaaaaaa Aaaaaaaaaaaa Aa Aaaaaaaaaaaaaaaaaaaa Aaaaaaaaa Aaaaaa Aaa Aaaaaaaa Aaaaaaa Aaaaaaa Aaaaaaaaaaaaa Aaaaaaa Aaaaaaaaaaaa Aaaaaaaaaaaaaaaaaaaaaaaaaaaaa Aa Aaaa Aa Aaaaa Aaaa Aaa Aaaaaaaaa Aaaaaaa Aaaaa Aaaaaa Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a Aaaaaaaaaa Aa Aaaaa Aaaaa Aaaaaa Aaaaa Aaaaa Aaaaaaa Aaaaaaaa Aaaaaaa Aaaaaaa
🔒New IPC-driven allocation paths and stereo/mono presentation switching surface several audit-worthy edge cases.
Subscribe to read more