From 4542c7ed5fc6d8cb2495d322b4f06d802d7292cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Mon, 5 Sep 2016 09:18:09 +0300 Subject: [PATCH] i965: release GLSL IR in LinkShader after it's not needed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Tapani Pälli Reviewed-by: Timothy Arceri --- src/mesa/drivers/dri/i965/brw_link.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp index 4800be0..2b1fa61 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; } -- 2.7.4