X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=97c234f79285f3c253e94d76dd36b937d13e55b4;hb=08d3b5a55fad7439b47fc93d8ba604cbeb7e19ca;hp=4c8c1d03d893d277395b2f64b5def34aa7e55168;hpb=acd7bb6e23e2aff9934ecf32852c62ba72c13574;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 4c8c1d03..97c234f7 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -107,6 +107,19 @@ void Compiler::compile(Mode mode) ++i; } + Stage *prev_stage = 0; + for(auto i=module->stages.begin(); i!=module->stages.end(); ) + { + if(i->functions.empty()) + i = module->stages.erase(i); + else + { + i->previous = prev_stage; + prev_stage = &*i; + ++i; + } + } + for(Stage &s: module->stages) { StructuralFeatureConverter().apply(s, features); @@ -305,6 +318,7 @@ void Compiler::generate(Stage &stage) InterfaceGenerator().apply(stage); resolve(stage, RESOLVE_BLOCKS|RESOLVE_TYPES|RESOLVE_VARIABLES); + LayoutDefaulter().apply(stage); ArraySizer().apply(stage); resolve(stage, RESOLVE_EXPRESSIONS); }