mesa: move _mesa_clear_accum_buffer() inside FEATURE_accum test
[mesa.git] / src / mesa / main / shaderobj.c
index f128648f477a3cb520230aac6e7ebf92af7a655f..de66851e9c9549f0d4281b62d41db573e0679d87 100644 (file)
@@ -37,7 +37,7 @@
 #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"
 
 /**********************************************************************/
@@ -238,7 +238,10 @@ _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();
+   prog->FragDataBindings = string_to_uint_map_ctor();
+
 #if FEATURE_ARB_geometry_shader4
    prog->Geom.VerticesOut = 0;
    prog->Geom.InputType = GL_TRIANGLES;
@@ -272,18 +275,15 @@ void
 _mesa_clear_shader_program_data(struct gl_context *ctx,
                                 struct gl_shader_program *shProg)
 {
-   _mesa_reference_vertprog(ctx, &shProg->VertexProgram, NULL);
-   _mesa_reference_fragprog(ctx, &shProg->FragmentProgram, NULL);
-   _mesa_reference_geomprog(ctx, &shProg->GeometryProgram, NULL);
-
-   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->Varying) {
-      _mesa_free_parameter_list(shProg->Varying);
-      shProg->Varying = NULL;
+   if (shProg->UniformHash) {
+      string_to_uint_map_dtor(shProg->UniformHash);
+      shProg->UniformHash = NULL;
    }
 
    assert(shProg->InfoLog != NULL);
@@ -307,9 +307,14 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
 
    _mesa_clear_shader_program_data(ctx, shProg);
 
-   if (shProg->Attributes) {
-      _mesa_free_parameter_list(shProg->Attributes);
-      shProg->Attributes = NULL;
+   if (shProg->AttributeBindings) {
+      string_to_uint_map_dtor(shProg->AttributeBindings);
+      shProg->AttributeBindings = NULL;
+   }
+
+   if (shProg->FragDataBindings) {
+      string_to_uint_map_dtor(shProg->FragDataBindings);
+      shProg->FragDataBindings = NULL;
    }
 
    /* detach shaders */