EGL 1.4 Specification says that
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) can be 
used to release the
current thread's ownership on the surfaces and context.

MESA's egl implementation was only accepting the parameters when the 
KHR_surfaceless_context
extension is supported.
---
 src/egl/main/eglapi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 950c447..a5def55 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -486,7 +486,12 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface 
read,
 
    if (!context && ctx != EGL_NO_CONTEXT)
       RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
-   if (!draw_surf || !read_surf) {
+
+   /* surfaces may both be EGL_NO_SURFACE and context be EGL_NO_CONTEXT,
+      releasing the current thread's ownership on the resources
+      (EGL 1.4 Specification, Section 3.7.3) */
+   if ((draw != EGL_NO_SURFACE || read != EGL_NO_SURFACE || ctx != 
EGL_NO_CONTEXT) &&
+       (!draw_surf || !read_surf)) {
       /* surfaces may be NULL if surfaceless */
       if (!disp->Extensions.KHR_surfaceless_context)
          RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
-- 
1.9.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to