Mesa (master): st/nir: Free the GLSL IR after linking.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 28 16:31:25 UTC 2019


Module: Mesa
Branch: master
Commit: 1d72de3bcc9a5aa05ae612ee67ca00858f0d33fa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1d72de3bcc9a5aa05ae612ee67ca00858f0d33fa

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Mar 27 23:09:11 2019 -0700

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 <tarceri at itsqueeze.com>

---

 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;




More information about the mesa-commit mailing list