summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/glxcurrent.c12
-rw-r--r--src/glx/indirect_glx.c8
2 files changed, 12 insertions, 8 deletions
diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
index f2e386597ad..d1193265f90 100644
--- a/src/glx/glxcurrent.c
+++ b/src/glx/glxcurrent.c
@@ -252,6 +252,18 @@ 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;
}
diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c
index 1991f70251b..51dd2cacb21 100644
--- a/src/glx/indirect_glx.c
+++ b/src/glx/indirect_glx.c
@@ -131,7 +131,6 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old,
GLXDrawable draw, GLXDrawable read)
{
GLXContextTag tag;
- __GLXattribute *state;
Display *dpy = gc->psc->dpy;
int opcode = __glXSetupForCommand(dpy);
Bool sent;
@@ -150,13 +149,6 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old,
IndirectAPI = __glXNewIndirectAPI();
_glapi_set_dispatch(IndirectAPI);
- state = gc->client_state_private;
- if (state->array_state == NULL) {
- glGetString(GL_EXTENSIONS);
- glGetString(GL_VERSION);
- __glXInitVertexArrayState(gc);
- }
-
return !sent;
}