meta: Don't forget to flag state when restoring texobjects.
authorEric Anholt <eric@anholt.net>
Thu, 10 Nov 2011 20:31:11 +0000 (12:31 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 14 Nov 2011 17:26:53 +0000 (09:26 -0800)
It's unlikely that we changed the object but no other texture
parameter, but be correct anyway.  Noticed by inspection.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/common/meta.c

index 8d589e4c3bd68a88009f544478a6ee68e4d4b56f..f9b582df128d5aa6c525d701b8bf2b9916774dc5 100644 (file)
@@ -879,8 +879,11 @@ _mesa_meta_end(struct gl_context *ctx)
 
       /* restore texture objects for unit[0] only */
       for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
-         _mesa_reference_texobj(&ctx->Texture.Unit[0].CurrentTex[tgt],
-                                save->CurrentTexture[tgt]);
+        if (ctx->Texture.Unit[0].CurrentTex[tgt] != save->CurrentTexture[tgt]) {
+           FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+           _mesa_reference_texobj(&ctx->Texture.Unit[0].CurrentTex[tgt],
+                                  save->CurrentTexture[tgt]);
+        }
          _mesa_reference_texobj(&save->CurrentTexture[tgt], NULL);
       }