From: Ian Romanick <ian.d.roman...@intel.com> Reduces the peak ir_variable memory usage in a trimmed apitrace of dota2 by 181KiB on 64-bit.
Before: IR MEM: variable usage / name / total: 5327760 1121441 6449201 After: IR MEM: variable usage / name / total: 5327760 935234 6262994 Reduces the peak ir_variable memory usage in a trimmed apitrace of dota2 by 114KiB on 32-bit. Before: IR MEM: variable usage / name / total: 4118280 787727 4906007 After: IR MEM: variable usage / name / total: 4118280 670980 4789260 Signed-off-by: Ian Romanick <ian.d.roman...@intel.com> --- src/glsl/ast_function.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index bad410b..24bbd90 100644 --- a/src/glsl/ast_function.cpp +++ b/src/glsl/ast_function.cpp @@ -394,12 +394,9 @@ generate_call(exec_list *instructions, ir_function_signature *sig, ir_dereference_variable *deref = NULL; if (!sig->return_type->is_void()) { /* Create a new temporary to hold the return value. */ - ir_variable *var; + ir_variable *var = + new(ctx) ir_variable(sig->return_type, "$r", ir_var_temporary); - var = new(ctx) ir_variable(sig->return_type, - ralloc_asprintf(ctx, "%s_retval", - sig->function_name()), - ir_var_temporary); instructions->push_tail(var); deref = new(ctx) ir_dereference_variable(var); -- 1.8.1.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev