Mesa (master): egl: Fix OpenGL ES version checks in _eglParseContextAttribList()

Anuj Phogat aphogat at kemper.freedesktop.org
Tue Aug 5 01:32:11 UTC 2014


Module: Mesa
Branch: master
Commit: d308f57fe796a39d7d3f547aad62540cfd520675
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d308f57fe796a39d7d3f547aad62540cfd520675

Author: Anuj Phogat <anuj.phogat at gmail.com>
Date:   Wed Jun 18 17:35:18 2014 -0700

egl: Fix OpenGL ES version checks in _eglParseContextAttribList()

We would generate EGL_BAD_CONFIG because _eglGetContextAPIBit
returns zero for the combination of EGL_OPENGL_ES_API and a major
version > 3.  By just returning zero, the caller can't tell the
difference between a bad version (which should generate
EGL_BAD_MATCH) and a bad API (which should generate
EGL_BAD_CONFIG).  This patch causes us to filter out major
versions > 3 at a point where we can generate the correct error.

Fixes gles3 Khronos CTS test:
egl_create_context.egl_create_context

V2: Fix commit message as suggested by Ian.

Cc: <mesa-stable at lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/egl/main/eglcontext.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index 70277ab..514b91a 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -322,11 +322,14 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
          break;
 
       case 3:
-      default:
          /* Don't put additional version checks here.  We don't know that
           * there won't be versions > 3.0.
           */
          break;
+
+      default:
+         err = EGL_BAD_MATCH;
+         break;
       }
    }
 




More information about the mesa-commit mailing list