Bug 1477817 - Try to get RBAB even with EXT_create_context_robustness. - r=kvark a=ryanvm
authorJeff Gilbert <jgilbert@mozilla.com>
Fri, 20 Jul 2018 18:43:33 -0700
changeset 480978 8d31f736050acbab43de67af1a92e6678f0662c4
parent 480977 03bea733be337d5a8f99795b56011b2de2227b02
child 480979 5f8431f3c2e15e5e88ba8df2a851989a1306c686
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark, ryanvm
bugs1477817
milestone62.0
Bug 1477817 - Try to get RBAB even with EXT_create_context_robustness. - r=kvark a=ryanvm MozReview-Commit-ID: JO2jc5ATE4s
gfx/gl/GLContextProviderEGL.cpp
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -568,25 +568,26 @@ GLContextEGL::CreateGLContext(CreateCont
 
     std::vector<EGLint> robustness_attribs;
     std::vector<EGLint> rbab_attribs; // RBAB: Robust Buffer Access Behavior
     if (flags & CreateContextFlags::PREFER_ROBUSTNESS) {
         if (egl->IsExtensionSupported(GLLibraryEGL::EXT_create_context_robustness)) {
             robustness_attribs = required_attribs;
             robustness_attribs.push_back(LOCAL_EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT);
             robustness_attribs.push_back(LOCAL_EGL_LOSE_CONTEXT_ON_RESET_EXT);
-            // Skip EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT, since it doesn't help us.
-        }
 
-        if (egl->IsExtensionSupported(GLLibraryEGL::KHR_create_context) &&
-            !egl->IsANGLE())
-        {
-            rbab_attribs = required_attribs;
-            rbab_attribs.push_back(LOCAL_EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR);
-            rbab_attribs.push_back(LOCAL_EGL_LOSE_CONTEXT_ON_RESET_KHR);
+            rbab_attribs = robustness_attribs;
+            rbab_attribs.push_back(LOCAL_EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT);
+            rbab_attribs.push_back(LOCAL_EGL_TRUE);
+        } else if (egl->IsExtensionSupported(GLLibraryEGL::KHR_create_context)) {
+            robustness_attribs = required_attribs;
+            robustness_attribs.push_back(LOCAL_EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR);
+            robustness_attribs.push_back(LOCAL_EGL_LOSE_CONTEXT_ON_RESET_KHR);
+
+            rbab_attribs = robustness_attribs;
             rbab_attribs.push_back(LOCAL_EGL_CONTEXT_FLAGS_KHR);
             rbab_attribs.push_back(LOCAL_EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR);
         }
     }
 
     const auto fnCreate = [&](const std::vector<EGLint>& attribs) {
         auto terminated_attribs = attribs;