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@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
This commit is contained in:
Tapani Pälli 2015-06-11 10:41:52 +03:00 committed by Kenneth Graunke
parent 4b35ab9bdb
commit c2ff3485b3

View file

@ -2637,7 +2637,9 @@ add_interface_variables(struct gl_shader_program *shProg,
continue; 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)) build_stageref(shProg, var->name) | mask))
return false; return false;
} }