From: Tapani Pälli Date: Thu, 11 Jun 2015 07:41:52 +0000 (+0300) Subject: glsl: clone inputs and outputs during linking X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2ff3485b3d48749ea9dcad07bc1a691627dc3e5;p=mesa.git 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 Reviewed-by: Kenneth Graunke Cc: mesa-stable@lists.freedesktop.org --- 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; }