Fall back to EGL_EXT_create_context_robustness
authorJames Helferty <jhelferty@nvidia.com>
Mon, 27 Mar 2017 19:33:29 +0000 (15:33 -0400)
committerJames Helferty <jhelferty@nvidia.com>
Tue, 28 Mar 2017 19:43:45 +0000 (15:43 -0400)
When creating an ES context with robustness attributes, if EGL 1.5 is
not available, fall back to using EGL_EXT_create_context_robustness.

Affects:

KHR-GLES32.robust.robustness.noResetNotification
KHR-GLES32.robust.robustness.loseContextOnReset
KHR-GLES32.robust.robustness.getnuniform
KHR-GLES32.robust.robustness.readnpixels
KHR-GLES32.robust.robust_buffer_access_behavior.vertex_buffer_objects
KHR-GLES32.robust.robust_buffer_access_behavior.texel_fetch
KHR-GLES32.robust.robust_buffer_access_behavior.image_load_store
KHR-GLES32.robust.robust_buffer_access_behavior.storage_buffer
KHR-GLES32.robust.robust_buffer_access_behavior.uniform_buffer

Components: Framework

VK-GL-CTS issue: 331

Change-Id: Ib83dd872150e26f27acf729889afe99eedd90872

framework/egl/egluGLUtil.cpp

index 39ca8a12d9b6e826bc5f422adf9f26451da49039..4584cd4bd15e4e8abc5ae02049b81ec4061e572a 100644 (file)
@@ -162,10 +162,12 @@ EGLContext createGLContext (const Library&                                        egl,
 
                if (resetNotificationStrategy != glu::RESET_NOTIFICATION_STRATEGY_NOT_SPECIFIED)
                {
-                       if (glu::isContextTypeES(contextType))
-                               TCU_THROW(InternalError, "Specifying reset notification strategy is not allowed when creating OpenGL ES contexts");
-
-                       attribList.push_back(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR);
+                       if (getVersion(egl, display) >= Version(1, 5) || glu::isContextTypeGLCore(contextType) || glu::isContextTypeGLCompatibility(contextType))
+                               attribList.push_back(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR);
+                       else if (hasExtension(egl, display, "EGL_EXT_create_context_robustness"))
+                               attribList.push_back(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT);
+                       else
+                               TCU_THROW(NotSupportedError, "EGL 1.5 or EGL_EXT_create_context_robustness is required for creating robust context");
 
                        if (resetNotificationStrategy == glu::RESET_NOTIFICATION_STRATEGY_NO_RESET_NOTIFICATION)
                                attribList.push_back(EGL_NO_RESET_NOTIFICATION_KHR);