Title: [261310] branches/safari-609-branch/Source/WebCore
Revision
261310
Author
[email protected]
Date
2020-05-07 10:58:13 -0700 (Thu, 07 May 2020)

Log Message

Cherry-pick r260480. rdar://problem/62977665

    Cherry-pick r260301. rdar://problem/62083309

        [WebGL] Confirm there are no errors when setting up framebuffers
        https://bugs.webkit.org/show_bug.cgi?id=210632
        <rdar://problem/61916680>

        Reviewed by Simon Fraser.

        We're seeing crashes on macOS inside GraphicsContextGL::reshape().
        Specifically when we submit work at the end of the function via
        glFlush.

        At the moment the cause is a mystery, because we should bail out
        before then if the multisample renderbuffer was not complete. In
        the hope that it helps somewhat, add a call to glGetError to double
        check that there isn't anything horribly wrong before we talk to
        the GPU.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): If the underlying
        GCGL context was marked as "LOST" during initialization, skip the rest of our
        initialization.
        * html/canvas/WebGLRenderingContext.cpp: Ditto.
        (WebCore::WebGLRenderingContext::WebGLRenderingContext):
        * html/canvas/WebGLRenderingContextBase.cpp: Ditto.
        (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):

        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: Check for a GL error during
        setup and, if there is one, skip directly into a LOST state.
        (WebCore::GraphicsContext3D::reshape):

        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    git-svn-id: https://svn.webkit.org/repository/webkit/branches/safari-609.2.9.1-branch@260480 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-609-branch/Source/WebCore/ChangeLog (261309 => 261310)


