X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=00efbd94393c4399d0dbc206551575f5bf93fc22;hb=ac4218f733b4c8f09b64e72164bd4321a4c1abd2;hp=b3ffba14f055c2978ede87331754920ebf87cfed;hpb=37e2139a0c5721ea7e0104b5afc4cd97ad2dcb6c;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index b3ffba14..00efbd94 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -4,7 +4,6 @@ #include "builtin.h" #include "compiler.h" #include "debug.h" -#include "deviceinfo.h" #include "error.h" #include "finalize.h" #include "generate.h" @@ -24,10 +23,6 @@ namespace Msp { namespace GL { namespace SL { -Compiler::Compiler(): - features(DeviceInfo::get_global().glsl_features) -{ } - Compiler::Compiler(const Features &f): features(f) { } @@ -106,6 +101,11 @@ void Compiler::compile(Mode mode) ++i; } + for(Stage &s: module->stages) + { + StructuralFeatureConverter().apply(s, features); + resolve(s, RESOLVE_VARIABLES|RESOLVE_FUNCTIONS); + } LocationAllocator().apply(*module, features); for(Stage &s: module->stages) finalize(s, mode); @@ -394,13 +394,9 @@ Compiler::OptimizeResult Compiler::optimize(Stage &stage) void Compiler::finalize(Stage &stage, Mode mode) { - if(mode==PROGRAM) - { - FeatureConverter().apply(stage, features); - resolve(stage, RESOLVE_VARIABLES|RESOLVE_FUNCTIONS); - PrecisionConverter().apply(stage); - } - else if(mode==SPIRV) + QualifierConverter().apply(stage, features); + PrecisionConverter().apply(stage); + if(mode==SPIRV) StructOrganizer().apply(stage); // Collect bindings from all stages into the shared stage's maps