Title: [276962] trunk/Source/WebCore
Revision
276962
Author
d...@apple.com
Date
2021-05-04 10:02:18 -0700 (Tue, 04 May 2021)

Log Message

[WebXR] Move WebXROpaqueFramebuffer to its own file
https://bugs.webkit.org/show_bug.cgi?id=225334

Reviewed by Sam Weinig.

Move WebXROpaqueFramebuffer out of WebXRWebGLLayer.

* Modules/webxr/WebXROpaqueFramebuffer.cpp: Copied from Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp.
(WebCore::WebXROpaqueFramebuffer::create):
(WebCore::WebXROpaqueFramebuffer::WebXROpaqueFramebuffer):
(WebCore::WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer):
(WebCore::WebXROpaqueFramebuffer::startFrame):
(WebCore::WebXROpaqueFramebuffer::endFrame):
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
* Modules/webxr/WebXROpaqueFramebuffer.h: Copied from Source/WebCore/Modules/webxr/WebXRWebGLLayer.h.
(WebCore::WebXROpaqueFramebuffer::handle const):
(WebCore::WebXROpaqueFramebuffer::framebuffer const):
(WebCore::WebXROpaqueFramebuffer::width const):
(WebCore::WebXROpaqueFramebuffer::height const):
* Modules/webxr/WebXRWebGLLayer.cpp:
(WebCore::WebXROpaqueFramebuffer::create): Deleted.
(WebCore::WebXROpaqueFramebuffer::WebXROpaqueFramebuffer): Deleted.
(WebCore::WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer): Deleted.
(WebCore::WebXROpaqueFramebuffer::startFrame): Deleted.
(WebCore::WebXROpaqueFramebuffer::endFrame): Deleted.
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer): Deleted.
* Modules/webxr/WebXRWebGLLayer.h:
(WebCore::WebXROpaqueFramebuffer::handle const): Deleted.
(WebCore::WebXROpaqueFramebuffer::framebuffer const): Deleted.
(WebCore::WebXROpaqueFramebuffer::width const): Deleted.
(WebCore::WebXROpaqueFramebuffer::height const): Deleted.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (276961 => 276962)


--- trunk/Source/WebCore/ChangeLog	2021-05-04 16:43:33 UTC (rev 276961)
+++ trunk/Source/WebCore/ChangeLog	2021-05-04 17:02:18 UTC (rev 276962)
@@ -1,5 +1,41 @@
 2021-05-04  Dean Jackson  <d...@apple.com>
 