--- branches/safari-609-branch/Source/WebCore/ChangeLog	2020-05-07 17:58:09 UTC (rev 261309)
+++ branches/safari-609-branch/Source/WebCore/ChangeLog	2020-05-07 17:58:13 UTC (rev 261310)
@@ -1,3 +1,110 @@
+2020-05-07  Alan Coon  <[email protected]>
+
+        Cherry-pick r260480. rdar://problem/62977665
+
+    Cherry-pick r260301. rdar://problem/62083309
+    
+        [WebGL] Confirm there are no errors when setting up framebuffers
+        https://bugs.webkit.org/show_bug.cgi?id=210632
+        <rdar://problem/61916680>
+    
+        Reviewed by Simon Fraser.
+    
+        We're seeing crashes on macOS inside GraphicsContextGL::reshape().
+        Specifically when we submit work at the end of the function via
+        glFlush.
+    
+        At the moment the cause is a mystery, because we should bail out
+        before then if the multisample renderbuffer was not complete. In
+        the hope that it helps somewhat, add a call to glGetError to double
+        check that there isn't anything horribly wrong before we talk to
+        the GPU.
+    
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): If the underlying
+        GCGL context was marked as "LOST" during initialization, skip the rest of our
+        initialization.
+        * html/canvas/WebGLRenderingContext.cpp: Ditto.
+        (WebCore::WebGLRenderingContext::WebGLRenderingContext):
+        * html/canvas/WebGLRenderingContextBase.cpp: Ditto.
+        (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
+    
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: Check for a GL error during
+        setup and, if there is one, skip directly into a LOST state.
+        (WebCore::GraphicsContext3D::reshape):
+    
+        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/branches/safari-609.2.9.1-branch@260480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-21  Alan Coon  <[email protected]>
+
+            Cherry-pick r260301. rdar://problem/62083309
+
+        [WebGL] Confirm there are no errors when setting up framebuffers
+        https://bugs.webkit.org/show_bug.cgi?id=210632
+        <rdar://problem/61916680>
+
+        Reviewed by Simon Fraser.
+
+        We're seeing crashes on macOS inside GraphicsContextGL::reshape().
+        Specifically when we submit work at the end of the function via
+        glFlush.
+
+        At the moment the cause is a mystery, because we should bail out
+        before then if the multisample renderbuffer was not complete. In
+        the hope that it helps somewhat, add a call to glGetError to double
+        check that there isn't anything horribly wrong before we talk to
+        the GPU.
+
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): If the underlying
+        GCGL context was marked as "LOST" during initialization, skip the rest of our
+        initialization.
+        * html/canvas/WebGLRenderingContext.cpp: Ditto.
+        (WebCore::WebGLRenderingContext::WebGLRenderingContext):
+        * html/canvas/WebGLRenderingContextBase.cpp: Ditto.
+        (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
+
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: Check for a GL error during
+        setup and, if there is one, skip directly into a LOST state.
+        (WebCore::GraphicsContext3D::reshape):
+
+        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+        2020-04-17  Dean Jackson  <[email protected]>
+
+                [WebGL] Confirm there are no errors when setting up framebuffers
+                https://bugs.webkit.org/show_bug.cgi?id=210632
+                <rdar://problem/61916680>
+
+                Reviewed by Simon Fraser.
+
+                We're seeing crashes on macOS inside GraphicsContextGL::reshape().
+                Specifically when we submit work at the end of the function via
+                glFlush.
+
+                At the moment the cause is a mystery, because we should bail out
+                before then if the multisample renderbuffer was not complete. In
+                the hope that it helps somewhat, add a call to glGetError to double
+                check that there isn't anything horribly wrong before we talk to
+                the GPU.
+
+                * html/canvas/WebGL2RenderingContext.cpp:
+                (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): If the underlying
+                GCGL context was marked as "LOST" during initialization, skip the rest of our
+                initialization.
+                * html/canvas/WebGLRenderingContext.cpp: Ditto.
+                (WebCore::WebGLRenderingContext::WebGLRenderingContext):
+                * html/canvas/WebGLRenderingContextBase.cpp: Ditto.
+                (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
+
+                * platform/graphics/angle/GraphicsContextGLANGLE.cpp: Check for a GL error during
+                setup and, if there is one, skip directly into a LOST state.
+                (WebCore::GraphicsContextGLOpenGL::reshape):
+                * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
+                (WebCore::GraphicsContextGLOpenGL::reshape):
+
 2020-04-12  Alan Coon  <[email protected]>
 
         Cherry-pick r259316. rdar://problem/61269751

Modified: branches/safari-609-branch/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (261309 => 261310)


--- branches/safari-609-branch/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2020-05-07 17:58:09 UTC (rev 261309)
+++ branches/safari-609-branch/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2020-05-07 17:58:13 UTC (rev 261310)
@@ -93,6 +93,9 @@
 WebGL2RenderingContext::WebGL2RenderingContext(CanvasBase& canvas, Ref<GraphicsContext3D>&& context, GraphicsContext3DAttributes attributes)
     : WebGLRenderingContextBase(canvas, WTFMove(context), attributes)
 {
+    if (isContextLost())
+        return;
+
     initializeShaderExtensions();
     initializeVertexArrayObjects();
 }

Modified: branches/safari-609-branch/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (261309 => 261310)


--- branches/safari-609-branch/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2020-05-07 17:58:09 UTC (rev 261309)
+++ branches/safari-609-branch/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2020-05-07 17:58:13 UTC (rev 261310)
@@ -98,6 +98,9 @@
 WebGLRenderingContext::WebGLRenderingContext(CanvasBase& canvas, Ref<GraphicsContext3D>&& context, GraphicsContext3DAttributes attributes)
     : WebGLRenderingContextBase(canvas, WTFMove(context), attributes)
 {
+    if (isContextLost())
+        return;
+
     initializeVertexArrayObjects();
 }
 

Modified: branches/safari-609-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (261309 => 261310)


--- branches/safari-609-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2020-05-07 17:58:09 UTC (rev 261309)
+++ branches/safari-609-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2020-05-07 17:58:13 UTC (rev 261310)
@@ -651,6 +651,12 @@
 
     setupFlags();
     initializeNewContext();
+
+    // If something goes wrong in initializeNewContext, it should have
+    // triggered a lost context. Check that before setting anything else up.
+    if (isContextLost())
+        return;
+
     registerWithWebGLStateTracker();
     m_checkForContextLossHandlingTimer.startOneShot(checkContextLossHandlingDelay);
 

Modified: branches/safari-609-branch/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (261309 => 261310)


--- branches/safari-609-branch/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp	2020-05-07 17:58:09 UTC (rev 261309)
+++ branches/safari-609-branch/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp	2020-05-07 17:58:13 UTC (rev 261310)
@@ -369,6 +369,13 @@
     if (mustRestoreFBO)
         ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
 
+    auto error = ::glGetError();
+    if (error != GL_NO_ERROR) {
+        RELEASE_LOG(WebGL, "Fatal: OpenGL error during GraphicsContextGL buffer initialization (%d).", error);
+        forceContextLost();
+        return;
+    }
+
     ::glFlush();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to