summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/glx')
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index 79c2230588f..f4c5893427d 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -742,7 +742,7 @@ PUBLIC
XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
{
static GLboolean firstTime = GL_TRUE;
- struct pipe_screen *screen;
+ static struct pipe_screen *screen = NULL;
struct pipe_context *pipe;
XMesaContext c;
GLcontext *mesaCtx;
@@ -750,6 +750,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
if (firstTime) {
pipe_mutex_init(_xmesa_lock);
+ screen = driver.create_pipe_screen();
firstTime = GL_FALSE;
}
@@ -765,9 +766,6 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
c->xm_buffer = NULL; /* set later by XMesaMakeCurrent */
c->xm_read_buffer = NULL;
- /* XXX: create once per Xlib Display.
- */
- screen = driver.create_pipe_screen();
if (screen == NULL)
goto fail;
@@ -801,9 +799,6 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
else if (pipe)
pipe->destroy(pipe);
- if (screen)
- screen->destroy( screen );
-
FREE(c);
return NULL;
}