X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=tools%2Fglslcompiler.cpp;h=b7b8097e88768a3d77ca12723fe83ef3e1fd069d;hb=22d5405729048ee2677a1e45e309e6328de64a26;hp=0ce5f01d722ac424c064d7a7f64d862f72b16390;hpb=6288c42adde9ee7d39a47de51fa2856cf965dccc;p=libs%2Fgl.git diff --git a/tools/glslcompiler.cpp b/tools/glslcompiler.cpp index 0ce5f01d..b7b8097e 100644 --- a/tools/glslcompiler.cpp +++ b/tools/glslcompiler.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -73,7 +74,21 @@ int GlslCompiler::main() compiler.load_source(file, source_fn); compiler.specialize(spec_values); if(!parse_only) - compiler.compile(GL::SL::Compiler::PROGRAM); + { + try + { + compiler.compile(GL::SL::Compiler::PROGRAM); + } + catch(const GL::SL::invalid_shader_source &exc) + { + if(!dump_ast) + throw; + + IO::print("Compilation resulted in errors:\n%s\n", exc.what()); + combined = false; + stage = GL::SL::Stage::SHARED; + } + } if(dump_ast) {