X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=b3ffba14f055c2978ede87331754920ebf87cfed;hb=37e2139a0c5721ea7e0104b5afc4cd97ad2dcb6c;hp=506fba1c417c62657ee98292febc5102a5a752cd;hpb=38712d8ecc57d043a2419ffbaeeb57f7a6586f14;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 506fba1c..b3ffba14 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -195,6 +195,14 @@ const map &Compiler::get_uniform_block_bindings() const return module->shared.uniform_block_bindings; } +unsigned Compiler::get_n_clip_distances() const +{ + if(!compiled) + throw invalid_operation("Compiler::get_n_clip_distances"); + auto i = find_member(module->stages, Stage::VERTEX, &Stage::type); + return (i!=module->stages.end() ? i->n_clip_distances : 0); +} + const SourceMap &Compiler::get_source_map() const { return module->source_map; @@ -363,6 +371,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); @@ -383,7 +396,7 @@ void Compiler::finalize(Stage &stage, Mode mode) { if(mode==PROGRAM) { - LegacyConverter().apply(stage, features); + FeatureConverter().apply(stage, features); resolve(stage, RESOLVE_VARIABLES|RESOLVE_FUNCTIONS); PrecisionConverter().apply(stage); }