X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=4b1d4edf11d0e6e29c8410ab123521b440826128;hb=6f06479b765946bdd3174b2c05e7a1dda24c31c2;hp=233e37ea33727814042069dd7df2b068abed7670;hpb=8e553af57b712051f47293c971671f4f6a939be2;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 233e37ea..4b1d4edf 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -25,17 +25,11 @@ namespace GL { namespace SL { Compiler::Compiler(): - features(DeviceInfo::get_global().glsl_features), - module(0), - compiled(false), - specialized(false) + features(DeviceInfo::get_global().glsl_features) { } Compiler::Compiler(const Features &f): - features(f), - module(0), - compiled(false), - specialized(false) + features(f) { } Compiler::~Compiler() @@ -279,7 +273,7 @@ void Compiler::import(ModuleCache &mod_cache, const string &name) void Compiler::generate(Stage &stage) { - stage.required_features.gl_api = features.gl_api; + stage.required_features.target_api = features.target_api; if(module->shared.required_features.glsl_version>stage.required_features.glsl_version) stage.required_features.glsl_version = module->shared.required_features.glsl_version; @@ -369,6 +363,11 @@ Compiler::OptimizeResult Compiler::optimize(Stage &stage) resolve(stage, RESOLVE_TYPES|RESOLVE_VARIABLES|RESOLVE_FUNCTIONS|RESOLVE_EXPRESSIONS); any_inlined = true; } + if(AggregateDismantler().apply(stage)) + { + resolve(stage, RESOLVE_TYPES|RESOLVE_VARIABLES|RESOLVE_FUNCTIONS|RESOLVE_EXPRESSIONS); + any_inlined = true; + } if(ExpressionInliner().apply(stage)) { resolve(stage, RESOLVE_VARIABLES|RESOLVE_FUNCTIONS|RESOLVE_EXPRESSIONS);