Mesa (master): ir_reader: Only validate IR when a global 'debug' flag is set.

Kenneth Graunke kwg at kemper.freedesktop.org
Sun Sep 5 08:57:51 UTC 2010


Module: Mesa
Branch: master
Commit: 9a3df46fbcfbad10163686ae4c034a3a55116947
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a3df46fbcfbad10163686ae4c034a3a55116947

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Sun Sep  5 00:58:34 2010 -0700

ir_reader: Only validate IR when a global 'debug' flag is set.

This extra validation is very useful when working on the built-ins, but
in general overkill - the results should stay the same unless the
built-ins or ir_validate have changed.

Also, validating all the built-in functions in every test case makes
piglit run unacceptably slow.

---

 src/glsl/ir_reader.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index 5fe96c8..04b9829 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -32,6 +32,8 @@ extern "C" {
 #include "glsl_types.h"
 #include "s_expression.h"
 
+const static bool debug = false;
+
 static void ir_read_error(_mesa_glsl_parse_state *, s_expression *,
 			  const char *fmt, ...);
 static const glsl_type *read_type(_mesa_glsl_parse_state *, s_expression *);
@@ -85,7 +87,8 @@ _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions,
    read_instructions(state, instructions, expr, NULL);
    talloc_free(expr);
 
-   validate_ir_tree(instructions);
+   if (debug)
+      validate_ir_tree(instructions);
 }
 
 static void




More information about the mesa-commit mailing list