gallium dri st: Propagate the drawable info when we bind to new drawables.
authorThomas Hellstrom <thellstrom-at-vmware-dot-com>
Tue, 28 Apr 2009 12:43:41 +0000 (14:43 +0200)
committerThomas Hellstrom <thellstrom-at-vmware-dot-com>
Tue, 28 Apr 2009 12:45:30 +0000 (14:45 +0200)
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
src/gallium/state_trackers/dri/dri_context.c

index 54d2a56356552d445b68c91bf72f3ccdd4ab2efa..45eaec4ed390204d2058c9e622ec4d64ec3814ee 100644 (file)
@@ -158,9 +158,14 @@ dri_make_current(__DRIcontextPrivate * cPriv,
        */
       screen->dummyContext = ctx;
 
-      /* used in dri_flush_frontbuffer */
-      ctx->dPriv = driDrawPriv;
-      ctx->rPriv = driReadPriv;
+      if (ctx->dPriv != driDrawPriv) {
+        ctx->dPriv = driDrawPriv;
+        ctx->d_stamp = driDrawPriv->lastStamp - 1;
+      }
+      if (ctx->rPriv != driReadPriv) {
+        ctx->rPriv = driReadPriv;
+        ctx->r_stamp = driReadPriv->lastStamp - 1;
+      }
 
       st_make_current(ctx->st, draw->stfb, read->stfb);