summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2012-11-19 08:41:47 -0800
committerChad Versace <chad.versace@linux.intel.com>2012-11-20 12:33:47 -0800
commitab25fb821e94047d079006af4e43ebf7b4144a46 (patch)
tree81626855719b4bd760de733db3467896f1c64f6a
parent0b2ee04dafba1479518b8b6a6433351733ea997d (diff)
egl_khr_create_context: Check eglChooseConfig's errors
If eglChooseConfig fails with EGL_BAD_ATTRIBUTE, then fail the test. Piglit only requests valid attributes, therefore the error is incorrect. Regresses test egl-create-context-verify-gl-flavor:gles3.0 on mesa-5cf853669. Mesa fails to recoginize EGL_OPENGL_ES3_BIT_KHR despite exposing the EGL_KHR_create_context extension. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r--tests/egl/spec/egl_khr_create_context/common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/egl/spec/egl_khr_create_context/common.c b/tests/egl/spec/egl_khr_create_context/common.c
index c3920b82..e94d1002 100644
--- a/tests/egl/spec/egl_khr_create_context/common.c
+++ b/tests/egl/spec/egl_khr_create_context/common.c
@@ -119,6 +119,15 @@ EGL_KHR_create_context_setup(EGLint renderable_type_mask)
if (!eglChooseConfig(egl_dpy, config_attribs, &cfg, 1, &count) ||
count == 0) {
+ if (eglGetError() == EGL_BAD_ATTRIBUTE) {
+ /* Piglit requests only valid attributes, therefore
+ * EGL_BAD_ATTRIBUTE should not be emitted.
+ */
+ fprintf(stderr, "eglChooseConfig() emitted "
+ "EGL_BAD_ATTRIBUTE\n");
+ piglit_report_result(PIGLIT_FAIL);
+ }
+
return false;
}