From 9ac6a9b2fa45debac63f2e2b20d78c4776d06e37 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 27 Dec 2010 00:22:38 -0800 Subject: 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/mesa/program/ir_to_mesa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/program') diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 490c4cab7a..c601ef6eaa 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2867,7 +2867,7 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) if (options->EmitNoIfs) { progress = lower_discard(ir) || progress; - progress = do_if_to_cond_assign(ir) || progress; + progress = lower_if_to_cond_assign(ir) || progress; } if (options->EmitNoNoise) -- cgit v1.2.3