]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compatibility.cpp
Tweaks to visitor classes in the GLSL compiler
[libs/gl.git] / source / glsl / compatibility.cpp
index 398a7bd30a76eaa4b141b400d9cd4e08d0e87958..692db972b56491eca5de797ae0f79bec61995754 100644 (file)
@@ -20,7 +20,7 @@ DefaultPrecisionGenerator::DefaultPrecisionGenerator():
 
 void DefaultPrecisionGenerator::apply(Stage &stage)
 {
-       SetForScope<Stage::Type> set_stage(stage_type, stage.type);
+       stage_type = stage.type;
        visit(stage.content);
 }
 
@@ -85,11 +85,11 @@ LegacyConverter::LegacyConverter():
        frag_out(0)
 { }
 
-LegacyConverter::LegacyConverter(const Version &v):
-       target_api(get_gl_api()),
-       target_version(v),
-       frag_out(0)
-}
+void LegacyConverter::apply(Stage &s)
+{
+       stage = &s;
+       visit(s.content);
+}
 
 bool LegacyConverter::check_version(const Version &feature_version) const
 {
@@ -113,12 +113,6 @@ bool LegacyConverter::check_extension(const Extension &extension) const
        return true;
 }
 
-void LegacyConverter::apply(Stage &s)
-{
-       SetForScope<Stage *> set_stage(stage, &s);
-       visit(s.content);
-}
-
 bool LegacyConverter::supports_unified_interface_syntax() const
 {
        if(target_api==OPENGL_ES2)