Mesa (master): meta: Don't forget to flag state when restoring texobjects.

Eric Anholt anholt at kemper.freedesktop.org
Mon Nov 14 17:27:56 UTC 2011


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Nov 10 12:31:11 2011 -0800

meta: Don't forget to flag state when restoring texobjects.

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 at intel.com>

---

 src/mesa/drivers/common/meta.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 8d589e4..f9b582d 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -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);
       }
 




More information about the mesa-commit mailing list