[Mesa-dev] [PATCH 12/15] mesa: Remove unused gl_shader_program::Attributes

Ian Romanick idr at freedesktop.org
Thu Sep 29 10:52:02 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/main/mtypes.h         |    1 -
 src/mesa/main/shader_query.cpp |    9 ++-------
 src/mesa/main/shaderobj.c      |    6 ------
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index ac22f20..8b04ccc 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2155,7 +2155,6 @@ struct gl_shader_program
     *
     * \sa gl_program::Attributes
     */
-   struct gl_program_parameter_list *Attributes;
    struct hash_table *AttributeBindings;
 
    /** Transform feedback varyings */
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 84b25cd..67defd2 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -69,18 +69,13 @@ _mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
       return;
    }
 
-   /* this will replace the current value if it's already in the list */
-   /* We add VERT_ATTRIB_GENERIC0 here so that we can tell the difference of a
+   /* Replace the current value if it's already in the list.  We add
+    * VERT_ATTRIB_GENERIC0 here so that we can tell the difference of a
     * binding to 0 and an entry not being in the table (which returns NULL).
     */
    hash_table_replace(shProg->AttributeBindings,
 		      (void *)(intptr_t)(index + VERT_ATTRIB_GENERIC0),
 		      name);
-   i = _mesa_add_attribute(shProg->Attributes, name, size, datatype, index);
-   if (i < 0) {
-      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindAttribLocation");
-      return;
-   }
 
    /*
     * Note that this attribute binding won't go into effect until
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index ebcdc2d..8313898 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -239,7 +239,6 @@ _mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog
 {
    prog->Type = GL_SHADER_PROGRAM_MESA;
    prog->RefCount = 1;
-   prog->Attributes = _mesa_new_parameter_list();
 
    prog->AttributeBindings = hash_table_ctor(0,
 					     hash_table_string_hash,
@@ -313,11 +312,6 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
 
    _mesa_clear_shader_program_data(ctx, shProg);
 
-   if (shProg->Attributes) {
-      _mesa_free_parameter_list(shProg->Attributes);
-      shProg->Attributes = NULL;
-   }
-
    if (shProg->AttributeBindings) {
       hash_table_dtor(shProg->AttributeBindings);
       shProg->AttributeBindings = NULL;
-- 
1.7.6



More information about the mesa-dev mailing list