[Mesa-dev] [PATCH 2/2] egl/glvnd: correctly report errors when vendor cannot be found

Emil Velikov emil.l.velikov at gmail.com
Mon Nov 5 16:13:07 UTC 2018


On Fri, 2 Nov 2018 at 22:09, Kyle Brenneman <kyle.brenneman at gmail.com> wrote:

> > +    if (vendor == NULL) {
> > +        // XXX: How can we end here with EGL_SUCCESS?
> > +        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.
> > +            exports->setEGLError(errorCode);

> The (vendor == NULL) branch should still call _eglError so that it calls the debug callback function. Other than that, this looks right to me.
>
Thanks. v2 coming shortly.

> In answer to the question in the comment, getting an EGL_SUCCESS error code is inherited from the code in libglvnd itself to handle the eglWait* functions. If there's no current context for those functions, then they're a no-op and don't set an error code.
>
> Mesa doesn't have any EGL dispatch stubs that look at the current context, though, so you could just remove __eglDispatchFetchByCurrent and the (errorCode != EGL_SUCCESS) checks.
Having a closer look: things seem pretty strange, within Mesa at least.

WaitGL, WaitClient, WaitNative should use the thread state, while
eglWaitSync* should deduce things from the display.
Of which only eglWaitSyncKHR uses the display and everything else has
no dispatch since it's annotated as "none" .

A step further our eglWaitNative implementation is an empty stub... I
wonder how many apps relied upon that ;-)

-Emil


More information about the mesa-dev mailing list