+        [WebXR] Move WebXROpaqueFramebuffer to its own file
+        https://bugs.webkit.org/show_bug.cgi?id=225334
+
+        Reviewed by Sam Weinig.
+
+        Move WebXROpaqueFramebuffer out of WebXRWebGLLayer.
+
+        * Modules/webxr/WebXROpaqueFramebuffer.cpp: Copied from Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp.
+        (WebCore::WebXROpaqueFramebuffer::create):
+        (WebCore::WebXROpaqueFramebuffer::WebXROpaqueFramebuffer):
+        (WebCore::WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer):
+        (WebCore::WebXROpaqueFramebuffer::startFrame):
+        (WebCore::WebXROpaqueFramebuffer::endFrame):
+        (WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
+        * Modules/webxr/WebXROpaqueFramebuffer.h: Copied from Source/WebCore/Modules/webxr/WebXRWebGLLayer.h.
+        (WebCore::WebXROpaqueFramebuffer::handle const):
+        (WebCore::WebXROpaqueFramebuffer::framebuffer const):
+        (WebCore::WebXROpaqueFramebuffer::width const):
+        (WebCore::WebXROpaqueFramebuffer::height const):
+        * Modules/webxr/WebXRWebGLLayer.cpp:
+        (WebCore::WebXROpaqueFramebuffer::create): Deleted.
+        (WebCore::WebXROpaqueFramebuffer::WebXROpaqueFramebuffer): Deleted.
+        (WebCore::WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer): Deleted.
+        (WebCore::WebXROpaqueFramebuffer::startFrame): Deleted.
+        (WebCore::WebXROpaqueFramebuffer::endFrame): Deleted.
+        (WebCore::WebXROpaqueFramebuffer::setupFramebuffer): Deleted.
+        * Modules/webxr/WebXRWebGLLayer.h:
+        (WebCore::WebXROpaqueFramebuffer::handle const): Deleted.
+        (WebCore::WebXROpaqueFramebuffer::framebuffer const): Deleted.
+        (WebCore::WebXROpaqueFramebuffer::width const): Deleted.
+        (WebCore::WebXROpaqueFramebuffer::height const): Deleted.
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
+2021-05-04  Dean Jackson  <d...@apple.com>
+
         [WebXR] Remove renamed IDL files in Xcode project
         https://bugs.webkit.org/show_bug.cgi?id=225331
 

Copied: trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp (from rev 276959, trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp) (0 => 276962)


--- trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp	2021-05-04 17:02:18 UTC (rev 276962)
@@ -0,0 +1,311 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ * Copyright (C) 2021 Apple, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXROpaqueFramebuffer.h"
+
+#if ENABLE(WEBXR)
+
+#if !USE(ANGLE)
+#include "ExtensionsGLOpenGLCommon.h"
+#endif
+#if USE(OPENGL_ES)
+#include "ExtensionsGLOpenGLES.h"
+#endif
+#if !USE(ANGLE)
+#include "GraphicsContextGL.h"
+#endif
+#include "IntSize.h"
+#if !USE(ANGLE)
+#include "TemporaryOpenGLSetting.h"
+#endif
+#include "WebGLFramebuffer.h"
+#include "WebGLRenderingContext.h"
+#if ENABLE(WEBGL2)
+#include "WebGL2RenderingContext.h"
+#endif
+#include "WebGLRenderingContextBase.h"
+#include <wtf/Scope.h>
+
+namespace WebCore {
+
+using GL = GraphicsContextGL;
+
+std::unique_ptr<WebXROpaqueFramebuffer> WebXROpaqueFramebuffer::create(PlatformXR::LayerHandle handle, WebGLRenderingContextBase& context, Attributes&& attributes, uint32_t width, uint32_t height)
+{
+    auto framebuffer = WebGLFramebuffer::createOpaque(context);
+    auto opaque = std::unique_ptr<WebXROpaqueFramebuffer>(new WebXROpaqueFramebuffer(handle, WTFMove(framebuffer), context, WTFMove(attributes), width, height));
+    if (!opaque->setupFramebuffer())
+        return nullptr;
+    return opaque;
+}
+
+WebXROpaqueFramebuffer::WebXROpaqueFramebuffer(PlatformXR::LayerHandle handle, Ref<WebGLFramebuffer>&& framebuffer, WebGLRenderingContextBase& context, Attributes&& attributes, uint32_t width, uint32_t height)
+    : m_handle(handle)
+    , m_framebuffer(WTFMove(framebuffer))
+    , m_context(context)
+    , m_attributes(WTFMove(attributes))
+    , m_width(width)
+    , m_height(height)
+{
+}
+
+WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer()
+{
+    if (auto gl = m_context.graphicsContextGL()) {
+        if (m_stencilBuffer)
+            gl->deleteRenderbuffer(m_stencilBuffer);
+        if (m_depthStencilBuffer)
+            gl->deleteRenderbuffer(m_depthStencilBuffer);
+        if (m_multisampleColorBuffer)
+            gl->deleteRenderbuffer(m_multisampleColorBuffer);
+        if (m_resolvedFBO)
+            gl->deleteFramebuffer(m_resolvedFBO);
+        m_context.deleteFramebuffer(m_framebuffer.ptr());
+    }
+}
+
+void WebXROpaqueFramebuffer::startFrame(const PlatformXR::Device::FrameData::LayerData& data)
+{
+    m_opaqueTexture = data.opaqueTexture;
+    if (!m_context.graphicsContextGL())
+        return;
+    auto& gl = *m_context.graphicsContextGL();
+
+    m_framebuffer->setOpaqueActive(true);
+
+    GCGLint boundFBO { 0 };
+
+    gl.getIntegerv(GL::FRAMEBUFFER_BINDING, makeGCGLSpan(&boundFBO, 1));
+    auto scopedFBOs = makeScopeExit([&gl, boundFBO]() {
+        gl.bindFramebuffer(GL::FRAMEBUFFER, boundFBO);
+    });
+
+    gl.bindFramebuffer(GL::FRAMEBUFFER, m_framebuffer->object());
+    // https://immersive-web.github.io/webxr/#opaque-framebuffer
+    // The buffers attached to an opaque framebuffer MUST be cleared to the values in the table below when first created,
+    // or prior to the processing of each XR animation frame.
+    std::array<const GCGLenum, 3> attachments = { GL::COLOR_ATTACHMENT0, GL::STENCIL_ATTACHMENT, GL::DEPTH_ATTACHMENT };
+    gl.invalidateFramebuffer(GL::FRAMEBUFFER, makeGCGLSpan(attachments.data(), attachments.size()));
+
+#if USE(OPENGL_ES)
+    auto& extensions = reinterpret_cast<ExtensionsGLOpenGLES&>(gl.getExtensions());
+    if (m_attributes.antialias && extensions.isImagination()) {
+        extensions.framebufferTexture2DMultisampleIMG(GL::FRAMEBUFFER, GL::COLOR_ATTACHMENT0, GL::TEXTURE_2D, m_opaqueTexture, 0, m_sampleCount);
+        return;
+    }
+#endif
+
+    if (!m_multisampleColorBuffer)
+        gl.framebufferTexture2D(GL::FRAMEBUFFER, GL::COLOR_ATTACHMENT0, GL::TEXTURE_2D, m_opaqueTexture, 0);
+}
+
+void WebXROpaqueFramebuffer::endFrame()
+{
+    m_framebuffer->setOpaqueActive(false);
+
+    if (!m_context.graphicsContextGL())
+        return;
+    auto& gl = *m_context.graphicsContextGL();
+
+    if (m_multisampleColorBuffer) {
+#if !USE(ANGLE)
+        // FIXME: These may be needed when using ANGLE, but it didn't compile in the initial implementation.
+        TemporaryOpenGLSetting scopedScissor(GL::SCISSOR_TEST, 0);
+        TemporaryOpenGLSetting scopedDither(GL::DITHER, 0);
+        TemporaryOpenGLSetting scopedDepth(GL::DEPTH_TEST, 0);
+        TemporaryOpenGLSetting scopedStencil(GL::STENCIL_TEST, 0);
+#endif
+
+        GCGLint boundReadFBO { 0 };
+        GCGLint boundDrawFBO { 0 };
+        gl.getIntegerv(GL::READ_FRAMEBUFFER_BINDING, makeGCGLSpan(&boundReadFBO, 1));
+        gl.getIntegerv(GL::DRAW_FRAMEBUFFER_BINDING, makeGCGLSpan(&boundDrawFBO, 1));
+
+        auto scopedFBOs = makeScopeExit([&gl, boundReadFBO, boundDrawFBO]() {
+            gl.bindFramebuffer(GL::READ_FRAMEBUFFER, boundReadFBO);
+            gl.bindFramebuffer(GL::DRAW_FRAMEBUFFER, boundDrawFBO);
+        });
+
+        gl.bindFramebuffer(GL::DRAW_FRAMEBUFFER, m_resolvedFBO);
+        gl.framebufferTexture2D(GL::FRAMEBUFFER, GL::COLOR_ATTACHMENT0, GL::TEXTURE_2D, m_opaqueTexture, 0);
+
+        // Resolve multisample framebuffer
+        gl.bindFramebuffer(GL::READ_FRAMEBUFFER, m_framebuffer->object());
+        gl.blitFramebuffer(0, 0, m_width, m_height, 0, 0, m_width, m_height, GL::COLOR_BUFFER_BIT, GL::LINEAR);
+    }
+    
+    gl.flush();
+}
+
+bool WebXROpaqueFramebuffer::setupFramebuffer()
+{
+    if (!m_context.graphicsContextGL())
+        return false;
+    auto& gl = *m_context.graphicsContextGL();
+
+    // Bind current FBOs when exiting the function
+    GCGLint boundFBO { 0 };
+    GCGLint boundRenderbuffer { 0 };
+    gl.getIntegerv(GL::FRAMEBUFFER_BINDING, makeGCGLSpan(&boundFBO, 1));
+    gl.getIntegerv(GL::RENDERBUFFER_BINDING, makeGCGLSpan(&boundRenderbuffer, 1));
+    auto scopedFBO = makeScopeExit([&gl, boundFBO, boundRenderbuffer]() {
+        gl.bindFramebuffer(GL::FRAMEBUFFER, boundFBO);
+        gl.bindRenderbuffer(GL::RENDERBUFFER, boundRenderbuffer);
+    });
+
+    // Set up color, depth and stencil formats
+    bool useDepthStencil = m_attributes.stencil || m_attributes.depth;
+    auto colorFormat = m_attributes.alpha ? GraphicsContextGL::RGBA8 : GraphicsContextGL::RGB8;
+#if USE(OPENGL_ES)
+    auto& extensions = reinterpret_cast<ExtensionsGLOpenGLES&>(gl.getExtensions());
+    bool supportsPackedDepthStencil = useDepthStencil && extensions.supports("GL_OES_packed_depth_stencil");
+    auto depthFormat = supportsPackedDepthStencil ? GL::DEPTH24_STENCIL8 : GL::DEPTH_COMPONENT16;
+    auto stencilFormat = GL::STENCIL_INDEX8;
+#elif USE(ANGLE)
+    // FIXME: These values were chosen just to get this to compile successfully.
+    // Make sure they are correct.
+    bool supportsPackedDepthStencil = false;
+    auto depthFormat = supportsPackedDepthStencil ? GL::DEPTH24_STENCIL8 : GL::DEPTH_COMPONENT;
+    auto stencilFormat = GL::STENCIL_INDEX8;
+#else
+    auto& extensions = reinterpret_cast<ExtensionsGLOpenGLCommon&>(gl.getExtensions());
+    bool supportsPackedDepthStencil = useDepthStencil && extensions.supports("GL_EXT_packed_depth_stencil");
+    auto depthFormat = supportsPackedDepthStencil ? GL::DEPTH24_STENCIL8 : GL::DEPTH_COMPONENT;
+    auto stencilFormat = GL::STENCIL_COMPONENT;
+#endif
+
+    // Set up recommended samples for WebXR.
+    // FIXME: check if we can get recommended values from each device platform.
+    if (m_attributes.antialias) {
+        GCGLint maxSampleCount;
+#if USE(ANGLE)
+        // FIXME: This probably is not correct.
+        maxSampleCount = 0;
+#else
+        gl.getIntegerv(ExtensionsGL::MAX_SAMPLES, makeGCGLSpan(&maxSampleCount, 1));
+#endif
+        // Using more than 4 samples might be overhead.
+        m_sampleCount = std::min(4, maxSampleCount);
+    }
+
+#if USE(OPENGL_ES)
+    // Use multisampled_render_to_texture extension if available.
+    if (m_attributes.antialias && extensions.isImagination()) {
+        // framebufferTexture2DMultisampleIMG is set up in startFrame call.
+        if (!useDepthStencil)
+            return true;
+        
+        gl.bindFramebuffer(GL::FRAMEBUFFER, m_framebuffer->object());
+        m_depthStencilBuffer = gl.createRenderbuffer();
+        if (supportsPackedDepthStencil) {
+            gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
+            extensions.renderbufferStorageMultisampleANGLE(GL::RENDERBUFFER, m_sampleCount, depthFormat, m_width, m_height);
+            if (m_attributes.stencil)
+                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
+            if (m_attributes.depth)
+                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
+        } else {
+            if (m_attributes.stencil) {
+                m_stencilBuffer = gl.createRenderbuffer();
+                gl.bindRenderbuffer(GL::RENDERBUFFER, m_stencilBuffer);
+                extensions.renderbufferStorageMultisampleANGLE(GL::RENDERBUFFER, m_sampleCount, stencilFormat, m_width, m_height);
+                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_stencilBuffer);
+            }
+            if (m_attributes.depth) {
+                gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
+                extensions.renderbufferStorageMultisampleANGLE(GL::RENDERBUFFER, m_sampleCount, depthFormat, m_width, m_height);
+                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
+            }
+        }
+        return true;
+    }
+#endif // USE(OPENGL_ES)
+
+    if (m_attributes.antialias && m_context.isWebGL2()) {
+        // Use an extra FBO for multisample if multisampled_render_to_texture is not supported.
+        m_resolvedFBO = gl.createFramebuffer();
+        m_multisampleColorBuffer = gl.createRenderbuffer();
+        gl.bindFramebuffer(GL::FRAMEBUFFER, m_framebuffer->object());
+        gl.bindRenderbuffer(GL::RENDERBUFFER, m_multisampleColorBuffer);
+        gl.renderbufferStorageMultisample(GL::RENDERBUFFER, m_sampleCount, colorFormat, m_width, m_height);
+        gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::COLOR_ATTACHMENT0, GL::RENDERBUFFER, m_multisampleColorBuffer);
+        if (useDepthStencil) {
+            m_depthStencilBuffer = gl.createRenderbuffer();
+            if (supportsPackedDepthStencil) {
+                gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
+                gl.renderbufferStorageMultisample(GL::RENDERBUFFER, m_sampleCount, depthFormat, m_width, m_height);
+                if (m_attributes.stencil)
+                    gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
+                if (m_attributes.depth)
+                    gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
+            } else {
+                if (m_attributes.stencil) {
+                    m_stencilBuffer = gl.createRenderbuffer();
+                    gl.bindRenderbuffer(GL::RENDERBUFFER, m_stencilBuffer);
+                    gl.renderbufferStorageMultisample(GL::RENDERBUFFER, m_sampleCount, stencilFormat, m_width, m_height);
+                    gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_stencilBuffer);
+                }
+                if (m_attributes.depth) {
+                    gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
+                    gl.renderbufferStorageMultisample(GL::RENDERBUFFER, m_sampleCount, depthFormat, m_width, m_height);
+                    gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
+                }
+            }
+        }
+        return gl.checkFramebufferStatus(GL::FRAMEBUFFER) == GL::FRAMEBUFFER_COMPLETE;
+    }
+    if (useDepthStencil) {
+        gl.bindFramebuffer(GL::FRAMEBUFFER, m_framebuffer->object());
+        m_depthStencilBuffer = gl.createRenderbuffer();
+        if (supportsPackedDepthStencil) {
+            gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
+            gl.renderbufferStorage(GL::RENDERBUFFER, depthFormat, m_width, m_height);
+            if (m_attributes.stencil)
+                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
+            if (m_attributes.depth)
+                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
+        } else {
+            if (m_attributes.stencil) {
+                m_stencilBuffer = gl.createRenderbuffer();
+                gl.bindRenderbuffer(GL::RENDERBUFFER, m_stencilBuffer);
+                gl.renderbufferStorage(GL::RENDERBUFFER, stencilFormat, m_width, m_height);
+                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_stencilBuffer);
+            }
+            if (m_attributes.depth) {
+                gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
+                gl.renderbufferStorage(GL::RENDERBUFFER, depthFormat, m_width, m_height);
+                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
+            }
+        }
+    }
+
+    return true;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)

