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)) {