Mesa (master): mesa: Finish removing the _ReallyEnabled field.

Eric Anholt anholt at kemper.freedesktop.org
Wed Apr 30 21:53:45 UTC 2014


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Apr 23 18:21:11 2014 -0700

mesa: Finish removing the _ReallyEnabled field.

Reviewed-by: Matt Turner <mattst88 at gmail.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/mtypes.h   |    4 +---
 src/mesa/main/texstate.c |    6 +-----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7a0227d..4c2ad90 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1086,7 +1086,6 @@ typedef enum
 
 /**
  * Bit flags for each type of texture object
- * Used for Texture.Unit[]._ReallyEnabled flags.
  */
 /*@{*/
 #define TEXTURE_2D_MULTISAMPLE_BIT (1 << TEXTURE_2D_MULTISAMPLE_INDEX)
@@ -1328,7 +1327,6 @@ struct gl_texgen
 struct gl_texture_unit
 {
    GLbitfield Enabled;          /**< bitmask of TEXTURE_*_BIT flags */
-   GLbitfield _ReallyEnabled;   /**< 0 or exactly one of TEXTURE_*_BIT flags */
 
    GLenum EnvMode;              /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
    GLclampf EnvColor[4];
@@ -1401,7 +1399,7 @@ struct gl_texture_attrib
    /** Bitwise-OR of all Texture.Unit[i]._GenFlags */
    GLbitfield _GenFlags;
 
-   /** Upper bound on _ReallyEnabled texunits. */
+   /** Largest index of a texture unit with _Current != NULL. */
    GLint _MaxEnabledTexImageUnit;
 };
 
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 28e8bb1..24469da 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -576,8 +576,6 @@ update_texture_state( struct gl_context *ctx )
          enabledTargets |= enabledTargetsByStage[i];
       }
 
-      texUnit->_ReallyEnabled = 0x0;
-
       if (enabledTargets == 0x0) {
          _mesa_reference_texobj(&texUnit->_Current, NULL);
          /* neither vertex nor fragment processing uses this unit */
@@ -600,14 +598,13 @@ update_texture_state( struct gl_context *ctx )
                _mesa_test_texobj_completeness(ctx, texObj);
             }
             if (_mesa_is_texture_complete(texObj, sampler)) {
-               texUnit->_ReallyEnabled = 1 << texIndex;
                _mesa_reference_texobj(&texUnit->_Current, texObj);
                break;
             }
          }
       }
 
-      if (!texUnit->_ReallyEnabled) {
+      if (texIndex == NUM_TEXTURE_TARGETS) {
          if (prog[MESA_SHADER_FRAGMENT]) {
             /* If we get here it means the shader is expecting a texture
              * object, but there isn't one (or it's incomplete).  Use the
@@ -626,7 +623,6 @@ update_texture_state( struct gl_context *ctx )
             }
 
             _mesa_reference_texobj(&texUnit->_Current, texObj);
-            texUnit->_ReallyEnabled = 1 << texTarget;
          }
          else {
             /* fixed-function: texture unit is really disabled */




More information about the mesa-commit mailing list