ir_to_mesa: Do validation on the IR tree.
authorEric Anholt <eric@anholt.net>
Mon, 19 Jul 2010 15:55:54 +0000 (08:55 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 19 Jul 2010 16:50:26 +0000 (09:50 -0700)
src/mesa/shader/ir_to_mesa.cpp

index a7799cc01dbd75628dea06e91e76adbed9de2009..84cfff4010694019babef0dc0bdaa6e902c99809 100644 (file)
@@ -2186,6 +2186,8 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
       _mesa_ast_to_hir(shader->ir, state);
 
    if (!state->error && !shader->ir->is_empty()) {
+      validate_ir_tree(shader->ir);
+
       /* Lowering */
       do_mat_op_to_vec(shader->ir);
       do_mod_to_fract(shader->ir);
@@ -2213,6 +2215,8 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
 
         progress = do_swizzle_swizzle(shader->ir) || progress;
       } while (progress);
+
+      validate_ir_tree(shader->ir);
    }
 
    shader->symbols = state->symbols;