summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderobj.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-08-17 15:38:53 -0700
committerIan Romanick <[email protected]>2011-10-04 13:17:46 -0700
commit015d4f61ef9116c9e844299ab9f2b15c653c0450 (patch)
tree34a5fb02901f83bad94e104854df8e45230e483d /src/mesa/main/shaderobj.c
parent2fd80534f01a5c684c47eff3946f412192ae3c0b (diff)
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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderobj.c')
-rw-r--r--src/mesa/main/shaderobj.c9
1 files changed, 9 insertions, 0 deletions
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);