Copied: trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h (from rev 276959, trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.h) (0 => 276962)


--- trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h	2021-05-04 17:02:18 UTC (rev 276962)
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ * Copyright (C) 2021 Apple, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "GraphicsTypesGL.h"
+#include "PlatformXR.h"
+#include "WebXRLayer.h"
+#include <wtf/Ref.h>
+
+namespace WebCore {
+
+class IntSize;
+class WebGLFramebuffer;
+class WebGLRenderingContextBase;
+struct XRWebGLLayerInit;
+
+class WebXROpaqueFramebuffer {
+public:
+    struct Attributes {
+        bool alpha { true };
+        bool antialias { true };
+        bool depth { true };
+        bool stencil { false };
+    };
+
+    static std::unique_ptr<WebXROpaqueFramebuffer> create(PlatformXR::LayerHandle, WebGLRenderingContextBase&, Attributes&&, uint32_t width, uint32_t height);
+    ~WebXROpaqueFramebuffer();
+
+    PlatformXR::LayerHandle handle() const { return m_handle; }
+    const WebGLFramebuffer& framebuffer() const { return m_framebuffer.get(); }
+    uint32_t width() const { return m_width; }
+    uint32_t height() const { return m_height; }
+
+    void startFrame(const PlatformXR::Device::FrameData::LayerData&);
+    void endFrame();
+
+private:
+    WebXROpaqueFramebuffer(PlatformXR::LayerHandle, Ref<WebGLFramebuffer>&&, WebGLRenderingContextBase&, Attributes&&, uint32_t width, uint32_t height);
+
+    bool setupFramebuffer();
+
+    PlatformXR::LayerHandle m_handle;
+    Ref<WebGLFramebuffer> m_framebuffer;
+    WebGLRenderingContextBase& m_context;
+    Attributes m_attributes;
+    uint32_t m_width { 0 };
+    uint32_t m_height { 0 };
+    PlatformGLObject m_depthStencilBuffer { 0 };
+    PlatformGLObject m_stencilBuffer { 0 };
+    PlatformGLObject m_multisampleColorBuffer { 0 };
+    PlatformGLObject m_resolvedFBO { 0 };
+    GCGLint m_sampleCount { 0 };
+    PlatformGLObject m_opaqueTexture { 0 };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)

Modified: trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp (276961 => 276962)


--- trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp	2021-05-04 16:43:33 UTC (rev 276961)
+++ trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp	2021-05-04 17:02:18 UTC (rev 276962)
@@ -29,12 +29,6 @@
 #if ENABLE(WEBXR)
 
 #if !USE(ANGLE)
-#include "ExtensionsGLOpenGLCommon.h"
-#endif
-#if USE(OPENGL_ES)
-#include "ExtensionsGLOpenGLES.h"
-#endif
-#if !USE(ANGLE)
 #include "GraphicsContextGL.h"
 #endif
 #include "HTMLCanvasElement.h"
@@ -50,6 +44,7 @@
 #endif
 #include "WebGLRenderingContextBase.h"
 #include "WebXRFrame.h"
+#include "WebXROpaqueFramebuffer.h"
 #include "WebXRSession.h"
 #include "WebXRView.h"
 #include "WebXRViewport.h"
@@ -59,8 +54,6 @@
 
 namespace WebCore {
 
-using GL = GraphicsContextGL;
-
 WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRWebGLLayer);
 
 // Arbitrary value for minimum framebuffer scaling.
@@ -347,260 +340,6 @@
     m_viewportsDirty = false;
 }
 
