prog->Validated = false;
prog->_Used = false;
- ralloc_free(prog->InfoLog);
- prog->InfoLog = ralloc_strdup(NULL, "");
-
- ralloc_free(prog->UniformBlocks);
- prog->UniformBlocks = NULL;
- prog->NumUniformBlocks = 0;
- for (int i = 0; i < MESA_SHADER_STAGES; i++) {
- ralloc_free(prog->UniformBlockStageIndex[i]);
- prog->UniformBlockStageIndex[i] = NULL;
- }
-
- ralloc_free(prog->AtomicBuffers);
- prog->AtomicBuffers = NULL;
- prog->NumAtomicBuffers = 0;
prog->ARB_fragment_coord_conventions_enable = false;
/* Separate the shaders into groups based on their type.
}
if ((status == EXIT_SUCCESS) && do_link) {
+ _mesa_clear_shader_program_data(ctx, whole_program);
+
link_shaders(ctx, whole_program);
status = (whole_program->LinkStatus) ? EXIT_SUCCESS : EXIT_FAILURE;
return shader;
}
+void
+_mesa_clear_shader_program_data(struct gl_context *ctx,
+ struct gl_shader_program *shProg)
+{
+ unsigned i;
+
+ shProg->NumUserUniformStorage = 0;
+ shProg->UniformStorage = NULL;
+ shProg->NumUniformRemapTable = 0;
+ shProg->UniformRemapTable = NULL;
+ shProg->UniformHash = NULL;
+
+ ralloc_free(shProg->InfoLog);
+ shProg->InfoLog = ralloc_strdup(shProg, "");
+
+ ralloc_free(shProg->UniformBlocks);
+ shProg->UniformBlocks = NULL;
+ shProg->NumUniformBlocks = 0;
+ for (i = 0; i < MESA_SHADER_STAGES; i++) {
+ ralloc_free(shProg->UniformBlockStageIndex[i]);
+ shProg->UniformBlockStageIndex[i] = NULL;
+ }
+
+ ralloc_free(shProg->AtomicBuffers);
+ shProg->AtomicBuffers = NULL;
+ shProg->NumAtomicBuffers = 0;
+}
+
void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
{
memset(ctx, 0, sizeof(*ctx));
extern "C" struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
+extern "C" void
+_mesa_clear_shader_program_data(struct gl_context *,
+ struct gl_shader_program *);
+
extern "C" void
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
const char *msg, int len);