diff options
Diffstat (limited to 'src/egl/main/eglcontext.c')
-rw-r--r-- | src/egl/main/eglcontext.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c index df8b45c7bd6..1a8e9bda1a2 100644 --- a/src/egl/main/eglcontext.c +++ b/src/egl/main/eglcontext.c @@ -312,6 +312,37 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy, ctx->Flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR; break; + case EGL_CONTEXT_OPENGL_NO_ERROR_KHR: + if (dpy->Version < 14 || + !dpy->Extensions.KHR_create_context_no_error) { + err = EGL_BAD_ATTRIBUTE; + break; + } + + /* The KHR_no_error spec only applies against OpenGL 2.0+ and + * OpenGL ES 2.0+ + */ + if ((api != EGL_OPENGL_API && api != EGL_OPENGL_ES_API) || + ctx->ClientMajorVersion < 2) { + err = EGL_BAD_ATTRIBUTE; + break; + } + + /* The EGL_KHR_create_context_no_error spec says: + * + * "BAD_MATCH is generated if the EGL_CONTEXT_OPENGL_NO_ERROR_KHR is TRUE at + * the same time as a debug or robustness context is specified." + */ + if (ctx->Flags & EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR || + ctx->Flags & EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR) { + err = EGL_BAD_MATCH; + break; + } + + /* Canonicalize value to EGL_TRUE/EGL_FALSE definitions */ + ctx->NoError = !!val; + break; + default: err = EGL_BAD_ATTRIBUTE; break; |