-// WebXROpaqueFramebuffer
-
-std::unique_ptr<WebXROpaqueFramebuffer> WebXROpaqueFramebuffer::create(PlatformXR::LayerHandle handle, WebGLRenderingContextBase& context, Attributes&& attributes, uint32_t width, uint32_t height)
-{
-    auto framebuffer = WebGLFramebuffer::createOpaque(context);
-    auto opaque = std::unique_ptr<WebXROpaqueFramebuffer>(new WebXROpaqueFramebuffer(handle, WTFMove(framebuffer), context, WTFMove(attributes), width, height));
-    if (!opaque->setupFramebuffer())
-        return nullptr;
-    return opaque;
-}
-
-WebXROpaqueFramebuffer::WebXROpaqueFramebuffer(PlatformXR::LayerHandle handle, Ref<WebGLFramebuffer>&& framebuffer, WebGLRenderingContextBase& context, Attributes&& attributes, uint32_t width, uint32_t height)
-    : m_handle(handle)
-    , m_framebuffer(WTFMove(framebuffer))
-    , m_context(context)
-    , m_attributes(WTFMove(attributes))
-    , m_width(width)
-    , m_height(height)
-{
-}
-
-WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer()
-{
-    if (auto gl = m_context.graphicsContextGL()) {
-        if (m_stencilBuffer)
-            gl->deleteRenderbuffer(m_stencilBuffer);
-        if (m_depthStencilBuffer)
-            gl->deleteRenderbuffer(m_depthStencilBuffer);
-        if (m_multisampleColorBuffer)
-            gl->deleteRenderbuffer(m_multisampleColorBuffer);
-        if (m_resolvedFBO)
-            gl->deleteFramebuffer(m_resolvedFBO);
-        m_context.deleteFramebuffer(m_framebuffer.ptr());
-    }
-}
-
-void WebXROpaqueFramebuffer::startFrame(const PlatformXR::Device::FrameData::LayerData& data)
-{
-    m_opaqueTexture = data.opaqueTexture;
-    if (!m_context.graphicsContextGL())
-        return;
-    auto& gl = *m_context.graphicsContextGL();
-
-    m_framebuffer->setOpaqueActive(true);
-
-    GCGLint boundFBO { 0 };
-
-    gl.getIntegerv(GL::FRAMEBUFFER_BINDING, makeGCGLSpan(&boundFBO, 1));
-    auto scopedFBOs = makeScopeExit([&gl, boundFBO]() {
-        gl.bindFramebuffer(GL::FRAMEBUFFER, boundFBO);
-    });
-
-    gl.bindFramebuffer(GL::FRAMEBUFFER, m_framebuffer->object());
-    // https://immersive-web.github.io/webxr/#opaque-framebuffer
-    // The buffers attached to an opaque framebuffer MUST be cleared to the values in the table below when first created,
-    // or prior to the processing of each XR animation frame.
-    std::array<const GCGLenum, 3> attachments = { GL::COLOR_ATTACHMENT0, GL::STENCIL_ATTACHMENT, GL::DEPTH_ATTACHMENT };
-    gl.invalidateFramebuffer(GL::FRAMEBUFFER, makeGCGLSpan(attachments.data(), attachments.size()));
-
-#if USE(OPENGL_ES)
-    auto& extensions = reinterpret_cast<ExtensionsGLOpenGLES&>(gl.getExtensions());
-    if (m_attributes.antialias && extensions.isImagination()) {
-        extensions.framebufferTexture2DMultisampleIMG(GL::FRAMEBUFFER, GL::COLOR_ATTACHMENT0, GL::TEXTURE_2D, m_opaqueTexture, 0, m_sampleCount);
-        return;
-    }
-#endif
-
-    if (!m_multisampleColorBuffer)
-        gl.framebufferTexture2D(GL::FRAMEBUFFER, GL::COLOR_ATTACHMENT0, GL::TEXTURE_2D, m_opaqueTexture, 0);
-}
-
-void WebXROpaqueFramebuffer::endFrame()
-{
-    m_framebuffer->setOpaqueActive(false);
-
-    if (!m_context.graphicsContextGL())
-        return;
-    auto& gl = *m_context.graphicsContextGL();
-
-    if (m_multisampleColorBuffer) {
-#if !USE(ANGLE)
-        // FIXME: These may be needed when using ANGLE, but it didn't compile in the initial implementation.
-        TemporaryOpenGLSetting scopedScissor(GL::SCISSOR_TEST, 0);
-        TemporaryOpenGLSetting scopedDither(GL::DITHER, 0);
-        TemporaryOpenGLSetting scopedDepth(GL::DEPTH_TEST, 0);
-        TemporaryOpenGLSetting scopedStencil(GL::STENCIL_TEST, 0);
-#endif
-
-        GCGLint boundReadFBO { 0 };
-        GCGLint boundDrawFBO { 0 };
-        gl.getIntegerv(GL::READ_FRAMEBUFFER_BINDING, makeGCGLSpan(&boundReadFBO, 1));
-        gl.getIntegerv(GL::DRAW_FRAMEBUFFER_BINDING, makeGCGLSpan(&boundDrawFBO, 1));
-
-        auto scopedFBOs = makeScopeExit([&gl, boundReadFBO, boundDrawFBO]() {
-            gl.bindFramebuffer(GL::READ_FRAMEBUFFER, boundReadFBO);
-            gl.bindFramebuffer(GL::DRAW_FRAMEBUFFER, boundDrawFBO);
-        });
-
-        gl.bindFramebuffer(GL::DRAW_FRAMEBUFFER, m_resolvedFBO);
-        gl.framebufferTexture2D(GL::FRAMEBUFFER, GL::COLOR_ATTACHMENT0, GL::TEXTURE_2D, m_opaqueTexture, 0);
-
-        // Resolve multisample framebuffer
-        gl.bindFramebuffer(GL::READ_FRAMEBUFFER, m_framebuffer->object());
-        gl.blitFramebuffer(0, 0, m_width, m_height, 0, 0, m_width, m_height, GL::COLOR_BUFFER_BIT, GL::LINEAR);
-    }
-    
-    gl.flush();
-}
-
-bool WebXROpaqueFramebuffer::setupFramebuffer()
-{
-    if (!m_context.graphicsContextGL())
-        return false;
-    auto& gl = *m_context.graphicsContextGL();
-
-    // Bind current FBOs when exiting the function
-    GCGLint boundFBO { 0 };
-    GCGLint boundRenderbuffer { 0 };
-    gl.getIntegerv(GL::FRAMEBUFFER_BINDING, makeGCGLSpan(&boundFBO, 1));
-    gl.getIntegerv(GL::RENDERBUFFER_BINDING, makeGCGLSpan(&boundRenderbuffer, 1));
-    auto scopedFBO = makeScopeExit([&gl, boundFBO, boundRenderbuffer]() {
-        gl.bindFramebuffer(GL::FRAMEBUFFER, boundFBO);
-        gl.bindRenderbuffer(GL::RENDERBUFFER, boundRenderbuffer);
-    });
-
-    // Set up color, depth and stencil formats
-    bool useDepthStencil = m_attributes.stencil || m_attributes.depth;
-    auto colorFormat = m_attributes.alpha ? GraphicsContextGL::RGBA8 : GraphicsContextGL::RGB8;
-#if USE(OPENGL_ES)
-    auto& extensions = reinterpret_cast<ExtensionsGLOpenGLES&>(gl.getExtensions());
-    bool supportsPackedDepthStencil = useDepthStencil && extensions.supports("GL_OES_packed_depth_stencil");
-    auto depthFormat = supportsPackedDepthStencil ? GL::DEPTH24_STENCIL8 : GL::DEPTH_COMPONENT16;
-    auto stencilFormat = GL::STENCIL_INDEX8;
-#elif USE(ANGLE)
-    // FIXME: These values were chosen just to get this to compile successfully.
-    // Make sure they are correct.
-    bool supportsPackedDepthStencil = false;
-    auto depthFormat = supportsPackedDepthStencil ? GL::DEPTH24_STENCIL8 : GL::DEPTH_COMPONENT;
-    auto stencilFormat = GL::STENCIL_INDEX8;
-#else
-    auto& extensions = reinterpret_cast<ExtensionsGLOpenGLCommon&>(gl.getExtensions());
-    bool supportsPackedDepthStencil = useDepthStencil && extensions.supports("GL_EXT_packed_depth_stencil");
-    auto depthFormat = supportsPackedDepthStencil ? GL::DEPTH24_STENCIL8 : GL::DEPTH_COMPONENT;
-    auto stencilFormat = GL::STENCIL_COMPONENT;
-#endif
-
-    // Set up recommended samples for WebXR.
-    // FIXME: check if we can get recommended values from each device platform.
-    if (m_attributes.antialias) {
-        GCGLint maxSampleCount;
-#if USE(ANGLE)
-        // FIXME: This probably is not correct.
-        maxSampleCount = 0;
-#else
-        gl.getIntegerv(ExtensionsGL::MAX_SAMPLES, makeGCGLSpan(&maxSampleCount, 1));
-#endif
-        // Using more than 4 samples might be overhead.
-        m_sampleCount = std::min(4, maxSampleCount);
-    }
-
-#if USE(OPENGL_ES)
-    // Use multisampled_render_to_texture extension if available.
-    if (m_attributes.antialias && extensions.isImagination()) {
-        // framebufferTexture2DMultisampleIMG is set up in startFrame call.
-        if (!useDepthStencil)
-            return true;
-        
-        gl.bindFramebuffer(GL::FRAMEBUFFER, m_framebuffer->object());
-        m_depthStencilBuffer = gl.createRenderbuffer();
-        if (supportsPackedDepthStencil) {
-            gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
-            extensions.renderbufferStorageMultisampleANGLE(GL::RENDERBUFFER, m_sampleCount, depthFormat, m_width, m_height);
-            if (m_attributes.stencil)
-                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
-            if (m_attributes.depth)
-                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
-        } else {
-            if (m_attributes.stencil) {
-                m_stencilBuffer = gl.createRenderbuffer();
-                gl.bindRenderbuffer(GL::RENDERBUFFER, m_stencilBuffer);
-                extensions.renderbufferStorageMultisampleANGLE(GL::RENDERBUFFER, m_sampleCount, stencilFormat, m_width, m_height);
-                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_stencilBuffer);
-            }
-            if (m_attributes.depth) {
-                gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
-                extensions.renderbufferStorageMultisampleANGLE(GL::RENDERBUFFER, m_sampleCount, depthFormat, m_width, m_height);
-                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
-            }
-        }
-        return true;
-    }
-#endif // USE(OPENGL_ES)
-
-    if (m_attributes.antialias && m_context.isWebGL2()) {
-        // Use an extra FBO for multisample if multisampled_render_to_texture is not supported.
-        m_resolvedFBO = gl.createFramebuffer();
-        m_multisampleColorBuffer = gl.createRenderbuffer();
-        gl.bindFramebuffer(GL::FRAMEBUFFER, m_framebuffer->object());
-        gl.bindRenderbuffer(GL::RENDERBUFFER, m_multisampleColorBuffer);
-        gl.renderbufferStorageMultisample(GL::RENDERBUFFER, m_sampleCount, colorFormat, m_width, m_height);
-        gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::COLOR_ATTACHMENT0, GL::RENDERBUFFER, m_multisampleColorBuffer);
-        if (useDepthStencil) {
-            m_depthStencilBuffer = gl.createRenderbuffer();
-            if (supportsPackedDepthStencil) {
-                gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
-                gl.renderbufferStorageMultisample(GL::RENDERBUFFER, m_sampleCount, depthFormat, m_width, m_height);
-                if (m_attributes.stencil)
-                    gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
-                if (m_attributes.depth)
-                    gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
-            } else {
-                if (m_attributes.stencil) {
-                    m_stencilBuffer = gl.createRenderbuffer();
-                    gl.bindRenderbuffer(GL::RENDERBUFFER, m_stencilBuffer);
-                    gl.renderbufferStorageMultisample(GL::RENDERBUFFER, m_sampleCount, stencilFormat, m_width, m_height);
-                    gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_stencilBuffer);
-                }
-                if (m_attributes.depth) {
-                    gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
-                    gl.renderbufferStorageMultisample(GL::RENDERBUFFER, m_sampleCount, depthFormat, m_width, m_height);
-                    gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
-                }
-            }
-        }
-        return gl.checkFramebufferStatus(GL::FRAMEBUFFER) == GL::FRAMEBUFFER_COMPLETE;
-    }
-    if (useDepthStencil) {
-        gl.bindFramebuffer(GL::FRAMEBUFFER, m_framebuffer->object());
-        m_depthStencilBuffer = gl.createRenderbuffer();
-        if (supportsPackedDepthStencil) {
-            gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
-            gl.renderbufferStorage(GL::RENDERBUFFER, depthFormat, m_width, m_height);
-            if (m_attributes.stencil)
-                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
-            if (m_attributes.depth)
-                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
-        } else {
-            if (m_attributes.stencil) {
-                m_stencilBuffer = gl.createRenderbuffer();
-                gl.bindRenderbuffer(GL::RENDERBUFFER, m_stencilBuffer);
-                gl.renderbufferStorage(GL::RENDERBUFFER, stencilFormat, m_width, m_height);
-                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::STENCIL_ATTACHMENT, GL::RENDERBUFFER, m_stencilBuffer);
-            }
-            if (m_attributes.depth) {
-                gl.bindRenderbuffer(GL::RENDERBUFFER, m_depthStencilBuffer);
-                gl.renderbufferStorage(GL::RENDERBUFFER, depthFormat, m_width, m_height);
-                gl.framebufferRenderbuffer(GL::FRAMEBUFFER, GL::DEPTH_ATTACHMENT, GL::RENDERBUFFER, m_depthStencilBuffer);
-            }
-        }
-    }
-
-    return true;
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(WEBXR)

