Mesa (master): mesa: fix texture enable regression

Brian Paul brianp at kemper.freedesktop.org
Mon Mar 2 22:22:48 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Mar  2 15:19:53 2009 -0700

mesa: fix texture enable regression

Need to clear the _ReallyEnabled field before possibly continuing the loop.
Also, set _Current pointer to NULL if the unit is no longer enabled.

Fixes piglit lodbias regression

---

 src/mesa/main/texstate.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 672a125..b29721e 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -549,13 +549,13 @@ update_texture_state( GLcontext *ctx )
 
       enabledTargets = enabledVertTargets | enabledFragTargets;
 
+      texUnit->_ReallyEnabled = 0x0;
+
       if (enabledTargets == 0x0) {
          /* neither vertex nor fragment processing uses this unit */
          continue;
       }
 
-      texUnit->_ReallyEnabled = 0x0;
-
       /* Look for the highest priority texture target that's enabled (or used
        * by the vert/frag shaders) and "complete".  That's the one we'll use
        * for texturing.  If we're using vert/frag program we're guaranteed
@@ -580,6 +580,7 @@ update_texture_state( GLcontext *ctx )
          update_texture_compare_function(ctx, texUnit->_Current);
 
       if (!texUnit->_ReallyEnabled) {
+         _mesa_reference_texobj(&texUnit->_Current, NULL);
          continue;
       }
 




More information about the mesa-commit mailing list