Mesa (master): mesa: Remove the "Used" flag in gl_program_parameter.

Eric Anholt anholt at kemper.freedesktop.org
Wed Aug 25 19:40:10 UTC 2010


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Aug 24 16:47:09 2010 -0700

mesa: Remove the "Used" flag in gl_program_parameter.

This was in place for uniform handling, but nothing actually needs the
value now, since presence in a parameter list indicates that the
uniform was used as far as the linker was concerned.

---

 src/mesa/program/ir_to_mesa.cpp   |    5 -----
 src/mesa/program/prog_parameter.c |   22 ----------------------
 src/mesa/program/prog_parameter.h |    7 +------
 3 files changed, 1 insertions(+), 33 deletions(-)

diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index fc145b4..4429b74 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -1427,11 +1427,6 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
 	 loc = add_uniform(ir->var->name,
 			   ir->var->type);
 
-	 /* Always mark the uniform used at this point.  If it isn't
-	  * used, dead code elimination should have nuked the decl already.
-	  */
-	 this->prog->Parameters->Parameters[loc].Used = GL_TRUE;
-
 	 entry = new(mem_ctx) variable_storage(ir->var, PROGRAM_UNIFORM, loc);
 	 this->variables.push_tail(entry);
 	 break;
diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c
index fa5deaf..7e01f67 100644
--- a/src/mesa/program/prog_parameter.c
+++ b/src/mesa/program/prog_parameter.c
@@ -315,27 +315,6 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList,
 
 
 /**
- * Mark the named uniform as 'used'.
- */
-void
-_mesa_use_uniform(struct gl_program_parameter_list *paramList,
-                  const char *name)
-{
-   GLuint i;
-   for (i = 0; i < paramList->NumParameters; i++) {
-      struct gl_program_parameter *p = paramList->Parameters + i;
-      if ((p->Type == PROGRAM_UNIFORM || p->Type == PROGRAM_SAMPLER) &&
-          strcmp(p->Name, name) == 0) {
-         p->Used = GL_TRUE;
-         /* Note that large uniforms may occupy several slots so we're
-          * not done searching yet.
-          */
-      }
-   }
-}
-
-
-/**
  * Add a sampler to the parameter list.
  * \param name  uniform's name
  * \param datatype  GL_SAMPLER_2D, GL_SAMPLER_2D_RECT_ARB, etc.
@@ -658,7 +637,6 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list)
                                     list->ParameterValues[i], NULL, 0x0);
       ASSERT(j >= 0);
       pCopy = clone->Parameters + j;
-      pCopy->Used = p->Used;
       pCopy->Flags = p->Flags;
       /* copy state indexes */
       if (p->Type == PROGRAM_STATE_VAR) {
diff --git a/src/mesa/program/prog_parameter.h b/src/mesa/program/prog_parameter.h
index 1860f31..5381a6d 100644
--- a/src/mesa/program/prog_parameter.h
+++ b/src/mesa/program/prog_parameter.h
@@ -64,8 +64,7 @@ struct gl_program_parameter
     * The next program parameter's Size will be Size-4 of this parameter.
     */
    GLuint Size;
-   GLboolean Used;          /**< Helper flag for GLSL uniform tracking */
-   GLboolean Initialized;   /**< Has the ParameterValue[] been set? */
+   GLboolean Initialized;   /**< debug: Has the ParameterValue[] been set? */
    GLbitfield Flags;        /**< Bitmask of PROG_PARAM_*_BIT */
    /**
     * A sequence of STATE_* tokens and integers to identify GL state.
@@ -136,10 +135,6 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList,
                   const char *name, GLuint size, GLenum datatype,
                   const GLfloat *values);
 
-extern void
-_mesa_use_uniform(struct gl_program_parameter_list *paramList,
-                  const char *name);
-
 extern GLint
 _mesa_add_sampler(struct gl_program_parameter_list *paramList,
                   const char *name, GLenum datatype, int array_length);




More information about the mesa-commit mailing list