Some sequences of glean tests fail with GLXBadCurrentWindow when using indirect rendering, e.g. glean -t 'fpexceptions getString'.
Flush a context which is being made non-current due to the drawable on which is it is current going away. Waiting until another context is made current is too late, as the drawable no longer exists. v2: Rewrite for direct GL dispatch e.g. LIBGL_ALWAYS_INDIRECT=1 ./glean -r results -o --quick -t "fpexceptions getString" fails with a BadContextTag error. Signed-off-by: Jon TURNEY <[email protected]> --- glx/glxcmds.c | 7 +++++++ glx/glxcontext.h | 2 ++ glx/glxext.c | 1 + 3 files changed, 10 insertions(+) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index f447e06..80b2361 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -213,6 +213,13 @@ __glXdirectContextCreate(__GLXscreen * screen, return context; } +void +FlushContext(__GLXcontext * cx) +{ + glFlush(); + 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/glxcontext.h b/glx/glxcontext.h index 677898a..c7cca0b 100644 --- a/glx/glxcontext.h +++ b/glx/glxcontext.h @@ -138,4 +138,6 @@ extern __GLXcontext *__glXdirectContextCreate(__GLXscreen * screen, __GLXconfig * modes, __GLXcontext * shareContext); +extern void FlushContext(__GLXcontext * cx); + #endif /* !__GLX_context_h__ */ diff --git a/glx/glxext.c b/glx/glxext.c index c9b8cc5..8c837b0 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -140,6 +140,7 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid) if (c->currentClient && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { /* just force a re-bind the next time through */ + FlushContext(c); (*c->loseCurrent) (c); if (c == __glXLastContext) __glXFlushContextCache(); -- 1.8.5.5 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
