#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"
/**********************************************************************/
{
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;
_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);
_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 */