glsl2: Make the clone() method take a talloc context.
In most cases, we needed to be reparenting the cloned IR to a different context (for example, to the linked shader instead of the unlinked shader), or optimization before the reparent would cause memory usage of the original object to grow and grow.
This commit is contained in:
@@ -966,7 +966,7 @@ ast_expression::hir(exec_list *instructions,
|
||||
op[0], op[1]);
|
||||
|
||||
result = do_assignment(instructions, state,
|
||||
op[0]->clone(NULL), temp_rhs,
|
||||
op[0]->clone(ctx, NULL), temp_rhs,
|
||||
this->subexpressions[0]->get_location());
|
||||
type = result->type;
|
||||
error_emitted = (op[0]->type->is_error());
|
||||
@@ -992,7 +992,7 @@ ast_expression::hir(exec_list *instructions,
|
||||
op[0], op[1]);
|
||||
|
||||
result = do_assignment(instructions, state,
|
||||
op[0]->clone(NULL), temp_rhs,
|
||||
op[0]->clone(ctx, NULL), temp_rhs,
|
||||
this->subexpressions[0]->get_location());
|
||||
type = result->type;
|
||||
error_emitted = type->is_error();
|
||||
@@ -1113,7 +1113,7 @@ ast_expression::hir(exec_list *instructions,
|
||||
op[0], op[1]);
|
||||
|
||||
result = do_assignment(instructions, state,
|
||||
op[0]->clone(NULL), temp_rhs,
|
||||
op[0]->clone(ctx, NULL), temp_rhs,
|
||||
this->subexpressions[0]->get_location());
|
||||
type = result->type;
|
||||
error_emitted = op[0]->type->is_error();
|
||||
@@ -1139,10 +1139,10 @@ ast_expression::hir(exec_list *instructions,
|
||||
/* Get a temporary of a copy of the lvalue before it's modified.
|
||||
* This may get thrown away later.
|
||||
*/
|
||||
result = get_lvalue_copy(instructions, op[0]->clone(NULL));
|
||||
result = get_lvalue_copy(instructions, op[0]->clone(ctx, NULL));
|
||||
|
||||
(void)do_assignment(instructions, state,
|
||||
op[0]->clone(NULL), temp_rhs,
|
||||
op[0]->clone(ctx, NULL), temp_rhs,
|
||||
this->subexpressions[0]->get_location());
|
||||
|
||||
type = result->type;
|
||||
|
Reference in New Issue
Block a user