From 1d72de3bcc9a5aa05ae612ee67ca00858f0d33fa Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 27 Mar 2019 23:09:11 -0700 Subject: [PATCH] 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 --- src/mesa/state_tracker/st_glsl_to_nir.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.30.2