Modified: trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.h (276961 => 276962)


--- trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.h	2021-05-04 16:43:33 UTC (rev 276961)
+++ trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.h	2021-05-04 17:02:18 UTC (rev 276962)
@@ -117,45 +117,6 @@
     bool m_viewportsDirty { true };
 };
 
-class WebXROpaqueFramebuffer {
-public:
-    struct Attributes {
-        bool alpha { true };
-        bool antialias { true };
-        bool depth { true };
-        bool stencil { false };
-    };
-
-    static std::unique_ptr<WebXROpaqueFramebuffer> create(PlatformXR::LayerHandle, WebGLRenderingContextBase&, Attributes&&, uint32_t width, uint32_t height);
-    ~WebXROpaqueFramebuffer();
-
-    PlatformXR::LayerHandle handle() const { return m_handle; }
-    const WebGLFramebuffer& framebuffer() const { return m_framebuffer.get(); }
-    uint32_t width() const { return m_width; }
-    uint32_t height() const { return m_height; }
-
-    void startFrame(const PlatformXR::Device::FrameData::LayerData&);
-    void endFrame();
-
-private:
-    WebXROpaqueFramebuffer(PlatformXR::LayerHandle, Ref<WebGLFramebuffer>&&, WebGLRenderingContextBase&, Attributes&&, uint32_t width, uint32_t height);
-
-    bool setupFramebuffer();
-
-    PlatformXR::LayerHandle m_handle;
-    Ref<WebGLFramebuffer> m_framebuffer;
-    WebGLRenderingContextBase& m_context;
-    Attributes m_attributes;
-    uint32_t m_width { 0 };
-    uint32_t m_height { 0 };
-    PlatformGLObject m_depthStencilBuffer { 0 };
-    PlatformGLObject m_stencilBuffer { 0 };
-    PlatformGLObject m_multisampleColorBuffer { 0 };
-    PlatformGLObject m_resolvedFBO { 0 };
-    GCGLint m_sampleCount { 0 };
-    PlatformGLObject m_opaqueTexture { 0 };
-};
-
 } // namespace WebCore
 
 #endif // ENABLE(WEBXR)

