Fall back to EGL_EXT_create_context_robustness
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
diff --git a/framework/egl/egluGLUtil.cpp b/framework/egl/egluGLUtil.cpp
index 39ca8a1..4584cd4 100644
--- a/framework/egl/egluGLUtil.cpp
+++ b/framework/egl/egluGLUtil.cpp
@@ -162,10 +162,12 @@
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);