summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-22 18:25:55 -0700
committerEric Anholt <[email protected]>2010-08-22 18:34:45 -0700
commit137b8397fa5cc5d70e86a4b14d6be9326340f584 (patch)
treefe5f2dc78a54358d9f6bb9e10d34ed9529e558ee /src/glsl
parent6b90d1b1acaaf42b9c8b787d0dac54ac74d4fdcc (diff)
glsl: Don't tree-graft in an expression in place of a function outval.
Fixes: glsl-constant-folding-call-1 (bug #29737)
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ir_tree_grafting.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/glsl/ir_tree_grafting.cpp b/src/glsl/ir_tree_grafting.cpp
index 6acc5b86c51..748dcecefc6 100644
--- a/src/glsl/ir_tree_grafting.cpp
+++ b/src/glsl/ir_tree_grafting.cpp
@@ -188,11 +188,16 @@ ir_tree_grafting_visitor::visit_enter(ir_function_signature *ir)
ir_visitor_status
ir_tree_grafting_visitor::visit_enter(ir_call *ir)
{
+ exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
/* Reminder: iterating ir_call iterates its parameters. */
foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_variable *sig_param = (ir_variable *)sig_iter.get();
ir_rvalue *ir = (ir_rvalue *)iter.get();
ir_rvalue *new_ir = ir;
+ if (sig_param->mode != ir_var_in)
+ continue;
+
if (do_graft(&new_ir)) {
ir->replace_with(new_ir);
return visit_stop;