X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=tools%2Fglslcompiler.cpp;fp=tools%2Fglslcompiler.cpp;h=b7b8097e88768a3d77ca12723fe83ef3e1fd069d;hp=0ce5f01d722ac424c064d7a7f64d862f72b16390;hb=66af404fba419b0e8d167de46fc10a037c991a99;hpb=9bec9da4ec633a541cf6048beed99629fefae2b9 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) {