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.pa...@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 9978380..faa4b2a 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -2630,7 +2630,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.1.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev