Title: [278256] trunk/Source/WebCore
Revision
278256
Author
[email protected]
Date
2021-05-30 12:45:09 -0700 (Sun, 30 May 2021)

Log Message

[WebXR] invalidateFramebuffer is not the same as clearing contents
https://bugs.webkit.org/show_bug.cgi?id=226422
<rdar://problem/78652351>

Reviewed by Sam Weinig.

The WebXR specification says that buffer contents must be cleared
before each frame. The code currently does glInvalidateFramebuffer
to wipe the attachments, which isn't the same thing (and produces
an error since it tries to invalidate attachments that don't exist).

Remove the call to invalidateFramebuffer for the moment since it
causes a glError. Add a FIXME to replace it with explicit calls
to glClear. I expect most content does this already, so it is unlikely
anything will break.

* Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::startFrame): Remove the call to
invalidateFramebuffer.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (278255 => 278256)


--- trunk/Source/WebCore/ChangeLog	2021-05-30 19:41:32 UTC (rev 278255)
+++ trunk/Source/WebCore/ChangeLog	2021-05-30 19:45:09 UTC (rev 278256)
@@ -1,5 +1,27 @@
 2021-05-30  Dean Jackson  <[email protected]>
 
+        [WebXR] invalidateFramebuffer is not the same as clearing contents
+        https://bugs.webkit.org/show_bug.cgi?id=226422
+        <rdar://problem/78652351>
+
+        Reviewed by Sam Weinig.
+
+        The WebXR specification says that buffer contents must be cleared
+        before each frame. The code currently does glInvalidateFramebuffer
+        to wipe the attachments, which isn't the same thing (and produces
+        an error since it tries to invalidate attachments that don't exist).
+
+        Remove the call to invalidateFramebuffer for the moment since it
+        causes a glError. Add a FIXME to replace it with explicit calls
+        to glClear. I expect most content does this already, so it is unlikely
+        anything will break.
+
+        * Modules/webxr/WebXROpaqueFramebuffer.cpp:
+        (WebCore::WebXROpaqueFramebuffer::startFrame): Remove the call to
+        invalidateFramebuffer.
+
+2021-05-30  Dean Jackson  <[email protected]>
+
         [WebXR] Recommended framebuffer width incorrectly scaled
         https://bugs.webkit.org/show_bug.cgi?id=226408
         <rdar://problem/78638309>

Modified: trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp (278255 => 278256)


--- trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp	2021-05-30 19:41:32 UTC (rev 278255)
+++ trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp	2021-05-30 19:45:09 UTC (rev 278256)
@@ -104,12 +104,12 @@
         gl.bindFramebuffer(GL::FRAMEBUFFER, boundFBO);
     });
 
-    gl.bindFramebuffer(GL::FRAMEBUFFER, m_framebuffer->object());
+    gl.bindFramebuffer(GraphicsContextGL::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,
+    // The buffers attached to an opaque framebuffer MUST be cleared to the values in the provided table 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()));
+    // FIXME: Actually do the clearing (not using invalidateFramebuffer). This will have to be done after we've attached
+    // the textures/renderbuffers.
 
 #if USE(OPENGL_ES)
     auto& extensions = reinterpret_cast<ExtensionsGLOpenGLES&>(gl.getExtensions());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to