glsl2: Don't validate IR if there were compilation errors
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 20 Jul 2010 18:37:45 +0000 (11:37 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 20 Jul 2010 18:38:54 +0000 (11:38 -0700)
src/glsl/main.cpp

index e27d9c1d85515501985cb15ac064239ef73c37b7..3ae0eebab3c39d79058216a6cbecea3e07188941 100644 (file)
@@ -172,10 +172,9 @@ compile_shader(struct gl_shader *shader)
    if (!state->error && !state->translation_unit.is_empty())
       _mesa_ast_to_hir(shader->ir, state);
 
-   validate_ir_tree(shader->ir);
-
    /* Print out the unoptimized IR. */
    if (!state->error && dump_hir) {
+      validate_ir_tree(shader->ir);
       _mesa_print_ir(shader->ir, state);
    }
 
@@ -196,9 +195,10 @@ compile_shader(struct gl_shader *shader)
         progress = do_vec_index_to_cond_assign(shader->ir) || progress;
         progress = do_swizzle_swizzle(shader->ir) || progress;
       } while (progress);
+
+      validate_ir_tree(shader->ir);
    }
 
-   validate_ir_tree(shader->ir);
 
    /* Print out the resulting IR */
    if (!state->error && dump_lir) {