[Mesa-dev] [PATCH v2] egl: add check that eglCreateContext gets a valid config

Tapani Pälli tapani.palli at intel.com
Thu Oct 20 17:20:57 UTC 2016


Fixes following dEQP test:

   dEQP-EGL.functional.negative_api.create_context

v2: don't break EGL_KHR_no_config_context (Eric Engestrom)

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---

Eric, the check you proposed does not work as KHR_no_config_context
is always there in extension list with Mesa EGL. So, solution is to
validate any given config that's not EGL_NO_CONFIG_KHR (0).

 src/egl/main/eglapi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index d8bd76d..ca19274 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -734,6 +734,9 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
 
    _EGL_CHECK_DISPLAY(disp, EGL_NO_CONTEXT, drv);
 
+   if (config != EGL_NO_CONFIG_KHR)
+      _EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT, drv);
+
    if (!config && !disp->Extensions.KHR_no_config_context)
       RETURN_EGL_ERROR(disp, EGL_BAD_CONFIG, EGL_NO_CONTEXT);
 
-- 
2.5.5



More information about the mesa-dev mailing list