i965: release GLSL IR in LinkShader after it's not needed
authorTapani Pälli <tapani.palli@intel.com>
Mon, 5 Sep 2016 06:18:09 +0000 (09:18 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Fri, 9 Sep 2016 04:51:04 +0000 (07:51 +0300)
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/mesa/drivers/dri/i965/brw_link.cpp

index 4800be07e8021dfbca61009c2e47f7b13afdf218..2b1fa61e11797b9e256a1f05630523d88b539f0c 100644 (file)
@@ -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;
 }