generate(*i);
ConstantIdAssigner().apply(*module, features);
+ for(list<Stage>::iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
+ validate(*i);
+ GlobalInterfaceValidator().apply(*module);
+
bool valid = true;
for(list<Stage>::iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
- if(!validate(*i))
+ if(!check_errors(*i))
valid = false;
if(!valid)
throw invalid_shader_source(get_diagnostics());
else if(result!=REDO_STAGE)
++i;
}
+
+ LocationAllocator().apply(*module);
for(list<Stage>::iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
finalize(*i, mode);
}
}
-bool Compiler::validate(Stage &stage)
+void Compiler::validate(Stage &stage)
{
DeclarationValidator().apply(stage);
IdentifierValidator().apply(stage);
ReferenceValidator().apply(stage);
ExpressionValidator().apply(stage);
+ StageInterfaceValidator().apply(stage);
+}
+bool Compiler::check_errors(Stage &stage)
+{
stable_sort(stage.diagnostics, &diagnostic_line_order);
for(vector<Diagnostic>::const_iterator i=stage.diagnostics.begin(); i!=stage.diagnostics.end(); ++i)