diff options
Diffstat (limited to 'src/glsl/opt_constant_variable.cpp')
-rw-r--r-- | src/glsl/opt_constant_variable.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/glsl/opt_constant_variable.cpp b/src/glsl/opt_constant_variable.cpp index 3fa7c3badc8..18c28018234 100644 --- a/src/glsl/opt_constant_variable.cpp +++ b/src/glsl/opt_constant_variable.cpp @@ -127,6 +127,7 @@ ir_constant_variable_visitor::visit_enter(ir_assignment *ir) ir_visitor_status ir_constant_variable_visitor::visit_enter(ir_call *ir) { + /* Mark any out parameters as assigned to */ exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator(); foreach_iter(exec_list_iterator, iter, *ir) { ir_rvalue *param_rval = (ir_rvalue *)iter.get(); @@ -143,6 +144,17 @@ ir_constant_variable_visitor::visit_enter(ir_call *ir) } sig_iter.next(); } + + /* Mark the return storage as having been assigned to */ + if (ir->return_deref != NULL) { + ir_variable *var = ir->return_deref->variable_referenced(); + struct assignment_entry *entry; + + assert(var); + entry = get_assignment_entry(var, &this->list); + entry->assignment_count++; + } + return visit_continue; } |