Modified: trunk/Source/WebCore/Sources.txt (276961 => 276962)


--- trunk/Source/WebCore/Sources.txt	2021-05-04 16:43:33 UTC (rev 276961)
+++ trunk/Source/WebCore/Sources.txt	2021-05-04 17:02:18 UTC (rev 276962)
@@ -431,6 +431,7 @@
 Modules/webxr/WebXRInputSourceArray.cpp @no-unify
 Modules/webxr/WebXRInputSpace.cpp @no-unify
 Modules/webxr/WebXRLayer.cpp @no-unify
+Modules/webxr/WebXROpaqueFramebuffer.cpp @no-unify
 Modules/webxr/WebXRPose.cpp @no-unify
 Modules/webxr/WebXRReferenceSpace.cpp @no-unify
 Modules/webxr/WebXRRenderState.cpp @no-unify

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (276961 => 276962)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-05-04 16:43:33 UTC (rev 276961)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-05-04 17:02:18 UTC (rev 276962)
@@ -942,6 +942,8 @@
 		314877E61FAAB02500C05759 /* JSOffscreenCanvas.h in Headers */ = {isa = PBXBuildFile; fileRef = 314877E41FAAB02200C05759 /* JSOffscreenCanvas.h */; };
 		314BE3A11B30F6B700141982 /* CSSNamedImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 314BE3A01B30F6B700141982 /* CSSNamedImageValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		314BE3A71B3103FB00141982 /* NamedImageGeneratedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 314BE3A51B3103FB00141982 /* NamedImageGeneratedImage.h */; };
