Changeset 254520 in webkit


Ignore:
Timestamp:
Jan 14, 2020 11:28:31 AM (4 years ago)
Author:
commit-queue@webkit.org
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 <kbr@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 <kbr@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):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r254249 r254520  
     12020-01-14  Kenneth Russell  <kbr@chromium.org>
     2
     3        Need workaround for crash in Intel OpenGL driver related to texture copying feedback loops
     4        https://bugs.webkit.org/show_bug.cgi?id=205843
     5
     6        Remove ANGLE workaround introduced in bug 205707, as it was
     7        discovered to be incomplete, and was never upstreamed. The correct
     8        workaround will be integrated in the next ANGLE roll.
     9
     10        Reviewed by Dean Jackson.
     11
     12        * include/platform/FeaturesGL.h:
     13        * src/libANGLE/renderer/gl/StateManagerGL.cpp:
     14        (rx::StateManagerGL::bindFramebuffer):
     15        * src/libANGLE/renderer/gl/renderergl_utils.cpp:
     16        (rx::nativegl_gl::InitializeFeatures):
     17
    1182020-01-08  Kenneth Russell  <kbr@chromium.org>
    219
  • trunk/Source/ThirdParty/ANGLE/include/platform/FeaturesGL.h

    r254045 r254520  
    387387        "name with a unique prefix.",
    388388        &members, "http://crbug.com/403957"};
    389 
    390     // Intel drivers on Mac - apparently for both older and current GPUs - have
    391     // bugs where certain operations can be reordered across glBindFramebuffer
    392     // calls. Flushing before and after glBindFramebuffer works around these.
    393     // These bugs may exist on other platforms.
    394     Feature flushBeforeAndAfterBindFramebuffer = {
    395         "flush_before_and_after_bindframebuffer", FeatureCategory::OpenGLWorkarounds,
    396         "Intel drivers (on Mac, possibly other platforms) incorrectly reorder some operations"
    397         " across glBindFramebuffer calls. Flush before and after as a workaround.",
    398         &members, "http://anglebug.com/4267"};
    399389};
    400390
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/StateManagerGL.cpp

    r254045 r254520  
    586586void StateManagerGL::bindFramebuffer(GLenum type, GLuint framebuffer)
    587587{
    588     bool flushBeforeAndAfter = mFeatures.flushBeforeAndAfterBindFramebuffer.enabled;
    589     if (flushBeforeAndAfter)
    590         mFunctions->flush();
    591 
    592588    switch (type)
    593589    {
     
    629625            break;
    630626    }
    631 
    632     if (flushBeforeAndAfter)
    633         mFunctions->flush();
    634627}
    635628
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp

    r254045 r254520  
    16041604    // Ported from gpu_driver_bug_list.json (#184)
    16051605    ANGLE_FEATURE_CONDITION(features, preAddTexelFetchOffsets, IsApple() && isIntel);
    1606 
    1607     // anglebug.com/4267
    1608     ANGLE_FEATURE_CONDITION(features, flushBeforeAndAfterBindFramebuffer, IsApple() && isIntel);
    16091606}
    16101607
  • trunk/Source/WebCore/ChangeLog

    r254516 r254520  
     12020-01-14  Kenneth Russell  <kbr@chromium.org>
     2
     3        Need workaround for crash in Intel OpenGL driver related to texture copying feedback loops
     4        https://bugs.webkit.org/show_bug.cgi?id=205843
     5
     6        Work around bug in Intel OpenGL driver related to
     7        glCopyTex{Sub}Image/glDeleteTextures by flushing before texture
     8        deletion, if a copy to a texture has been performed recently.
     9
     10        Tested with a forthcoming WebGL conformance test.
     11
     12        Reviewed by Dean Jackson.
     13
     14        * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
     15        * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
     16        (WebCore::GraphicsContextGLOpenGL::copyTexImage2D):
     17        (WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D):
     18        (WebCore::GraphicsContextGLOpenGL::finish):
     19        (WebCore::GraphicsContextGLOpenGL::flush):
     20        (WebCore::GraphicsContextGLOpenGL::deleteTexture):
     21
    1222020-01-14  Ryan Haddad  <ryanhaddad@apple.com>
    223
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h

    r254481 r254520  
    880880    bool m_hasSwitchedToHighPerformanceGPU { false };
    881881#endif
     882
     883#if PLATFORM(MAC) && USE(OPENGL)
     884    bool m_needsFlushBeforeDeleteTextures { false };
     885#endif
    882886};
    883887
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp

    r254481 r254520  
    699699    if (attrs.antialias && m_state.boundFBO == m_multisampleFBO)
    700700        ::glBindFramebufferEXT(GraphicsContextGL::FRAMEBUFFER, m_multisampleFBO);
     701
     702#if PLATFORM(MAC) && USE(OPENGL)
     703    if (getExtensions().isIntel())
     704        m_needsFlushBeforeDeleteTextures = true;
     705#endif
    701706}
    702707
     
    713718    if (attrs.antialias && m_state.boundFBO == m_multisampleFBO)
    714719        ::glBindFramebufferEXT(GraphicsContextGL::FRAMEBUFFER, m_multisampleFBO);
     720
     721#if PLATFORM(MAC) && USE(OPENGL)
     722    if (getExtensions().isIntel())
     723        m_needsFlushBeforeDeleteTextures = true;
     724#endif
    715725}
    716726
     
    784794    makeContextCurrent();
    785795    ::glFinish();
     796#if PLATFORM(MAC) && USE(OPENGL)
     797    m_needsFlushBeforeDeleteTextures = false;
     798#endif
    786799}
    787800
     
    790803    makeContextCurrent();
    791804    ::glFlush();
     805#if PLATFORM(MAC) && USE(OPENGL)
     806    m_needsFlushBeforeDeleteTextures = false;
     807#endif
    792808}
    793809
     
    19341950{
    19351951    makeContextCurrent();
     1952#if PLATFORM(MAC) && USE(OPENGL)
     1953    if (m_needsFlushBeforeDeleteTextures)
     1954        flush();
     1955#endif
    19361956    m_state.boundTextureMap.removeIf([texture] (auto& keyValue) {
    19371957        return keyValue.value.first == texture;
Note: See TracChangeset for help on using the changeset viewer.