Try adding glBindFramebuffer flush workaround to ANGLE as remedy for flaky WebGL...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Feb 2020 00:03:28 +0000 (00:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Feb 2020 00:03:28 +0000 (00:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=206625

Patch by Kenneth Russell <kbr@chromium.org> on 2020-02-07
Reviewed by Dean Jackson.

* include/platform/FeaturesGL.h:
* src/libANGLE/renderer/gl/StateManagerGL.cpp:
(rx::StateManagerGL::bindFramebuffer):
* src/libANGLE/renderer/gl/renderergl_utils.cpp:
(rx::nativegl_gl::InitializeFeatures):

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

Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/include/platform/FeaturesGL.h
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/StateManagerGL.cpp
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp

index 8ab65b7..0bd72cf 100644 (file)
@@ -1,3 +1,16 @@
+2020-02-07  Kenneth Russell  <kbr@chromium.org>
+
+        Try adding glBindFramebuffer flush workaround to ANGLE as remedy for flaky WebGL tests
+        https://bugs.webkit.org/show_bug.cgi?id=206625
+
+        Reviewed by Dean Jackson.
+
+        * include/platform/FeaturesGL.h:
+        * src/libANGLE/renderer/gl/StateManagerGL.cpp:
+        (rx::StateManagerGL::bindFramebuffer):
+        * src/libANGLE/renderer/gl/renderergl_utils.cpp:
+        (rx::nativegl_gl::InitializeFeatures):
+
 2020-02-05  Dean Jackson  <dino@apple.com>
 
         Fix MacCatalyst build.
index e740372..0f649db 100644 (file)
@@ -411,6 +411,12 @@ struct FeaturesGL : FeatureSetBase
         "rewrite_row_major_matrices", FeatureCategory::OpenGLWorkarounds,
         "Rewrite row major matrices in shaders as column major as a driver bug workaround",
         &members, "http://anglebug.com/2273"};
+
+    // Flush before glBindFramebuffer as a driver bug workaround if necessary.
+    Feature flushBeforeBindFramebuffer = {
+        "flush_before_bindframebuffer", FeatureCategory::OpenGLWorkarounds,
+        "Flush before glBindFramebuffer as a driver bug workaround",
+        &members, "https://bugs.webkit.org/show_bug.cgi?id=206625"};
 };
 
 inline FeaturesGL::FeaturesGL()  = default;
index 93f9794..6897266 100644 (file)
@@ -586,6 +586,9 @@ void StateManagerGL::setPixelPackBuffer(const gl::Buffer *pixelBuffer)
 
 void StateManagerGL::bindFramebuffer(GLenum type, GLuint framebuffer)
 {
+    if (mFeatures.flushBeforeBindFramebuffer.enabled)
+        mFunctions->flush();
+
     switch (type)
     {
         case GL_FRAMEBUFFER:
index 57c7ddf..51f1797 100644 (file)
@@ -1649,6 +1649,9 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
                             // IsApple() && functions->standard == STANDARD_GL_DESKTOP);
                             // TODO(anglebug.com/2273): diagnose crashes with this workaround.
                             false);
+
+    // bugs.webkit.org/show_bug.cgi?id=206625
+    ANGLE_FEATURE_CONDITION(features, flushBeforeBindFramebuffer, IsApple() && isIntel);
 }
 
 void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features)