+		314F169E2640BC3B00663ECE /* WebXROpaqueFramebuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 314F169B2640B67E00663ECE /* WebXROpaqueFramebuffer.cpp */; };
+		314F169F2640BC4100663ECE /* WebXROpaqueFramebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 314F169D2640B67E00663ECE /* WebXROpaqueFramebuffer.h */; };
 		31647FAB251618E20010F8FB /* OpenGLSoftLinkCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 31647FA8251616BD0010F8FB /* OpenGLSoftLinkCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		316DCB201E78CA55001B5F87 /* JSRTCOfferAnswerOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 316DCB1A1E78CA55001B5F87 /* JSRTCOfferAnswerOptions.h */; };
 		316DCB221E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 316DCB1C1E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.h */; };
@@ -7461,6 +7463,8 @@
 		314BE3A21B30F6D100141982 /* CSSNamedImageValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSNamedImageValue.cpp; sourceTree = "<group>"; };
 		314BE3A41B3103FB00141982 /* NamedImageGeneratedImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NamedImageGeneratedImage.cpp; sourceTree = "<group>"; };
 		314BE3A51B3103FB00141982 /* NamedImageGeneratedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NamedImageGeneratedImage.h; sourceTree = "<group>"; };
+		314F169B2640B67E00663ECE /* WebXROpaqueFramebuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebXROpaqueFramebuffer.cpp; sourceTree = "<group>"; };
+		314F169D2640B67E00663ECE /* WebXROpaqueFramebuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebXROpaqueFramebuffer.h; sourceTree = "<group>"; };
 		315574CC218F66D000D88F66 /* PointerEventIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PointerEventIOS.cpp; sourceTree = "<group>"; };
 		31647FA8251616BD0010F8FB /* OpenGLSoftLinkCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OpenGLSoftLinkCocoa.h; path = ../../../PAL/pal/cocoa/OpenGLSoftLinkCocoa.h; sourceTree = "<group>"; };
 		31647FA9251616BD0010F8FB /* OpenGLSoftLinkCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenGLSoftLinkCocoa.mm; path = ../../../PAL/pal/cocoa/OpenGLSoftLinkCocoa.mm; sourceTree = "<group>"; };
@@ -29020,6 +29024,8 @@
 				E12FDAFB24A0FD1C0070236E /* WebXRLayer.cpp */,
 				E12FDAFD24A0FD1E0070236E /* WebXRLayer.h */,
 				E12FDAFE24A0FD1F0070236E /* WebXRLayer.idl */,
