summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderobj.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-11-04 16:08:52 -0700
committerIan Romanick <[email protected]>2011-11-08 11:10:11 -0800
commitb12b5d9ab5c0153c93ca5ad9cd93cb36e41be4eb (patch)
tree774cdb05ed2b05230cf54f0e5aadf1a3d836c2e8 /src/mesa/main/shaderobj.c
parent4464a4b27b66f832acbe52b0a002c04415924c14 (diff)
linker: Use app-specified fragment data location during linking
Fixes piglit's bindfragdata-link-error. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderobj.c')
-rw-r--r--src/mesa/main/shaderobj.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 9abf606f00f..454007f8353 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -240,6 +240,7 @@ _mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog
prog->RefCount = 1;
prog->AttributeBindings = string_to_uint_map_ctor();
+ prog->FragDataBindings = string_to_uint_map_ctor();
#if FEATURE_ARB_geometry_shader4
prog->Geom.VerticesOut = 0;
@@ -316,6 +317,11 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
shProg->AttributeBindings = NULL;
}
+ if (shProg->FragDataBindings) {
+ string_to_uint_map_dtor(shProg->FragDataBindings);
+ shProg->FragDataBindings = NULL;
+ }
+
/* detach shaders */
for (i = 0; i < shProg->NumShaders; i++) {
_mesa_reference_shader(ctx, &shProg->Shaders[i], NULL);