X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fglxcurrent.c;h=a388df7a78dc9017f47448daa191ed1cb72a7bb8;hb=8b6d3f2c782b1e6559b49f106f24d2d586f0d71d;hp=fd04929b89f3a2bbac5d5d06b7e291cfbc516420;hpb=75d5d22fb790d856809a9dd896ffc22a268d1d96;p=mesa.git diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index fd04929b89f..a388df7a78d 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -67,7 +67,7 @@ struct glx_context dummyContext = { _X_HIDDEN pthread_mutex_t __glXmutex = PTHREAD_MUTEX_INITIALIZER; -# if defined( GLX_USE_TLS ) +# if defined( USE_ELF_TLS ) /** * Per-thread GLX context pointer. @@ -132,7 +132,7 @@ __glXGetCurrentContext(void) return (v == NULL) ? &dummyContext : (struct glx_context *) v; } -# endif /* defined( GLX_USE_TLS ) */ +# endif /* defined( USE_ELF_TLS ) */ _X_HIDDEN void @@ -194,6 +194,13 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, return True; } + /* can't have only one be 0 */ + if (!!draw != !!read) { + __glXUnlock(); + __glXSendError(dpy, BadMatch, None, X_GLXMakeContextCurrent, True); + return False; + } + if (oldGC != &dummyContext) { if (--oldGC->thread_refcount == 0) { oldGC->vtable->unbind(oldGC, gc); @@ -238,18 +245,6 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, __glXUnlock(); - /* The indirect vertex array state must to be initialised after we - * have setup the context, as it needs to query server attributes. - */ - if (gc && !gc->isDirect) { - __GLXattribute *state = gc->client_state_private; - if (state && state->array_state == NULL) { - glGetString(GL_EXTENSIONS); - glGetString(GL_VERSION); - __glXInitVertexArrayState(gc); - } - } - return GL_TRUE; }