xlib: shortcircuit no-op makecurrent
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 22 Apr 2008 10:15:51 +0000 (11:15 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 22 Apr 2008 10:15:51 +0000 (11:15 +0100)
src/gallium/winsys/xlib/fakeglx.c

index 902a7550754d9820f57bd9503888d14822dcf23d..6e04cb4117cbb43b48311c07e30ffd22fd330977 100644 (file)
@@ -1504,6 +1504,13 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
 #endif
       }
 
+      if (MakeCurrent_PrevContext == ctx &&
+          MakeCurrent_PrevDrawable == draw &&
+          MakeCurrent_PrevReadable == read &&
+          MakeCurrent_PrevDrawBuffer == drawBuffer &&
+          MakeCurrent_PrevReadBuffer == readBuffer)
+         return True;
+          
       MakeCurrent_PrevContext = ctx;
       MakeCurrent_PrevDrawable = draw;
       MakeCurrent_PrevReadable = read;