diff options
author | Adam Jackson <[email protected]> | 2019-09-10 14:59:06 -0400 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2019-09-17 20:16:00 +0000 |
commit | db8be355d13f7da4890b1856de2bc58b8458d445 (patch) | |
tree | 46fcec31d372f361aedc74c7037e399e246d35fc /src/gallium/state_trackers | |
parent | 83f195414a2e89bd9f549dacc04365f67e5bd110 (diff) |
gallium/xlib: Remove drawable caching from the MakeCurrent path
AFAICT this only exists to avoid hitting XMesaFindBuffer, which is a
linear search. But you don't have that many GLX drawables, so whatever.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/glx/xlib/glx_api.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index b9ad7bebe30..f83a7bb88db 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -1176,10 +1176,6 @@ glXCreateContext( Display *dpy, XVisualInfo *visinfo, /* XXX these may have to be removed due to thread-safety issues. */ static GLXContext MakeCurrent_PrevContext = 0; -static GLXDrawable MakeCurrent_PrevDrawable = 0; -static GLXDrawable MakeCurrent_PrevReadable = 0; -static XMesaBuffer MakeCurrent_PrevDrawBuffer = 0; -static XMesaBuffer MakeCurrent_PrevReadBuffer = 0; /* GLX 1.3 and later */ @@ -1200,11 +1196,7 @@ glXMakeContextCurrent( Display *dpy, GLXDrawable draw, XMesaContext xmctx = glxCtx->xmesaContext; /* Find the XMesaBuffer which corresponds to the GLXDrawable 'draw' */ - if (ctx == MakeCurrent_PrevContext - && draw == MakeCurrent_PrevDrawable) { - drawBuffer = MakeCurrent_PrevDrawBuffer; - } - else { + if (ctx == MakeCurrent_PrevContext) { drawBuffer = XMesaFindBuffer( dpy, draw ); } if (!drawBuffer) { @@ -1217,11 +1209,7 @@ glXMakeContextCurrent( Display *dpy, GLXDrawable draw, } /* Find the XMesaBuffer which corresponds to the GLXDrawable 'read' */ - if (ctx == MakeCurrent_PrevContext - && read == MakeCurrent_PrevReadable) { - readBuffer = MakeCurrent_PrevReadBuffer; - } - else { + if (ctx == MakeCurrent_PrevContext) { readBuffer = XMesaFindBuffer( dpy, read ); } if (!readBuffer) { @@ -1233,19 +1221,10 @@ glXMakeContextCurrent( Display *dpy, GLXDrawable draw, } } - if (no_rast && - MakeCurrent_PrevContext == ctx && - MakeCurrent_PrevDrawable == draw && - MakeCurrent_PrevReadable == read && - MakeCurrent_PrevDrawBuffer == drawBuffer && - MakeCurrent_PrevReadBuffer == readBuffer) + if (no_rast && MakeCurrent_PrevContext == ctx) return True; MakeCurrent_PrevContext = ctx; - MakeCurrent_PrevDrawable = draw; - MakeCurrent_PrevReadable = read; - MakeCurrent_PrevDrawBuffer = drawBuffer; - MakeCurrent_PrevReadBuffer = readBuffer; /* Now make current! */ if (XMesaMakeCurrent2(xmctx, drawBuffer, readBuffer)) { @@ -1263,10 +1242,6 @@ glXMakeContextCurrent( Display *dpy, GLXDrawable draw, /* release current context w/out assigning new one. */ XMesaMakeCurrent2( NULL, NULL, NULL ); MakeCurrent_PrevContext = 0; - MakeCurrent_PrevDrawable = 0; - MakeCurrent_PrevReadable = 0; - MakeCurrent_PrevDrawBuffer = 0; - MakeCurrent_PrevReadBuffer = 0; SetCurrentContext(NULL); return True; } @@ -1430,10 +1405,6 @@ glXDestroyContext( Display *dpy, GLXContext ctx ) GLXContext glxCtx = ctx; (void) dpy; MakeCurrent_PrevContext = 0; - MakeCurrent_PrevDrawable = 0; - MakeCurrent_PrevReadable = 0; - MakeCurrent_PrevDrawBuffer = 0; - MakeCurrent_PrevReadBuffer = 0; XMesaDestroyContext( glxCtx->xmesaContext ); XMesaGarbageCollect(); free(glxCtx); |