diff options
author | Ian Romanick <[email protected]> | 2014-10-20 14:35:01 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-10-24 19:54:38 -0700 |
commit | 7cbcff06069ad88962115b8b5030e08c74f208cf (patch) | |
tree | 59224951de9eeb9c1e3cd693b84c797e161e9271 /src/mesa | |
parent | a3bfc7d313703b2a308645310f4adcaa24be014d (diff) |
mesa: Add some missing clean-up to _mesa_clear_shader_program_data
All of this is already done in link_shaders. More clean-ups coming.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/shaderobj.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index 693e9a259c2..785baa2b252 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -280,8 +280,9 @@ void _mesa_clear_shader_program_data(struct gl_context *ctx, struct gl_shader_program *shProg) { + unsigned i; + if (shProg->UniformStorage) { - unsigned i; for (i = 0; i < shProg->NumUserUniformStorage; ++i) _mesa_uniform_detach_all_driver_storage(&shProg->UniformStorage[i]); ralloc_free(shProg->UniformStorage); @@ -303,6 +304,18 @@ _mesa_clear_shader_program_data(struct gl_context *ctx, assert(shProg->InfoLog != 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; } |