mesa: Ensure that (unit->_Current != 0) == (unit->_ReallyEnabled != 0).
authorEric Anholt <eric@anholt.net>
Wed, 23 Apr 2014 23:32:39 +0000 (16:32 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 30 Apr 2014 21:33:20 +0000 (14:33 -0700)
I'm going to try to delete _ReallyEnabled, which is this weird bitfield
with either 0 or 1 bits set with just the reference to _Current.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/texstate.c

index 36c543b9badd0ff2edcdb84ace6b9fadcf7f1de7..5cbf7914b62a26c076a8f32d0e697c1fed56bced 100644 (file)
@@ -579,6 +579,7 @@ update_texture_state( struct gl_context *ctx )
       texUnit->_ReallyEnabled = 0x0;
 
       if (enabledTargets == 0x0) {
+         _mesa_reference_texobj(&texUnit->_Current, NULL);
          /* neither vertex nor fragment processing uses this unit */
          continue;
       }
@@ -629,6 +630,7 @@ update_texture_state( struct gl_context *ctx )
          }
          else {
             /* fixed-function: texture unit is really disabled */
+            _mesa_reference_texobj(&texUnit->_Current, NULL);
             continue;
          }
       }