ir_variable: Track the location of uniforms, varings, attributes, etc.
[mesa.git] / main.cpp
index 25904380c9560ba9bcc88470e3d92b6949e06998..17f25d741e47b94b5bb757209b11035083dbf1c7 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -128,7 +128,7 @@ compile_shader(struct glsl_shader *shader)
     * should probably be the parser context, but there isn't one yet.
    */
    const char *source = shader->Source;
-   state.error = preprocess(shader, &source);
+   state.error = preprocess(shader, &source, &state.info_log);
 
    if (!state.error) {
       _mesa_glsl_lexer_ctor(& state, source);
@@ -148,6 +148,8 @@ compile_shader(struct glsl_shader *shader)
    if (!state.error && !state.translation_unit.is_empty())
       _mesa_ast_to_hir(&shader->ir, &state);
 
+   validate_ir_tree(&shader->ir);
+
    /* Optimization passes */
    if (!state.error && !shader->ir.is_empty()) {
       bool progress;
@@ -166,6 +168,8 @@ compile_shader(struct glsl_shader *shader)
       } while (progress);
    }
 
+   validate_ir_tree(&shader->ir);
+
    /* Print out the resulting IR */
    if (!state.error && dump_lir) {
       _mesa_print_ir(&shader->ir, &state);