summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-09-30 14:21:10 -0700
committerIan Romanick <[email protected]>2011-10-04 12:33:28 -0700
commit7bbcc0b832b02f9da6365ec6a86a0167cf75d8a8 (patch)
treefaa48eeceeebf252d5c10cb688aec5eaa44fe4f9
parentefd027a8b5f4c874a9286fcaf8cc0df7ea3605a8 (diff)
glsl: Delete symbol table in post-link shaders
The symbol table in the linked shaders may contain references to variables that were removed (e.g., unused uniforms). Since it may contain junk, there is no possible valid use. Delete it and set the pointer to NULL. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/glsl/linker.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index d802a0a9bae..6d40dd2e393 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1831,6 +1831,14 @@ done:
/* Retain any live IR, but trash the rest. */
reparent_ir(prog->_LinkedShaders[i]->ir, prog->_LinkedShaders[i]->ir);
+
+ /* The symbol table in the linked shaders may contain references to
+ * variables that were removed (e.g., unused uniforms). Since it may
+ * contain junk, there is no possible valid use. Delete it and set the
+ * pointer to NULL.
+ */
+ delete prog->_LinkedShaders[i]->symbols;
+ prog->_LinkedShaders[i]->symbols = NULL;
}
ralloc_free(mem_ctx);