Module: Mesa
Branch: master
Commit: 94118fe2d4b1e5d0b9f39d9d2c44706db462e97e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=94118fe2d4b1e5d0b9f39d9d2c44706db462e97e

Author: Kristian Høgsberg <k...@bitplanet.net>
Date:   Thu Sep  9 13:18:40 2010 -0400

glx: Optimize out no-op make current calls

This make a lot more sense now that we might have to recreate the
glx drawables for legacy code paths.

---

 src/glx/glxcurrent.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
index 0d359f7..3631738 100644
--- a/src/glx/glxcurrent.c
+++ b/src/glx/glxcurrent.c
@@ -242,6 +242,10 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
       return False;
    }
 
+   if (oldGC == gc &&
+       gc->currentDrawable == draw && gc->currentReadable == read)
+      return True;
+
    if (oldGC != &dummyContext) {
       oldGC->vtable->unbind(oldGC, gc);
       oldGC->currentDpy = 0;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to