diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2010-09-09 19:41:09 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-03-10 13:26:09 +0000 |
commit | 6f661c5f1cf2259c630a305a86cb267d446fe1ba (patch) | |
tree | 3f9728bdc485c9ed3173e7987b62cd9c45c7be25 | |
parent | e8b65d4f8dc76eaedc255dfae4e54a3f162c7922 (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.c | 7 | ||||
-rw-r--r-- | glx/glxext.c | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c index d5b764fd0..0d1c0050e 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -213,6 +213,13 @@ static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen, return context; } +void +FlushContext(__GLXcontext *cx) +{ + CALL_Flush( GET_DISPATCH(), () ); + cx->hasUnflushedCommands = GL_FALSE; +} + /** * 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 9cfc096c3..8c52fda25 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -132,6 +132,8 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) for (c = glxAllContexts; c; c = next) { next = c->next; if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { + FlushContext(c); + (*c->loseCurrent)(c); c->isCurrent = GL_FALSE; if (c == __glXLastContext) |