#include <msp/core/application.h>
#include <msp/core/getopt.h>
#include <msp/gl/glsl/compiler.h>
+#include <msp/gl/glsl/glsl_error.h>
#include <msp/io/print.h>
#include <msp/strings/utils.h>
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)
{