diff options
Diffstat (limited to 'glsl_parser_extras.cpp')
-rw-r--r-- | glsl_parser_extras.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/glsl_parser_extras.cpp b/glsl_parser_extras.cpp index a4a67c88bc..38dee95c35 100644 --- a/glsl_parser_extras.cpp +++ b/glsl_parser_extras.cpp @@ -754,11 +754,16 @@ main(int argc, char **argv) /* Optimization passes */ if (!state.error) { - do_function_inlining(&instructions); + bool progress; + do { + progress = false; - /* Constant folding */ - ir_constant_folding_visitor constant_folding; - visit_exec_list(&instructions, &constant_folding); + progress = do_function_inlining(&instructions) || progress; + + /* Constant folding */ + ir_constant_folding_visitor constant_folding; + visit_exec_list(&instructions, &constant_folding); + } while (progress); } /* Print out the resulting IR */ |