diff options
author | Beren Minor <beren.minor@gmail.com> | 2014-03-20 08:36:34 +0100 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2014-06-06 17:15:51 -0700 |
commit | 494f91612550734d718e4e5120d315a8c3d6a41d (patch) | |
tree | 61d959dddf30dfee4ada2f9257555d6825965f77 | |
parent | 767bc0530946adfb07cc769497a8db3a74f34894 (diff) |
egl/main: Fix eglMakeCurrent when releasing context from current thread.
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.
[chadv] Add quote from the EGL 1.4 spec.
Cc: "10,1, 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 0ca0d5743fb42a956289a87efd4c8fcda88cf93a)
-rw-r--r-- | src/egl/main/eglapi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 219d8e61715..b946d81b783 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -524,8 +524,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 be NULL if surfaceless */ - if (!disp->Extensions.KHR_surfaceless_context) + /* From the EGL 1.4 (20130211) spec: + * + * To release the current context without assigning a new one, set ctx + * to EGL_NO_CONTEXT and set draw and read to EGL_NO_SURFACE. + */ + if (!disp->Extensions.KHR_surfaceless_context && ctx != EGL_NO_CONTEXT) RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); if ((!draw_surf && draw != EGL_NO_SURFACE) || |