X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=b2c4f9ba2cbed88dee8b4e70f00d8a6c4afb5739;hb=cdc2c7176202b4f8d1f3fd21db9c571511b32fa2;hp=e2745e1b9ae41fe6756f7b86204bdd16c86dda10;hpb=55a18f710f07c51f05d0dc55741a7f3cc8e70cdd;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index e2745e1b..b2c4f9ba 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -78,6 +78,9 @@ void Compiler::specialize(const map &sv) void Compiler::compile(Mode mode) { + if(specialized && mode!=PROGRAM) + throw invalid_operation("Compiler::compile"); + for(list::iterator i=module->stages.begin(); i!=module->stages.end(); ++i) generate(*i); ConstantIdAssigner().apply(*module, features); @@ -93,7 +96,7 @@ void Compiler::compile(Mode mode) if(!valid) throw invalid_shader_source(get_diagnostics()); - if(mode==PROGRAM && specialized) + if(specialized) { for(list::iterator i=module->stages.begin(); i!=module->stages.end(); ++i) ConstantSpecializer().apply(*i, spec_values); @@ -323,6 +326,7 @@ void Compiler::validate(Stage &stage) IdentifierValidator().apply(stage); ReferenceValidator().apply(stage); ExpressionValidator().apply(stage); + FlowControlValidator().apply(stage); StageInterfaceValidator().apply(stage); }