From: Tapani Pälli Date: Mon, 5 Sep 2016 06:18:09 +0000 (+0300) Subject: i965: release GLSL IR in LinkShader after it's not needed X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4542c7ed5fc6d8cb2495d322b4f06d802d7292cc;p=mesa.git i965: release GLSL IR in LinkShader after it's not needed Signed-off-by: Tapani Pälli Reviewed-by: Timothy Arceri --- diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp index 4800be07e80..2b1fa61e117 100644 --- a/src/mesa/drivers/dri/i965/brw_link.cpp +++ b/src/mesa/drivers/dri/i965/brw_link.cpp @@ -286,5 +286,16 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg) return false; build_program_resource_list(ctx, shProg); + + for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) { + struct gl_linked_shader *shader = shProg->_LinkedShaders[stage]; + if (!shader) + continue; + + /* The GLSL IR won't be needed anymore. */ + ralloc_free(shader->ir); + shader->ir = NULL; + } + return true; }