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 902a755..6e04cb4 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;