<div dir="ltr">It's probably enough, indeed. (With "ctx != EGL_NO_CONTEXT &&" instead of "ctx &&")<br></div><div class="gmail_extra"><br clear="all"><div>--<br>Beren Minor</div>
<br><br><div class="gmail_quote">On Mon, Mar 17, 2014 at 3:30 AM, Chia-I Wu <span dir="ltr"><<a href="mailto:olvaffe@gmail.com" target="_blank">olvaffe@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="">On Sun, Mar 16, 2014 at 5:20 AM, Beren Minor <<a href="mailto:beren.minor@gmail.com">beren.minor@gmail.com</a>> wrote:<br>
> EGL 1.4 Specification says that<br>
> eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) can be used to release the<br>
> current thread's ownership on the surfaces and context.<br>
><br>
> MESA's egl implementation was only accepting the parameters when the KHR_surfaceless_context<br>
> extension is supported.<br>
> ---<br>
>  src/egl/main/eglapi.c | 7 ++++++-<br>
>  1 file changed, 6 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c<br>
> index 950c447..a5def55 100644<br>
> --- a/src/egl/main/eglapi.c<br>
> +++ b/src/egl/main/eglapi.c<br>
> @@ -486,7 +486,12 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read,<br>
><br>
>     if (!context && ctx != EGL_NO_CONTEXT)<br>
>        RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);<br>
> -   if (!draw_surf || !read_surf) {<br>
> +<br>
> +   /* surfaces may both be EGL_NO_SURFACE and context be EGL_NO_CONTEXT,<br>
> +      releasing the current thread's ownership on the resources<br>
> +      (EGL 1.4 Specification, Section 3.7.3) */<br>
> +   if ((draw != EGL_NO_SURFACE || read != EGL_NO_SURFACE || ctx != EGL_NO_CONTEXT) &&<br>
> +       (!draw_surf || !read_surf)) {<br>
</div>Intead of changing this if condition, ...<br>
<div class="">>        /* surfaces may be NULL if surfaceless */<br>
>        if (!disp->Extensions.KHR_surfaceless_context)<br>
</div>isn't it enough to change this one to<br>
<br>
  if (ctx && !disp->Extensions.KHR_surfaceless_context)<br>
<div class=""><br>
?<br>
>           RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);<br>
> --<br>
> 1.9.0<br>
><br>
</div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
olv@LunarG.com<br>
</font></span></blockquote></div><br></div>