#include "ir.h"
#include "ir_hierarchical_visitor.h"
+#include "util/debug.h"
#include "util/hash_table.h"
#include "util/macros.h"
#include "util/set.h"
_mesa_set_add(ir_set, ir);
}
-#ifdef DEBUG
static void
check_node_type(ir_instruction *ir, void *data)
{
if (value != NULL)
assert(value->type != glsl_type::error_type);
}
-#endif
void
validate_ir_tree(exec_list *instructions)
* and it's half composed of assert()s anyway which wouldn't do
* anything.
*/
-#ifdef DEBUG
+#ifndef DEBUG
+ if (!env_var_as_boolean("GLSL_VALIDATE", false))
+ return;
+#endif
ir_validate v;
v.run(instructions);
foreach_in_list(ir_instruction, ir, instructions) {
visit_tree(ir, check_node_type, NULL);
}
-#endif
}