const glu::ContextType& contextType,
glu::ResetNotificationStrategy resetNotificationStrategy)
{
- const bool khrCreateContextSupported = hasExtension(egl, display, "EGL_KHR_create_context");
- EGLContext context = EGL_NO_CONTEXT;
- EGLenum api = EGL_NONE;
+ const bool khrCreateContextSupported = hasExtension(egl, display, "EGL_KHR_create_context");
+ const bool khrCreateContextNoErrorSupported = hasExtension(egl, display, "EGL_KHR_create_context_no_error");
+ EGLContext context = EGL_NO_CONTEXT;
+ EGLenum api = EGL_NONE;
vector<EGLint> attribList;
if (glu::isContextTypeES(contextType))
flags |= EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
}
+ if ((contextType.getFlags() & glu::CONTEXT_NO_ERROR) != 0)
+ {
+ if (khrCreateContextNoErrorSupported)
+ {
+ attribList.push_back(EGL_CONTEXT_OPENGL_NO_ERROR_KHR);
+ attribList.push_back(EGL_TRUE);
+ }
+ else
+ throw tcu::NotSupportedError("EGL_KHR_create_context_no_error is required for creating no-error contexts");
+ }
+
if ((contextType.getFlags() & glu::CONTEXT_FORWARD_COMPATIBLE) != 0)
{
if (!glu::isContextTypeGLCore(contextType))
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);