egl: Emit correct error when robust context creation fails
authorChad Versace <chadversary@chromium.org>
Fri, 23 Dec 2016 01:06:14 +0000 (17:06 -0800)
committerChad Versace <chadversary@chromium.org>
Tue, 27 Dec 2016 18:21:29 +0000 (10:21 -0800)
commitb85c0b569fe133b71a767a068e8608868158134e
tree147f2a60f8776802539064212a1d216b989d819d
parent75252826e82ffa9c091ebe5bcf303c9d7569c3a3
egl: Emit correct error when robust context creation fails

Fixes dEQP-EGL.functional.create_context_ext.robust_*
on Intel with GBM.

If the user sets the EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR in
EGL_CONTEXT_FLAGS_KHR when creating an OpenGL ES context, then
EGL_KHR_create_context spec requires that we unconditionally emit
EGL_BAD_ATTRIBUTE because that flag does not exist for OpenGL ES. When
creating an OpenGL context, the spec requires that we emit EGL_BAD_MATCH
if we can't support the request; that error is generated in the egl_dri2
layer where the driver capability is actually checked.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99188
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/egl/main/eglcontext.c