After optimization passes and many trasfromations most of memory
NIR holds is a garbage which was being freed only after shader deletion.
Freeing it at the end of linking will save memory which would be useful
in case there are a lot of complex shaders being compiled.
The common case for this issue is 32bit game running under Wine.
The cost of the optimization is around ~3-5% of compilation speed
with complex shaders.
V2: by Jason Ekstrand
- Move nir_sweep up, right after the last change of NIR
Signed-off-by: Danylo Piliaiev <danylo.pilia...@globallogic.com>
src/mesa/drivers/dri/i965/brw_link.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp
index 1071056f14..378426101b 100644
@@ -317,6 +317,8 @@ brw_link_shader(struct gl_context *ctx, struct
infos[stage] = &prog->nir->info;
mesa-dev mailing list