From: Kristian Høgsberg Date: Thu, 9 Sep 2010 17:18:40 +0000 (-0400) Subject: glx: Optimize out no-op make current calls X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94118fe2d4b1e5d0b9f39d9d2c44706db462e97e;p=mesa.git 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. --- diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 0d359f72b4a..36317383544 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;