glamor: Explain the weird EGL_NO_CONTEXT code.
authorEric Anholt <eric@anholt.net>
Fri, 4 Apr 2014 06:03:31 +0000 (07:03 +0100)
committerEric Anholt <eric@anholt.net>
Wed, 23 Apr 2014 17:32:30 +0000 (10:32 -0700)
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
glamor/glamor_egl.c

index 1755d23..54af275 100644 (file)
@@ -97,8 +97,15 @@ glamor_egl_get_screen_private(ScrnInfoPtr scrn)
 static void
 glamor_egl_make_current(struct glamor_context *glamor_ctx)
 {
+    /* There's only a single global dispatch table in Mesa.  EGL, GLX,
+     * and AIGLX's direct dispatch table manipulation don't talk to
+     * each other.  We need to set the context to NULL first to avoid
+     * EGL's no-op context change fast path when switching back to
+     * EGL.
+     */
     eglMakeCurrent(glamor_ctx->display, EGL_NO_SURFACE,
                    EGL_NO_SURFACE, EGL_NO_CONTEXT);
+
     if (!eglMakeCurrent(glamor_ctx->display,
                         EGL_NO_SURFACE, EGL_NO_SURFACE,
                         glamor_ctx->ctx)) {