]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compiler.cpp
Assign a result type to all expressions
[libs/gl.git] / source / glsl / compiler.cpp
index 9083ece3fb019681a33974a4ed46c41b15bfb296..66a487fbccd4b7a63f2575295ecc03fcbfcddf5a 100644 (file)
@@ -250,6 +250,7 @@ void Compiler::generate(Stage &stage, Mode mode)
        InterfaceGenerator().apply(stage);
        TypeResolver().apply(stage);
        VariableResolver().apply(stage);
+       ExpressionResolver().apply(stage);
 
        FunctionResolver().apply(stage);
        ConstantSpecializer().apply(stage, (mode==PROGRAM && specialized ? &spec_values : 0));
@@ -262,6 +263,7 @@ bool Compiler::validate(Stage &stage)
        TypeValidator().apply(stage);
        DeclarationValidator().apply(stage);
        ReferenceValidator().apply(stage);
+       ExpressionValidator().apply(stage);
 
        for(vector<Diagnostic>::const_iterator i=stage.diagnostics.begin(); i!=stage.diagnostics.end(); ++i)
                if(i->severity==Diagnostic::ERR)
@@ -281,6 +283,7 @@ Compiler::OptimizeResult Compiler::optimize(Stage &stage)
                TypeResolver().apply(stage);
                VariableResolver().apply(stage);
                FunctionResolver().apply(stage);
+               ExpressionResolver().apply(stage);
        }
 
        /* Removing variables or functions may cause things from the previous stage