From c2ff3485b3d48749ea9dcad07bc1a691627dc3e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Thu, 11 Jun 2015 10:41:52 +0300 Subject: [PATCH] glsl: clone inputs and outputs during linking MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Kenneth Graunke Cc: mesa-stable@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 4a726d4e2e7..5da9cadcb08 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; } -- 2.30.2