summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2010-09-09 19:41:09 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2010-09-29 21:20:01 +0100
commit806bb975f2749fdd81acbd1a9a5e7eabba737a9f (patch)
tree56a7b18e8cda2f44bc0dc19c5d7360faddb6aad0
parenta1b9a49ff70c0e9615ee2cb0e0d18a9cf8154c0c (diff)
glx: Flush context which is being made non-current due to drawable going away
indirect rendering glean tests fail with GLXBadCurrentWindow e.g. glean -t 'fpexceptions getString'
-rw-r--r--glx/glxcmds.c7
-rw-r--r--glx/glxext.c2
2 files changed, 9 insertions, 0 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 9e5b2139e..fa74a8ac2 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -214,6 +214,13 @@ static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen,
return context;
}
+void
+FlushContext(__GLXcontext *cx)
+{
+ CALL_Flush( GET_DISPATCH(), () );
+ __GLX_NOTE_FLUSHED_CMDS(cx);
+}
+
/**
* Create a GL context with the given properties. This routine is used
* to implement \c glXCreateContext, \c glXCreateNewContext, and
diff --git a/glx/glxext.c b/glx/glxext.c
index e203156e4..4078e896b 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -141,6 +141,8 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
int i;
+ FlushContext(c);
+
(*c->loseCurrent)(c);
c->isCurrent = GL_FALSE;
if (c == __glXLastContext)