+				314F169B2640B67E00663ECE /* WebXROpaqueFramebuffer.cpp */,
+				314F169D2640B67E00663ECE /* WebXROpaqueFramebuffer.h */,
 				E1EE8AE52412B17000E794D6 /* WebXRPose.cpp */,
 				E1EE8AE12412B17000E794D6 /* WebXRPose.h */,
 				E19490A12434F16800416A99 /* WebXRPose.idl */,
@@ -35793,6 +35799,7 @@
 				E1EE8B862413191F00E794D6 /* WebXRInputSourceArray.h in Headers */,
 				11E51638261E1A0600E69F25 /* WebXRInputSpace.h in Headers */,
 				E12FDB0024A0FD200070236E /* WebXRLayer.h in Headers */,
+				314F169F2640BC4100663ECE /* WebXROpaqueFramebuffer.h in Headers */,
 				E1EE8B882413191F00E794D6 /* WebXRPose.h in Headers */,
 				E1EE8BA62413196300E794D6 /* WebXRReferenceSpace.h in Headers */,
 				E1EE8B812413191F00E794D6 /* WebXRRenderState.h in Headers */,
@@ -37113,6 +37120,7 @@
 				E1EE8B8C2413191F00E794D6 /* WebXRInputSourceArray.cpp in Sources */,
 				11E51639261E1A0600E69F25 /* WebXRInputSpace.cpp in Sources */,
 				E12FDAFF24A0FD200070236E /* WebXRLayer.cpp in Sources */,
+				314F169E2640BC3B00663ECE /* WebXROpaqueFramebuffer.cpp in Sources */,
 				E1EE8B8B2413191F00E794D6 /* WebXRPose.cpp in Sources */,
 				E1EE8B7F2413191F00E794D6 /* WebXRReferenceSpace.cpp in Sources */,
 				E1EE8B7C2413191F00E794D6 /* WebXRRenderState.cpp in Sources */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to