summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Simiklit <andrii.simiklit@globallogic.com>2018-10-11 13:53:21 +0300
committerDylan Baker <dylan@pnwbakers.com>2019-05-08 16:40:18 -0700
commit4b0f0599388561da98ddcfd684018f39641061fe (patch)
tree3786d70322ce3f2315fb2ffeb4db8ba5137ddfea
parentfabaae4d8d2985f9b247c2e620af198972196d7f (diff)
egl: return correct error code for a case req ver < 3 with forward-compatible
The EGL_KHR_create_context spec says: "If an OpenGL context is requested and the values for attributes EGL_CONTEXT_MAJOR_VERSION_KHR and EGL_CONTEXT_MINOR_VERSION_KHR, when considered together with the value for attribute EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR, specify an OpenGL version and feature set that are not defined, than an EGL_BAD_MATCH error is generated." This case is already correctly handled a bit below in the same source file. The correct handling was added by commit: 63beb3df Reported-by: Ian Romanick <idr@freedesktop.org> Here: https://bugzilla.freedesktop.org/show_bug.cgi?id=92552#c9 Fixes: 11cabc45b712 "egl: rework handling EGL_CONTEXT_FLAGS" Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com> (cherry picked from commit 5c581b3dd6979b79cb3e3ab8e2e03b442e6ecb0d)
-rw-r--r--src/egl/main/eglcontext.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index 6b241a524ec..318a85a4f88 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -178,9 +178,12 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
* is supported for OpenGL contexts, and requesting a
* forward-compatible context for OpenGL versions less than 3.0
* will generate an error."
+ *
+ * Note: since the forward-compatible flag can be set more than one way,
+ * the OpenGL version check is performed once, below.
*/
if ((val & EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR) &&
- (api != EGL_OPENGL_API || ctx->ClientMajorVersion < 3)) {
+ api != EGL_OPENGL_API) {
err = EGL_BAD_ATTRIBUTE;
break;
}