Mesa (master): mesa: remove gl_texture_object:: _Function field and associated code

Brian Paul brianp at kemper.freedesktop.org
Thu Mar 12 02:09:07 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Mar 11 19:23:01 2009 -0600

mesa: remove gl_texture_object::_Function field and associated code

It was only used in one place in swrast.

---

 src/mesa/main/mtypes.h        |    4 ----
 src/mesa/main/texstate.c      |   32 --------------------------------
 src/mesa/swrast/s_texfilter.c |    4 +++-
 3 files changed, 3 insertions(+), 37 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index e43a6a8..44547f1 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1311,10 +1311,6 @@ struct gl_texture_object
    GLenum CompareMode;		/**< GL_ARB_shadow */
    GLenum CompareFunc;		/**< GL_ARB_shadow */
    GLfloat CompareFailValue;    /**< GL_ARB_shadow_ambient */
-   GLenum _Function;		/**< Comparison function derived from 
-				 * \c CompareOperator, \c CompareMode, and
-				 * \c CompareFunc.
-				 */
    GLenum DepthMode;		/**< GL_ARB_depth_texture */
    GLint _MaxLevel;		/**< actual max mipmap level (q in the spec) */
    GLfloat _MaxLambda;		/**< = _MaxLevel - BaseLevel (q - b in spec) */
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 2b07da8..d71f953 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -354,37 +354,6 @@ update_texture_matrices( GLcontext *ctx )
 
 
 /**
- * Update texture object's _Function field.  We need to do this
- * whenever any of the texture object's shadow-related fields change
- * or when we start/stop using a fragment program.
- *
- * This function could be expanded someday to update additional per-object
- * fields that depend on assorted state changes.
- */
-static void
-update_texture_compare_function(GLcontext *ctx,
-                                struct gl_texture_object *tObj)
-{
-   /* XXX temporarily disable this test since it breaks the GLSL
-    * shadow2D(), etc. functions.
-    */
-   if (0 /*ctx->FragmentProgram._Current*/) {
-      /* Texel/coordinate comparison is ignored for programs.
-       * See GL_ARB_fragment_program/shader spec for details.
-       */
-      tObj->_Function = GL_NONE;
-   }
-   else if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) {
-      /* GL_ARB_shadow */
-      tObj->_Function = tObj->CompareFunc;
-   }
-   else {
-      tObj->_Function = GL_NONE;  /* pass depth through as grayscale */
-   }
-}
-
-
-/**
  * Examine texture unit's combine/env state to update derived state.
  */
 static void
@@ -589,7 +558,6 @@ update_texture_state( GLcontext *ctx )
          enabledFragUnits |= (1 << unit);
 
       update_tex_combine(ctx, texUnit);
-      update_texture_compare_function(ctx, texUnit->_Current);
    }
 
 
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index 8d72018..19317c3 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -2830,7 +2830,9 @@ sample_depth_texture( GLcontext *ctx,
 
    /* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */
 
-   function = tObj->_Function;
+   function = (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) ?
+      tObj->CompareFunc : GL_NONE;
+
    if (tObj->MagFilter == GL_NEAREST) {
       GLuint i;
       for (i = 0; i < n; i++) {




More information about the mesa-commit mailing list