mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
glx: Stop tracking hasUnflushedCommands
This is only meaningful for indirect contexts, and all it does is (maybe) prevent a flush when switching away from an indirect context. Indirect contexts aren't worth optimizing for, and Mesa tracks whether a flush is needed anyway. Careful readers will note that ReadPixels would reset the flag even though it doesn't imply a flush! Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
@@ -636,10 +636,9 @@ DoMakeCurrent(__GLXclientState * cl,
|
||||
if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB)
|
||||
need_flush = GL_FALSE;
|
||||
#endif
|
||||
if (prevglxc->hasUnflushedCommands && need_flush) {
|
||||
if (need_flush) {
|
||||
if (__glXForceCurrent(cl, tag, (int *) &error)) {
|
||||
glFlush();
|
||||
prevglxc->hasUnflushedCommands = GL_FALSE;
|
||||
}
|
||||
else {
|
||||
return error;
|
||||
@@ -922,7 +921,6 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc)
|
||||
** in both streams are completed before the copy is executed.
|
||||
*/
|
||||
glFinish();
|
||||
tagcx->hasUnflushedCommands = GL_FALSE;
|
||||
}
|
||||
else {
|
||||
return error;
|
||||
@@ -1696,7 +1694,6 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
|
||||
** in both streams are completed before the swap is executed.
|
||||
*/
|
||||
glFinish();
|
||||
glxc->hasUnflushedCommands = GL_FALSE;
|
||||
}
|
||||
else {
|
||||
return error;
|
||||
@@ -1893,7 +1890,6 @@ __glXDisp_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc)
|
||||
** in both streams are completed before the swap is executed.
|
||||
*/
|
||||
glFinish();
|
||||
glxc->hasUnflushedCommands = GL_FALSE;
|
||||
}
|
||||
else {
|
||||
return error;
|
||||
@@ -2116,7 +2112,6 @@ __glXDisp_Render(__GLXclientState * cl, GLbyte * pc)
|
||||
left -= cmdlen;
|
||||
commandsDone++;
|
||||
}
|
||||
glxc->hasUnflushedCommands = GL_TRUE;
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -2327,7 +2322,6 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||
** Skip over the header and execute the command.
|
||||
*/
|
||||
(*proc) (cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
|
||||
glxc->hasUnflushedCommands = GL_TRUE;
|
||||
|
||||
/*
|
||||
** Reset for the next RenderLarge series.
|
||||
|
||||
@@ -93,11 +93,6 @@ struct __GLXcontext {
|
||||
*/
|
||||
GLboolean isDirect;
|
||||
|
||||
/*
|
||||
** This flag keeps track of whether there are unflushed GL commands.
|
||||
*/
|
||||
GLboolean hasUnflushedCommands;
|
||||
|
||||
/*
|
||||
** Current rendering mode for this context.
|
||||
*/
|
||||
|
||||
@@ -136,7 +136,6 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid)
|
||||
(c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
|
||||
/* flush the context */
|
||||
glFlush();
|
||||
c->hasUnflushedCommands = GL_FALSE;
|
||||
/* just force a re-bind the next time through */
|
||||
(*c->loseCurrent) (c);
|
||||
lastGLContext = NULL;
|
||||
|
||||
@@ -71,7 +71,6 @@ __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||
cx->feedbackBufSize = size;
|
||||
}
|
||||
glFeedbackBuffer(size, type, cx->feedbackBuf);
|
||||
cx->hasUnflushedCommands = GL_TRUE;
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -102,7 +101,6 @@ __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||
cx->selectBufSize = size;
|
||||
}
|
||||
glSelectBuffer(size, cx->selectBuf);
|
||||
cx->hasUnflushedCommands = GL_TRUE;
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -225,7 +223,6 @@ __glXDisp_Flush(__GLXclientState * cl, GLbyte * pc)
|
||||
}
|
||||
|
||||
glFlush();
|
||||
cx->hasUnflushedCommands = GL_FALSE;
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -245,7 +242,6 @@ __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc)
|
||||
|
||||
/* Do a local glFinish */
|
||||
glFinish();
|
||||
cx->hasUnflushedCommands = GL_FALSE;
|
||||
|
||||
/* Send empty reply packet to indicate finish is finished */
|
||||
client = cl->client;
|
||||
|
||||
@@ -72,7 +72,6 @@ __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||
cx->feedbackBufSize = size;
|
||||
}
|
||||
glFeedbackBuffer(size, type, cx->feedbackBuf);
|
||||
cx->hasUnflushedCommands = GL_TRUE;
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -107,7 +106,6 @@ __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||
cx->selectBufSize = size;
|
||||
}
|
||||
glSelectBuffer(size, cx->selectBuf);
|
||||
cx->hasUnflushedCommands = GL_TRUE;
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -245,7 +243,6 @@ __glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc)
|
||||
}
|
||||
|
||||
glFlush();
|
||||
cx->hasUnflushedCommands = GL_FALSE;
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -268,7 +265,6 @@ __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc)
|
||||
|
||||
/* Do a local glFinish */
|
||||
glFinish();
|
||||
cx->hasUnflushedCommands = GL_FALSE;
|
||||
|
||||
/* Send empty reply packet to indicate finish is finished */
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
|
||||
@@ -86,7 +86,6 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
cx->hasUnflushedCommands = GL_FALSE;
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,6 @@ __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc)
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
cx->hasUnflushedCommands = GL_FALSE;
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user