summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-10-20 14:40:34 -0700
committerIan Romanick <[email protected]>2014-10-24 19:54:38 -0700
commitfefead3b63584603278b3388cc9c426a8a44e92c (patch)
tree7e9063dcc09658f5b81d09e2c16d05e932242d32 /src/glsl
parent7cbcff06069ad88962115b8b5030e08c74f208cf (diff)
linker: Rely on _mesa_clear_shader_program_data to clear link information
_mesa_link_shader_program already calls _mesa_clear_shader_program_data before calling link_shaders, so this is already done. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/linker.cpp14
-rw-r--r--src/glsl/main.cpp2
-rw-r--r--src/glsl/standalone_scaffolding.cpp28
-rw-r--r--src/glsl/standalone_scaffolding.h4
4 files changed, 34 insertions, 14 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 47a722d9d1e..b0d2e6e5473 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2484,20 +2484,6 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
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.
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index feed100822c..96d39153066 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -403,6 +403,8 @@ main(int argc, char **argv)
}
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;
diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp
index 2b76dd17b2a..a635c969515 100644
--- a/src/glsl/standalone_scaffolding.cpp
+++ b/src/glsl/standalone_scaffolding.cpp
@@ -83,6 +83,34 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
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));
diff --git a/src/glsl/standalone_scaffolding.h b/src/glsl/standalone_scaffolding.h
index df783afdb44..b805f4046f5 100644
--- a/src/glsl/standalone_scaffolding.h
+++ b/src/glsl/standalone_scaffolding.h
@@ -45,6 +45,10 @@ 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);