summaryrefslogtreecommitdiff
path: root/glsl_parser_extras.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-04-14 17:03:03 -0700
committerEric Anholt <eric@anholt.net>2010-04-14 17:05:13 -0700
commit5ba94206083fcd678febd6cac0231f35c0f1b77a (patch)
tree79311ea6e69d971c8a8c34a7624da4a9f203b2c1 /glsl_parser_extras.cpp
parent60be7626b829af7e1d07330b9a88468924ba350e (diff)
Add an ir_if simplification pass.
This is relatively simple at the moment, recognizing only constant values, and not (for example) values that are restricted to a range that make the branching constant. However, it does remove 59 lines from the printout of CorrectParse2.vert.
Diffstat (limited to 'glsl_parser_extras.cpp')
-rw-r--r--glsl_parser_extras.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/glsl_parser_extras.cpp b/glsl_parser_extras.cpp
index 38dee95c35..455bf0c7a4 100644
--- a/glsl_parser_extras.cpp
+++ b/glsl_parser_extras.cpp
@@ -36,6 +36,7 @@
#include "glsl_parser.h"
#include "ir_constant_folding.h"
#include "ir_function_inlining.h"
+#include "ir_if_simplification.h"
#include "ir_print_visitor.h"
const char *
@@ -759,6 +760,7 @@ main(int argc, char **argv)
progress = false;
progress = do_function_inlining(&instructions) || progress;
+ progress = do_if_simplification(&instructions) || progress;
/* Constant folding */
ir_constant_folding_visitor constant_folding;