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

Kyle Brenneman kbrenneman at nvidia.com
Mon Nov 5 16:20:55 UTC 2018


On 11/5/18 9:13 AM, Emil Velikov wrote:
> 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" .
Libglvnd itself provides dispatch stubs for eglWaitGL, eglWaitNative, 
and eglWaitSync, since they're core all EGL functions.

>
> 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