X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=0e26a16353b46bf1ae73876fc08be92b20621b2d;hb=5871764de7aa23d2c40cac03ad9d07088fb57e06;hp=e676fcc87233764cc529fe98203bc5d8b666df0f;hpb=25629675e83449d986ef8896e830db562a8ae64e;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index e676fcc8..0e26a163 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -75,6 +75,7 @@ void Compiler::compile(Mode mode) for(Stage &s: module->stages) generate(s); ConstantIdAssigner().apply(*module, features); + LocationAllocator().apply(*module, features, false); for(Stage &s: module->stages) validate(s); @@ -157,7 +158,7 @@ vector Compiler::get_combined_spirv() const if(!compiled) throw invalid_operation("Compiler::get_combined_spirv"); SpirVGenerator gen; - gen.apply(*module); + gen.apply(*module, features); return gen.get_code(); } @@ -363,7 +364,8 @@ Compiler::OptimizeResult Compiler::optimize(Stage &stage) { if(ConstantFolder().apply(stage)) resolve(stage, RESOLVE_EXPRESSIONS); - ConstantConditionEliminator().apply(stage); + if(ConstantConditionEliminator().apply(stage)) + resolve(stage, RESOLVE_VARIABLES); bool any_inlined = false; if(FunctionInliner().apply(stage))