summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-03-27 23:09:11 -0700
committerKenneth Graunke <[email protected]>2019-03-28 09:31:12 -0700
commit1d72de3bcc9a5aa05ae612ee67ca00858f0d33fa (patch)
tree17c4488d16961f253205ca3d911bcf97701d08e3 /src/mesa
parent227b19120692a0d2d1d41694cb5131a78f333a3b (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp4
1 files changed, 4 insertions, 0 deletions
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;