aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/shaderobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-09 16:58:33 +0100
committermarha <marha@users.sourceforge.net>2011-11-09 16:58:33 +0100
commita8e5f06fe01732fbd643bc435dd3b8eaa602defe (patch)
treeb18cd9881bc5a6d317edca6c38fa912bade00802 /mesalib/src/mesa/main/shaderobj.c
parent1ed503a856d9753a813951796bc6ba56c42ecd28 (diff)
downloadvcxsrv-a8e5f06fe01732fbd643bc435dd3b8eaa602defe.tar.gz
vcxsrv-a8e5f06fe01732fbd643bc435dd3b8eaa602defe.tar.bz2
vcxsrv-a8e5f06fe01732fbd643bc435dd3b8eaa602defe.zip
libX11 mesa pixman git update 9 nov 2011
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);