We want to make sure that lastGLContext is set correctly during
makeCurrent, because we may have recursive GL context changes in the
DRI2 interfaces due to glamor.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
StopUsingContext(__GLXcontext * glxc)
{
if (glxc) {
- if (glxc == lastGLContext) {
- lastGLContext = NULL;
- }
glxc->currentClient = NULL;
if (!glxc->idExists) {
FreeResourceByType(glxc->id, __glXContextRes, FALSE);
static void
StartUsingContext(__GLXclientState * cl, __GLXcontext * glxc)
{
- lastGLContext = glxc;
glxc->currentClient = cl->client;
}
glxc->readPriv = readPriv;
/* make the context current */
+ lastGLContext = glxc;
if (!(*glxc->makeCurrent) (glxc)) {
+ lastGLContext = NULL;
glxc->drawPriv = NULL;
glxc->readPriv = NULL;
return __glXError(GLXBadContext);
/* Make this context the current one for the GL. */
if (!cx->isDirect) {
+ lastGLContext = cx;
if (!(*cx->makeCurrent) (cx)) {
/* Bind failed, and set the error code. Bummer */
+ lastGLContext = NULL;
cl->client->errorValue = cx->id;
*error = __glXError(GLXBadContextState);
return 0;
}
}
- lastGLContext = cx;
return cx;
}