From: Eric Anholt Date: Fri, 11 Mar 2011 21:23:13 +0000 (-0800) Subject: glsl: Skip processing of expression trees in discard simplification. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b13e135942ea7ebe1426a1809bf0efb7891387d;p=mesa.git glsl: Skip processing of expression trees in discard simplification. It only cares about "if", "loop", and "discard". --- diff --git a/src/glsl/opt_discard_simplification.cpp b/src/glsl/opt_discard_simplification.cpp index 0e577c478a9..7c2928d271c 100644 --- a/src/glsl/opt_discard_simplification.cpp +++ b/src/glsl/opt_discard_simplification.cpp @@ -95,6 +95,7 @@ public: ir_visitor_status visit_enter(ir_if *); ir_visitor_status visit_enter(ir_loop *); + ir_visitor_status visit_enter(ir_assignment *); bool progress; }; @@ -117,6 +118,15 @@ is_only_instruction(ir_discard *discard) discard->next->is_tail_sentinel()); } +/* We only care about the top level instructions, so don't descend + * into expressions. + */ +ir_visitor_status +discard_simplifier::visit_enter(ir_assignment *ir) +{ + return visit_continue_with_parent; +} + ir_visitor_status discard_simplifier::visit_enter(ir_if *ir) {