mesa: Remove unused gl_program::Attributes
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 18 Aug 2011 22:43:50 +0000 (15:43 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 4 Oct 2011 20:17:48 +0000 (13:17 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/mtypes.h
src/mesa/main/shader_query.cpp
src/mesa/program/ir_to_mesa.cpp
src/mesa/program/program.c
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index bd9de8a36917406eec4aa7ae8a4d4172854fb203..67db4df8f79328e59a05d4eeab41539b81619d5f 100644 (file)
@@ -1834,9 +1834,6 @@ struct gl_program
    /** Numbered local parameters */
    GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4];
 
-   /** Vertex program user-defined attributes */
-   struct gl_program_parameter_list *Attributes;
-
    /** Map from sampler unit to texture unit (set by glUniform1i()) */
    GLubyte SamplerUnits[MAX_SAMPLERS];
    /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */
@@ -2152,8 +2149,6 @@ struct gl_shader_program
     * These are set via \c glBindAttribLocation and are used to direct the
     * GLSL linker.  These are \b not the values used in the compiled shader,
     * and they are \b not the values returned by \c glGetAttribLocation.
-    *
-    * \sa gl_program::Attributes
     */
    struct string_to_uint_map *AttributeBindings;
 
index e532a29e1cf96d811ed991965211e7433157ad9c..bd873a491344797af8c2c25dfa959a6f921dd203 100644 (file)
@@ -45,10 +45,6 @@ _mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
 {
    GET_CURRENT_CONTEXT(ctx);
 
-   const GLint size = -1; /* unknown size */
-   GLint i;
-   GLenum datatype = GL_FLOAT_VEC4;
-
    struct gl_shader_program *const shProg =
       _mesa_lookup_shader_program_err(ctx, program, "glBindAttribLocation");
    if (!shProg)
index 033ef38b7c242f3656487bbe66f12b910f2d8a2e..2e1b8fba30680fa4c9f8f480df7912a1d42d61b5 100644 (file)
@@ -1559,14 +1559,6 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
          entry = new(mem_ctx) variable_storage(var,
                                                PROGRAM_INPUT,
                                                var->location);
-         if (this->prog->Target == GL_VERTEX_PROGRAM_ARB &&
-             var->location >= VERT_ATTRIB_GENERIC0) {
-            _mesa_add_attribute(this->prog->Attributes,
-                                var->name,
-                                _mesa_sizeof_glsl_type(var->type->gl_type),
-                                var->type->gl_type,
-                                var->location - VERT_ATTRIB_GENERIC0);
-         }
          break;
       case ir_var_out:
         assert(var->location != -1);
@@ -3048,7 +3040,6 @@ get_mesa_program(struct gl_context *ctx,
    if (!prog)
       return NULL;
    prog->Parameters = _mesa_new_parameter_list();
-   prog->Attributes = _mesa_new_parameter_list();
    v.ctx = ctx;
    v.prog = prog;
    v.shader_program = shader_program;
index bdab30466ccacc9f66b15574de926b4376c19563..4d6c60b9d6cd2585a148505ffdd50ec53954f444 100644 (file)
@@ -394,9 +394,6 @@ _mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
    if (prog->Parameters) {
       _mesa_free_parameter_list(prog->Parameters);
    }
-   if (prog->Attributes) {
-      _mesa_free_parameter_list(prog->Attributes);
-   }
 
    free(prog);
 }
@@ -519,8 +516,6 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
    if (prog->Parameters)
       clone->Parameters = _mesa_clone_parameter_list(prog->Parameters);
    memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
-   if (prog->Attributes)
-      clone->Attributes = _mesa_clone_parameter_list(prog->Attributes);
    memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
    clone->IndirectRegisterFiles = prog->IndirectRegisterFiles;
    clone->NumInstructions = prog->NumInstructions;
index b8ca2c14dd6f8d304752916374a3ee8a93d34559..d8ef8a3ce1988233d09a00296c1ac6fe72f84ca3 100644 (file)
@@ -1933,14 +1933,6 @@ glsl_to_tgsi_visitor::visit(ir_dereference_variable *ir)
          entry = new(mem_ctx) variable_storage(var,
                                                PROGRAM_INPUT,
                                                var->location);
-         if (this->prog->Target == GL_VERTEX_PROGRAM_ARB &&
-             var->location >= VERT_ATTRIB_GENERIC0) {
-            _mesa_add_attribute(this->prog->Attributes,
-                                var->name,
-                                _mesa_sizeof_glsl_type(var->type->gl_type),
-                                var->type->gl_type,
-                                var->location - VERT_ATTRIB_GENERIC0);
-         }
          break;
       case ir_var_out:
          assert(var->location != -1);
@@ -3986,7 +3978,6 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp,
    /* Make modifications to fragment program info. */
    prog->Parameters = _mesa_combine_parameter_lists(params,
                                                     original->prog->Parameters);
-   prog->Attributes = _mesa_clone_parameter_list(original->prog->Attributes);
    _mesa_free_parameter_list(params);
    count_resources(v, prog);
    fp->glsl_to_tgsi = v;
@@ -4061,7 +4052,6 @@ get_bitmap_visitor(struct st_fragment_program *fp,
 
    /* Make modifications to fragment program info. */
    prog->Parameters = _mesa_clone_parameter_list(original->prog->Parameters);
-   prog->Attributes = _mesa_clone_parameter_list(original->prog->Attributes);
    count_resources(v, prog);
    fp->glsl_to_tgsi = v;
 }
@@ -4967,7 +4957,6 @@ get_mesa_program(struct gl_context *ctx,
    if (!prog)
       return NULL;
    prog->Parameters = _mesa_new_parameter_list();
-   prog->Attributes = _mesa_new_parameter_list();
    v->ctx = ctx;
    v->prog = prog;
    v->shader_program = shader_program;