summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2015-06-11 10:41:52 +0300
committerKenneth Graunke <kenneth@whitecape.org>2015-06-24 12:01:21 -0700
commitc2ff3485b3d48749ea9dcad07bc1a691627dc3e5 (patch)
treecbfaef450e33045e647c3e6b51ee406891fca447 /src/glsl
parent4b35ab9bdb4e663f41ff5c9ae5bbcc650b6093f9 (diff)
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
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/linker.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}