Mesa (master): glsl: clone inputs and outputs during linking

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Jun 24 19:58:35 UTC 2015


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

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Thu Jun 11 10:41:52 2015 +0300

glsl: clone inputs and outputs during linking

This increases memory pressure during linking but makes it easier
for backend to free IR after it is not needed anymore.

v2: use resource list as ralloc context in case of relink (Kenneth)

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: mesa-stable at lists.freedesktop.org

---

 src/glsl/linker.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 4a726d4..5da9cad 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2637,7 +2637,9 @@ add_interface_variables(struct gl_shader_program *shProg,
          continue;
       };
 
-      if (!add_program_resource(shProg, programInterface, var,
+      /* Clone ir_variable data so that backend is able to free memory. */
+      if (!add_program_resource(shProg, programInterface,
+                                var->clone(shProg->ProgramResourceList, NULL),
                                 build_stageref(shProg, var->name) | mask))
          return false;
    }




More information about the mesa-commit mailing list