summaryrefslogtreecommitdiff
path: root/glx/glxcmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'glx/glxcmds.c')
-rw-r--r--glx/glxcmds.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 33954ee64..8b6dfbc84 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -760,29 +760,46 @@ int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc)
{
xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc;
+ GLXContextTag tag = req->contextTag;
+ __GLXcontext *glxc = NULL;
int error;
+
+ if (tag) {
+ glxc = __glXLookupContextByTag(cl, tag);
+ if (!glxc)
+ return __glXError(GLXBadContextTag);
- if (!__glXForceCurrent(cl, req->contextTag, &error)) {
- return error;
+ if (!__glXForceCurrent(cl, req->contextTag, &error))
+ return error;
+
+ CALL_Finish( GET_DISPATCH(), () );
}
- CALL_Finish( GET_DISPATCH(), () );
+
+ if (glxc && glxc->drawPriv->waitGL)
+ (*glxc->drawPriv->waitGL)(glxc->drawPriv);
+
return Success;
}
int __glXDisp_WaitX(__GLXclientState *cl, GLbyte *pc)
{
xGLXWaitXReq *req = (xGLXWaitXReq *)pc;
+ GLXContextTag tag = req->contextTag;
+ __GLXcontext *glxc = NULL;
int error;
+
+ if (tag) {
+ glxc = __glXLookupContextByTag(cl, tag);
+ if (!glxc)
+ return __glXError(GLXBadContextTag);
- if (!__glXForceCurrent(cl, req->contextTag, &error)) {
- return error;
+ if (!__glXForceCurrent(cl, req->contextTag, &error))
+ return error;
}
- /*
- ** In a multithreaded server that had separate X and GL threads, we would
- ** have to wait for the X thread to finish before returning. As it stands,
- ** this sample implementation only supports singlethreaded servers, and
- ** nothing needs to be done here.
- */
+
+ if (glxc && glxc->drawPriv->waitGL)
+ (*glxc->drawPriv->waitGL)(glxc->drawPriv);
+
return Success;
}