- if(!supports_stage(s.type))
- throw unsupported_shader(format("Stage %s is not supported", Stage::get_stage_name(s.type)));
- visit(s.content);
+ if(supports_stage(s.type))
+ s.content.visit(*this);
+ else
+ unsupported(format("Stage %s is not supported", Stage::get_stage_name(s.type)));
+}
+
+void LegacyConverter::unsupported(const string &reason)
+{
+ Diagnostic diagnostic;
+ diagnostic.severity = Diagnostic::ERR;
+ diagnostic.source = GENERATED_SOURCE;
+ diagnostic.line = 0;
+ diagnostic.message = reason;
+ stage->diagnostics.push_back(diagnostic);