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;
if (firstTime) {
pipe_mutex_init(_xmesa_lock);
+ screen = driver.create_pipe_screen();
firstTime = GL_FALSE;
}
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;
else if (pipe)
pipe->destroy(pipe);
- if (screen)
- screen->destroy( screen );
-
FREE(c);
return NULL;
}