Skip to content
Snippets Groups Projects
Commit 22201d20 authored by Emil Velikov's avatar Emil Velikov
Browse files

egl/glvnd: correctly report errors when vendor cannot be found


If the user provides an invalid display or device the ToVendor lookup
will fail.

In this case, the local [Mesa vendor] error code will be set. Thus on
sequential eglGetError(), the error will be EGL_SUCCESS.

To be more specific, GLVND remembers the last vendor and calls back
into it's eglGetError, although there's no guarantee to ever have had
one.

v2:
 - Add _eglError call, so the debug callback is executed (Kyle)
 - Drop XXX comment.

Piglit: tests/egl/spec/egl_ext_device_query
Fixes: ce562f9e ("EGL: Implement the libglvnd interface for EGL (v3)")
Cc: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>
Reviewed-by: default avatarKyle Brenneman <kbrenneman@nvidia.com>
(cherry picked from commit b3ade653)
parent 60fe2f6e
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,11 @@ static __eglMustCastToProperFunctionPointerType FetchVendorFunc(__EGLvendorInfo
}
if (func == NULL) {
if (errorCode != EGL_SUCCESS) {
// Since we have no vendor, the follow-up eglGetError() call will
// end up using the GLVND error code. Set it here.
if (vendor == NULL) {
exports->setEGLError(errorCode);
}
_eglError(errorCode, __EGL_DISPATCH_FUNC_NAMES[index]);
}
return NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment