[Mesa-dev] [PATCH] EGL: automatic API binding on eglMakeCurrent

Adrien Maglo magsoft at videolan.org
Mon Jun 6 08:53:08 UTC 2016


A first thread binds an API and creates a context. If a second thread calls
eglMakeCurrent with the same context as parameter without having bound the
same API, the context is not linked correctly as the CurrentAPIIndex
variable as never been set.
---
 src/egl/main/eglcontext.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index ae19862..cd75c03 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -570,6 +570,7 @@ _eglBindContextToThread(_EGLContext *ctx, _EGLThreadInfo *t)
       if (ctx)
          ctx->Binding = t;
 
+      t->CurrentAPIIndex = apiIndex;
       t->CurrentContexts[apiIndex] = ctx;
    }
 
-- 
2.7.4



More information about the mesa-dev mailing list