From e591c4625cae63660c5000fbab366e40fe154ab0 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Sun, 5 Sep 2010 22:29:58 +0200 Subject: glsl: add several EmitNo* options, and MaxUnrollIterations This increases the chance that GLSL programs will actually work. Note that continues and returns are not yet lowered, so linking will just fail if not supported. Signed-off-by: Ian Romanick --- src/mesa/program/ir_to_mesa.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/program') diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index b3641032fb..caa906abfa 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2719,7 +2719,7 @@ _mesa_ir_link_shader(GLcontext *ctx, struct gl_shader_program *prog) do_div_to_mul_rcp(ir); do_explog_to_explog2(ir); - progress = do_common_optimization(ir, true) || progress; + progress = do_common_optimization(ir, true, options->MaxUnrollIterations) || progress; if (options->EmitNoIfs) progress = do_if_to_cond_assign(ir) || progress; @@ -2799,7 +2799,7 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader) /* Do some optimization at compile time to reduce shader IR size * and reduce later work if the same shader is linked multiple times */ - while (do_common_optimization(shader->ir, false)) + while (do_common_optimization(shader->ir, false, 32)) ; validate_ir_tree(shader->ir); -- cgit v1.2.3