From: Kenneth Graunke Date: Thu, 28 Mar 2019 06:09:11 +0000 (-0700) Subject: st/nir: Free the GLSL IR after linking. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d72de3bcc9a5aa05ae612ee67ca00858f0d33fa;p=mesa.git st/nir: Free the GLSL IR after linking. i965 does this, and st's tgsi path does this. st/nir did not. Cuts 138MB of memory from a DiRT Rally trace, which is about 44% of the total GLSL IR memory. Reviewed-by: Timothy Arceri --- diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 78ca83c76e7..96fc257032e 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -839,6 +839,10 @@ st_link_nir(struct gl_context *ctx, } nir_sweep(shader->Program->nir); + + /* The GLSL IR won't be needed anymore. */ + ralloc_free(shader->ir); + shader->ir = NULL; } return true;