- Revision
- 254520
- Author
- commit-qu...@webkit.org
- Date
- 2020-01-14 11:28:31 -0800 (Tue, 14 Jan 2020)
Log Message
Need workaround for crash in Intel OpenGL driver related to texture copying feedback loops
https://bugs.webkit.org/show_bug.cgi?id=205843
Source/ThirdParty/ANGLE:
Remove ANGLE workaround introduced in bug 205707, as it was
discovered to be incomplete, and was never upstreamed. The correct
workaround will be integrated in the next ANGLE roll.
Patch by Kenneth Russell <k...@chromium.org> on 2020-01-14
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):
Source/WebCore:
Work around bug in Intel OpenGL driver related to
glCopyTex{Sub}Image/glDeleteTextures by flushing before texture
deletion, if a copy to a texture has been performed recently.
Tested with a forthcoming WebGL conformance test.
Patch by Kenneth Russell <k...@chromium.org> on 2020-01-14
Reviewed by Dean Jackson.
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
(WebCore::GraphicsContextGLOpenGL::copyTexImage2D):
(WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D):
(WebCore::GraphicsContextGLOpenGL::finish):
(WebCore::GraphicsContextGLOpenGL::flush):
(WebCore::GraphicsContextGLOpenGL::deleteTexture):
Modified Paths
Diff
Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (254519 => 254520)
--- trunk/Source/ThirdParty/ANGLE/ChangeLog 2020-01-14 19:05:22 UTC (rev 254519)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog 2020-01-14 19:28:31 UTC (rev 254520)
@@ -1,3 +1,20 @@
+2020-01-14 Kenneth Russell <k...@chromium.org>
+
+ Need workaround for crash in Intel OpenGL driver related to texture copying feedback loops
+ https://bugs.webkit.org/show_bug.cgi?id=205843
+
+ Remove ANGLE workaround introduced in bug 205707, as it was
+ discovered to be incomplete, and was never upstreamed. The correct
+ workaround will be integrated in the next ANGLE roll.
+
+ 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-01-08 Kenneth Russell <k...@chromium.org>
Remove some #ifdefs related to iOS port of ANGLE
Modified: trunk/Source/ThirdParty/ANGLE/include/platform/FeaturesGL.h (254519 => 254520)
--- trunk/Source/ThirdParty/ANGLE/include/platform/FeaturesGL.h 2020-01-14 19:05:22 UTC (rev 254519)
+++ trunk/Source/ThirdParty/ANGLE/include/platform/FeaturesGL.h 2020-01-14 19:28:31 UTC (rev 254520)
@@ -386,16 +386,6 @@
"All Mac drivers do not handle struct scopes correctly. This workaround overwrites a struct"
"name with a unique prefix.",
&members, "http://crbug.com/403957"};
-
- // Intel drivers on Mac - apparently for both older and current GPUs - have
- // bugs where certain operations can be reordered across glBindFramebuffer
- // calls. Flushing before and after glBindFramebuffer works around these.
- // These bugs may exist on other platforms.
- Feature flushBeforeAndAfterBindFramebuffer = {
- "flush_before_and_after_bindframebuffer", FeatureCategory::OpenGLWorkarounds,
- "Intel drivers (on Mac, possibly other platforms) incorrectly reorder some operations"
- " across glBindFramebuffer calls. Flush before and after as a workaround.",
- &members, "http://anglebug.com/4267"};
};
inline FeaturesGL::FeaturesGL() = default;
Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/StateManagerGL.cpp (254519 => 254520)
--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/StateManagerGL.cpp 2020-01-14 19:05:22 UTC (rev 254519)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/StateManagerGL.cpp 2020-01-14 19:28:31 UTC (rev 254520)
@@ -585,10 +585,6 @@
void StateManagerGL::bindFramebuffer(GLenum type, GLuint framebuffer)
{
- bool flushBeforeAndAfter = mFeatures.flushBeforeAndAfterBindFramebuffer.enabled;
- if (flushBeforeAndAfter)
- mFunctions->flush();
-
switch (type)
{
case GL_FRAMEBUFFER:
@@ -628,9 +624,6 @@
UNREACHABLE();
break;
}
-
- if (flushBeforeAndAfter)
- mFunctions->flush();
}
void StateManagerGL::bindRenderbuffer(GLenum type, GLuint renderbuffer)
Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp (254519 => 254520)
--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp 2020-01-14 19:05:22 UTC (rev 254519)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp 2020-01-14 19:28:31 UTC (rev 254520)
@@ -1603,9 +1603,6 @@
// Ported from gpu_driver_bug_list.json (#184)
ANGLE_FEATURE_CONDITION(features, preAddTexelFetchOffsets, IsApple() && isIntel);
-
- // anglebug.com/4267
- ANGLE_FEATURE_CONDITION(features, flushBeforeAndAfterBindFramebuffer, IsApple() && isIntel);
}
void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features)
Modified: trunk/Source/WebCore/ChangeLog (254519 => 254520)
--- trunk/Source/WebCore/ChangeLog 2020-01-14 19:05:22 UTC (rev 254519)
+++ trunk/Source/WebCore/ChangeLog 2020-01-14 19:28:31 UTC (rev 254520)
@@ -1,3 +1,24 @@
+2020-01-14 Kenneth Russell <k...@chromium.org>
+
+ Need workaround for crash in Intel OpenGL driver related to texture copying feedback loops
+ https://bugs.webkit.org/show_bug.cgi?id=205843
+
+ Work around bug in Intel OpenGL driver related to
+ glCopyTex{Sub}Image/glDeleteTextures by flushing before texture
+ deletion, if a copy to a texture has been performed recently.
+
+ Tested with a forthcoming WebGL conformance test.
+
+ Reviewed by Dean Jackson.
+
+ * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
+ * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
+ (WebCore::GraphicsContextGLOpenGL::copyTexImage2D):
+ (WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D):
+ (WebCore::GraphicsContextGLOpenGL::finish):
+ (WebCore::GraphicsContextGLOpenGL::flush):
+ (WebCore::GraphicsContextGLOpenGL::deleteTexture):
+
2020-01-14 Ryan Haddad <ryanhad...@apple.com>
Unreviewed, rolling out r254505.
Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h (254519 => 254520)
--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h 2020-01-14 19:05:22 UTC (rev 254519)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h 2020-01-14 19:28:31 UTC (rev 254520)
@@ -879,6 +879,10 @@
#if PLATFORM(COCOA) && (USE(OPENGL) || USE(ANGLE))
bool m_hasSwitchedToHighPerformanceGPU { false };
#endif
+
+#if PLATFORM(MAC) && USE(OPENGL)
+ bool m_needsFlushBeforeDeleteTextures { false };
+#endif
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp (254519 => 254520)
--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp 2020-01-14 19:05:22 UTC (rev 254519)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp 2020-01-14 19:28:31 UTC (rev 254520)
@@ -698,6 +698,11 @@
::glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
if (attrs.antialias && m_state.boundFBO == m_multisampleFBO)
::glBindFramebufferEXT(GraphicsContextGL::FRAMEBUFFER, m_multisampleFBO);
+
+#if PLATFORM(MAC) && USE(OPENGL)
+ if (getExtensions().isIntel())
+ m_needsFlushBeforeDeleteTextures = true;
+#endif
}
void GraphicsContextGLOpenGL::copyTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height)
@@ -712,6 +717,11 @@
::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
if (attrs.antialias && m_state.boundFBO == m_multisampleFBO)
::glBindFramebufferEXT(GraphicsContextGL::FRAMEBUFFER, m_multisampleFBO);
+
+#if PLATFORM(MAC) && USE(OPENGL)
+ if (getExtensions().isIntel())
+ m_needsFlushBeforeDeleteTextures = true;
+#endif
}
void GraphicsContextGLOpenGL::cullFace(GCGLenum mode)
@@ -783,6 +793,9 @@
{
makeContextCurrent();
::glFinish();
+#if PLATFORM(MAC) && USE(OPENGL)
+ m_needsFlushBeforeDeleteTextures = false;
+#endif
}
void GraphicsContextGLOpenGL::flush()
@@ -789,6 +802,9 @@
{
makeContextCurrent();
::glFlush();
+#if PLATFORM(MAC) && USE(OPENGL)
+ m_needsFlushBeforeDeleteTextures = false;
+#endif
}
void GraphicsContextGLOpenGL::framebufferRenderbuffer(GCGLenum target, GCGLenum attachment, GCGLenum renderbuffertarget, PlatformGLObject buffer)
@@ -1933,6 +1949,10 @@
void GraphicsContextGLOpenGL::deleteTexture(PlatformGLObject texture)
{
makeContextCurrent();
+#if PLATFORM(MAC) && USE(OPENGL)
+ if (m_needsFlushBeforeDeleteTextures)
+ flush();
+#endif
m_state.boundTextureMap.removeIf([texture] (auto& keyValue) {
return keyValue.value.first == texture;
});