X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=05bf421cd422428dbf1b09b5eef3d0daf737c3f9;hp=4c8c1d03d893d277395b2f64b5def34aa7e55168;hb=77973a48acbe29c2a64d43de7084574aaf7a26c4;hpb=88c401224220010cb71426fafc5173661c4d48a3 diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 4c8c1d03..05bf421c 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);