aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/shaderobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/shaderobj.c')
-rw-r--r--mesalib/src/mesa/main/shaderobj.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/mesalib/src/mesa/main/shaderobj.c b/mesalib/src/mesa/main/shaderobj.c
index ccf7efddb..454007f83 100644
--- a/mesalib/src/mesa/main/shaderobj.c
+++ b/mesalib/src/mesa/main/shaderobj.c
@@ -37,7 +37,6 @@
#include "main/shaderobj.h"
#include "program/program.h"
#include "program/prog_parameter.h"
-#include "program/prog_uniform.h"
#include "program/hash_table.h"
#include "ralloc.h"
@@ -241,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;
@@ -275,9 +275,15 @@ void
_mesa_clear_shader_program_data(struct gl_context *ctx,
struct gl_shader_program *shProg)
{
- if (shProg->Uniforms) {
- _mesa_free_uniform_list(shProg->Uniforms);
- shProg->Uniforms = NULL;
+ if (shProg->UniformStorage) {
+ ralloc_free(shProg->UniformStorage);
+ shProg->NumUserUniformStorage = 0;
+ shProg->UniformStorage = NULL;
+ }
+
+ if (shProg->UniformHash) {
+ string_to_uint_map_dtor(shProg->UniformHash);
+ shProg->UniformHash = NULL;
}
if (shProg->Varying) {
@@ -311,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);