]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compiler.cpp
Use emplace_back when a new object is being constructed
[libs/gl.git] / source / glsl / compiler.cpp
index 4e9f94d86b51e0044786927f7bc77c6d8e32c720..0e26a16353b46bf1ae73876fc08be92b20621b2d 100644 (file)
@@ -158,7 +158,7 @@ vector<uint32_t> 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();
 }
 
@@ -364,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))