From 015d4f61ef9116c9e844299ab9f2b15c653c0450 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 17 Aug 2011 15:38:53 -0700 Subject: mesa: Add gl_shader_program::AttributeBindings This currently mirrors the state tracking gl_shader_program::Attributes, but I'm working towards eliminating that. Signed-off-by: Ian Romanick Reviewed-by: Kenneth Graunke --- src/mesa/main/shaderobj.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mesa/main/shaderobj.c') diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index f128648f477..322f4290656 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -38,6 +38,7 @@ #include "program/program.h" #include "program/prog_parameter.h" #include "program/prog_uniform.h" +#include "program/hash_table.h" #include "ralloc.h" /**********************************************************************/ @@ -239,6 +240,9 @@ _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 = string_to_uint_map_ctor(); + #if FEATURE_ARB_geometry_shader4 prog->Geom.VerticesOut = 0; prog->Geom.InputType = GL_TRIANGLES; @@ -312,6 +316,11 @@ _mesa_free_shader_program_data(struct gl_context *ctx, shProg->Attributes = NULL; } + if (shProg->AttributeBindings) { + string_to_uint_map_dtor(shProg->AttributeBindings); + shProg->AttributeBindings = NULL; + } + /* detach shaders */ for (i = 0; i < shProg->NumShaders; i++) { _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL); -- cgit v1.2.3