[Mesa-dev] [PATCH] glsl: clone inputs and outputs during linking

Tapani Pälli tapani.palli at intel.com
Wed May 6 01:04:05 PDT 2015


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

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 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 330fae0..961b4ac 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2586,7 +2586,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, NULL),
                                 build_stageref(shProg, var->name)))
          return false;
    }
-- 
2.1.0



More information about the mesa-dev mailing list