Merge branch 'gallium-0.1' into gallium-0.2
[mesa.git] / src / gallium / winsys / xlib / fakeglx.c
index 6e04cb4117cbb43b48311c07e30ffd22fd330977..2c0075e93454c14b1edbe2df27009fc54cde9f6e 100644 (file)
@@ -1459,6 +1459,13 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
                             GLXDrawable read, GLXContext ctx )
 {
    struct fake_glx_context *glxCtx = (struct fake_glx_context *) ctx;
+   static boolean firsttime = 1, no_rast = 0;
+
+   if (firsttime) {
+      no_rast = getenv("SP_NO_RAST") != NULL;
+      firsttime = 0;
+   }
+
 
    if (ctx && draw && read) {
       XMesaBuffer drawBuffer, readBuffer;
@@ -1504,7 +1511,8 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
 #endif
       }
 
-      if (MakeCurrent_PrevContext == ctx &&
+      if (no_rast &&
+          MakeCurrent_PrevContext == ctx &&
           MakeCurrent_PrevDrawable == draw &&
           MakeCurrent_PrevReadable == read &&
           MakeCurrent_PrevDrawBuffer == drawBuffer &&
@@ -1681,6 +1689,15 @@ static void
 Fake_glXSwapBuffers( Display *dpy, GLXDrawable drawable )
 {
    XMesaBuffer buffer = XMesaFindBuffer( dpy, drawable );
+   static boolean firsttime = 1, no_rast = 0;
+
+   if (firsttime) {
+      no_rast = getenv("SP_NO_RAST") != NULL;
+      firsttime = 0;
+   }
+
+   if (no_rast)
+      return;
 
    if (buffer) {
       XMesaSwapBuffers(buffer);