glsl: Support if-flattening beyond a given maximum nesting depth.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 27 Dec 2010 08:22:38 +0000 (00:22 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 27 Dec 2010 08:59:31 +0000 (00:59 -0800)
commit9ac6a9b2fa45debac63f2e2b20d78c4776d06e37
tree54998e214bb93f86ac57899e4367bcdf010d4163
parent23aa3c552cc54a3242142b82916090f8b7b32e44
glsl: Support if-flattening beyond a given maximum nesting depth.

This adds a new optional max_depth parameter (defaulting to 0) to
lower_if_to_cond_assign, and makes the pass only flatten if-statements
nested deeper than that.

By default, all if-statements will be flattened, just like before.

This patch also renames do_if_to_cond_assign to lower_if_to_cond_assign,
to match the new naming conventions.
src/glsl/ir_optimization.h
src/glsl/lower_if_to_cond_assign.cpp
src/mesa/program/ir_to_mesa.cpp