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:
parent
0ebb58f6b6
commit
3f569435e1
|
@ -636,10 +636,9 @@ DoMakeCurrent(__GLXclientState * cl,
|
||||||
if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB)
|
if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB)
|
||||||
need_flush = GL_FALSE;
|
need_flush = GL_FALSE;
|
||||||
#endif
|
#endif
|
||||||
if (prevglxc->hasUnflushedCommands && need_flush) {
|
if (need_flush) {
|
||||||
if (__glXForceCurrent(cl, tag, (int *) &error)) {
|
if (__glXForceCurrent(cl, tag, (int *) &error)) {
|
||||||
glFlush();
|
glFlush();
|
||||||
prevglxc->hasUnflushedCommands = GL_FALSE;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return error;
|
return error;
|
||||||
|
@ -922,7 +921,6 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc)
|
||||||
** in both streams are completed before the copy is executed.
|
** in both streams are completed before the copy is executed.
|
||||||
*/
|
*/
|
||||||
glFinish();
|
glFinish();
|
||||||
tagcx->hasUnflushedCommands = GL_FALSE;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return error;
|
return error;
|
||||||
|
@ -1696,7 +1694,6 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
|
||||||
** in both streams are completed before the swap is executed.
|
** in both streams are completed before the swap is executed.
|
||||||
*/
|
*/
|
||||||
glFinish();
|
glFinish();
|
||||||
glxc->hasUnflushedCommands = GL_FALSE;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return error;
|
return error;
|
||||||
|
@ -1893,7 +1890,6 @@ __glXDisp_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc)
|
||||||
** in both streams are completed before the swap is executed.
|
** in both streams are completed before the swap is executed.
|
||||||
*/
|
*/
|
||||||
glFinish();
|
glFinish();
|
||||||
glxc->hasUnflushedCommands = GL_FALSE;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return error;
|
return error;
|
||||||
|
@ -2116,7 +2112,6 @@ __glXDisp_Render(__GLXclientState * cl, GLbyte * pc)
|
||||||
left -= cmdlen;
|
left -= cmdlen;
|
||||||
commandsDone++;
|
commandsDone++;
|
||||||
}
|
}
|
||||||
glxc->hasUnflushedCommands = GL_TRUE;
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2327,7 +2322,6 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
||||||
** Skip over the header and execute the command.
|
** Skip over the header and execute the command.
|
||||||
*/
|
*/
|
||||||
(*proc) (cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
|
(*proc) (cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
|
||||||
glxc->hasUnflushedCommands = GL_TRUE;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Reset for the next RenderLarge series.
|
** Reset for the next RenderLarge series.
|
||||||
|
|
|
@ -93,11 +93,6 @@ struct __GLXcontext {
|
||||||
*/
|
*/
|
||||||
GLboolean isDirect;
|
GLboolean isDirect;
|
||||||
|
|
||||||
/*
|
|
||||||
** This flag keeps track of whether there are unflushed GL commands.
|
|
||||||
*/
|
|
||||||
GLboolean hasUnflushedCommands;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Current rendering mode for this context.
|
** Current rendering mode for this context.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -136,7 +136,6 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid)
|
||||||
(c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
|
(c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
|
||||||
/* flush the context */
|
/* flush the context */
|
||||||
glFlush();
|
glFlush();
|
||||||
c->hasUnflushedCommands = GL_FALSE;
|
|
||||||
/* just force a re-bind the next time through */
|
/* just force a re-bind the next time through */
|
||||||
(*c->loseCurrent) (c);
|
(*c->loseCurrent) (c);
|
||||||
lastGLContext = NULL;
|
lastGLContext = NULL;
|
||||||
|
|
|
@ -71,7 +71,6 @@ __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
cx->feedbackBufSize = size;
|
cx->feedbackBufSize = size;
|
||||||
}
|
}
|
||||||
glFeedbackBuffer(size, type, cx->feedbackBuf);
|
glFeedbackBuffer(size, type, cx->feedbackBuf);
|
||||||
cx->hasUnflushedCommands = GL_TRUE;
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +101,6 @@ __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
cx->selectBufSize = size;
|
cx->selectBufSize = size;
|
||||||
}
|
}
|
||||||
glSelectBuffer(size, cx->selectBuf);
|
glSelectBuffer(size, cx->selectBuf);
|
||||||
cx->hasUnflushedCommands = GL_TRUE;
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +223,6 @@ __glXDisp_Flush(__GLXclientState * cl, GLbyte * pc)
|
||||||
}
|
}
|
||||||
|
|
||||||
glFlush();
|
glFlush();
|
||||||
cx->hasUnflushedCommands = GL_FALSE;
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +242,6 @@ __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc)
|
||||||
|
|
||||||
/* Do a local glFinish */
|
/* Do a local glFinish */
|
||||||
glFinish();
|
glFinish();
|
||||||
cx->hasUnflushedCommands = GL_FALSE;
|
|
||||||
|
|
||||||
/* Send empty reply packet to indicate finish is finished */
|
/* Send empty reply packet to indicate finish is finished */
|
||||||
client = cl->client;
|
client = cl->client;
|
||||||
|
|
|
@ -72,7 +72,6 @@ __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
cx->feedbackBufSize = size;
|
cx->feedbackBufSize = size;
|
||||||
}
|
}
|
||||||
glFeedbackBuffer(size, type, cx->feedbackBuf);
|
glFeedbackBuffer(size, type, cx->feedbackBuf);
|
||||||
cx->hasUnflushedCommands = GL_TRUE;
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +106,6 @@ __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
|
||||||
cx->selectBufSize = size;
|
cx->selectBufSize = size;
|
||||||
}
|
}
|
||||||
glSelectBuffer(size, cx->selectBuf);
|
glSelectBuffer(size, cx->selectBuf);
|
||||||
cx->hasUnflushedCommands = GL_TRUE;
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +243,6 @@ __glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc)
|
||||||
}
|
}
|
||||||
|
|
||||||
glFlush();
|
glFlush();
|
||||||
cx->hasUnflushedCommands = GL_FALSE;
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +265,6 @@ __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc)
|
||||||
|
|
||||||
/* Do a local glFinish */
|
/* Do a local glFinish */
|
||||||
glFinish();
|
glFinish();
|
||||||
cx->hasUnflushedCommands = GL_FALSE;
|
|
||||||
|
|
||||||
/* Send empty reply packet to indicate finish is finished */
|
/* Send empty reply packet to indicate finish is finished */
|
||||||
__GLX_BEGIN_REPLY(0);
|
__GLX_BEGIN_REPLY(0);
|
||||||
|
|
|
@ -86,7 +86,6 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
|
||||||
__GLX_SEND_HEADER();
|
__GLX_SEND_HEADER();
|
||||||
__GLX_SEND_VOID_ARRAY(compsize);
|
__GLX_SEND_VOID_ARRAY(compsize);
|
||||||
}
|
}
|
||||||
cx->hasUnflushedCommands = GL_FALSE;
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,6 @@ __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc)
|
||||||
__GLX_SEND_HEADER();
|
__GLX_SEND_HEADER();
|
||||||
__GLX_SEND_VOID_ARRAY(compsize);
|
__GLX_SEND_VOID_ARRAY(compsize);
|
||||||
}
|
}
|
||||||
cx->hasUnflushedCommands = GL_FALSE;
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue