[Mesa-dev] [PATCH] swrast: Fix eglMakeCurrent(dpy, NULL, NULL, ctx)

Ian Romanick idr at freedesktop.org
Fri Jul 6 17:10:48 UTC 2018


On 07/06/2018 08:45 AM, Adam Jackson wrote:
> On Fri, 2018-07-06 at 10:29 +0100, Emil Velikov wrote:
> 
>> Skimming through the egl_khr_create_context text, this relaxes some
>> parts which are meant to be an error.
>> For example
>>
>>       * If either of <draw> or <read> is a valid surface and the other
>>         is EGL_NO_SURFACE, an EGL_BAD_MATCH error is generated.
> 
> That seems like an invariant EGL promises for the driver, not something
> the driver validates. eglMakeCurrent already says:
> 
>       if ((!draw_surf && draw != EGL_NO_SURFACE) ||
>           (!read_surf && read != EGL_NO_SURFACE))
>          RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
> 
> glXMakeCurrent doesn't seem to have code to generate an error in that
> case, anymore. The server would throw an error for the GLXMakeCurrent
> request, but we don't always emit those for... bad reasons. Regardless
> I'd say that check belongs in MakeContextCurrent, not the driver.

That is how we have typically divided up work.  The libEGL / libGLX
layer handles the API validation, and the driver tries not to crash. :)

> - ajax
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list