#include "main/context.h"
#include "main/hash.h"
#include "main/mtypes.h"
+#include "main/shaderapi.h"
#include "main/shaderobj.h"
#include "main/uniforms.h"
#include "program/program.h"
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
{
struct gl_shader *shader;
- assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER ||
- type == GL_GEOMETRY_SHADER_ARB);
+ assert(_mesa_validate_shader_target(ctx, type));
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
shader->Type = type;
ralloc_free(shProg->UniformStorage);
shProg->NumUserUniformStorage = 0;
shProg->UniformStorage = NULL;
- shProg->UniformLocationBaseScale = 0;
+ }
+
+ if (shProg->UniformRemapTable) {
+ ralloc_free(shProg->UniformRemapTable);
+ shProg->NumUniformRemapTable = 0;
+ shProg->UniformRemapTable = NULL;
}
if (shProg->UniformHash) {
}
free(shProg->Label);
+ shProg->Label = NULL;
}