]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/finalize.cpp
Use default member initializers for simple types
[libs/gl.git] / source / glsl / finalize.cpp
index eee8a5198efa8b2037848bcc7a34bd8cd0d333ff..4068037e919e81b5cc514d12584bec7df8088360 100644 (file)
@@ -12,10 +12,6 @@ namespace Msp {
 namespace GL {
 namespace SL {
 
-StructOrganizer::StructOrganizer():
-       offset(-1)
-{ }
-
 void StructOrganizer::visit(StructDeclaration &strct)
 {
        SetForScope<int> set_offset(offset, 0);
@@ -238,10 +234,6 @@ void LocationAllocator::visit(InterfaceBlock &iface)
 }
 
 
-PrecisionConverter::PrecisionConverter():
-       stage(0)
-{ }
-
 void PrecisionConverter::apply(Stage &s)
 {
        stage = &s;
@@ -261,7 +253,7 @@ void PrecisionConverter::visit(Block &block)
 
 void PrecisionConverter::visit(Precision &prec)
 {
-       if(stage->required_features.gl_api==OPENGL_ES2)
+       if(stage->required_features.target_api==OPENGL_ES)
                have_default.insert(prec.type);
        else
                nodes_to_remove.insert(&prec);
@@ -269,7 +261,7 @@ void PrecisionConverter::visit(Precision &prec)
 
 void PrecisionConverter::visit(VariableDeclaration &var)
 {
-       if(stage->required_features.gl_api!=OPENGL_ES2)
+       if(stage->required_features.target_api!=OPENGL_ES)
        {
                var.precision.clear();
                return;
@@ -308,10 +300,6 @@ void PrecisionConverter::visit(VariableDeclaration &var)
 }
 
 
-LegacyConverter::LegacyConverter():
-       frag_out(0)
-{ }
-
 void LegacyConverter::apply(Stage &s, const Features &feat)
 {
        stage = &s;
@@ -322,7 +310,7 @@ void LegacyConverter::apply(Stage &s, const Features &feat)
                NodeRemover().apply(s, nodes_to_remove);
 
                if(!stage->required_features.glsl_version)
-                       stage->required_features.glsl_version = Version(1, (stage->required_features.gl_api==OPENGL_ES2 ? 0 : 10));
+                       stage->required_features.glsl_version = Version(1, (stage->required_features.target_api==OPENGL_ES ? 0 : 10));
        }
        else
                unsupported(format("Stage %s is not supported", Stage::get_stage_name(s.type)));
@@ -372,7 +360,7 @@ bool LegacyConverter::supports_stage(Stage::Type st) const
 {
        if(st==Stage::GEOMETRY)
        {
-               if(features.gl_api==OPENGL_ES2)
+               if(features.target_api==OPENGL_ES)
                        return check_version(Version(3, 20));
                else
                        return check_version(Version(1, 50));
@@ -383,7 +371,7 @@ bool LegacyConverter::supports_stage(Stage::Type st) const
 
 bool LegacyConverter::supports_unified_interface_syntax() const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 0));
        else
                return check_version(Version(1, 30));
@@ -407,7 +395,7 @@ void LegacyConverter::visit(Assignment &assign)
 
 bool LegacyConverter::supports_unified_sampling_functions() const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 0));
        else
                return check_version(Version(1, 30));
@@ -452,7 +440,7 @@ void LegacyConverter::visit(FunctionCall &call)
 
 bool LegacyConverter::supports_interface_layouts() const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 0));
        else if(check_version(Version(3, 30)))
                return true;
@@ -464,7 +452,7 @@ bool LegacyConverter::supports_interface_layouts() const
 
 bool LegacyConverter::supports_stage_interface_layouts() const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 10));
        else if(check_version(Version(4, 10)))
                return true;
@@ -474,7 +462,7 @@ bool LegacyConverter::supports_stage_interface_layouts() const
 
 bool LegacyConverter::supports_centroid_sampling() const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 0));
        else if(check_version(Version(1, 20)))
                return true;
@@ -484,7 +472,7 @@ bool LegacyConverter::supports_centroid_sampling() const
 
 bool LegacyConverter::supports_sample_sampling() const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 20));
        else if(check_version(Version(4, 0)))
                return true;
@@ -494,7 +482,7 @@ bool LegacyConverter::supports_sample_sampling() const
 
 bool LegacyConverter::supports_uniform_location() const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 10));
        else if(check_version(Version(4, 30)))
                return true;
@@ -504,7 +492,7 @@ bool LegacyConverter::supports_uniform_location() const
 
 bool LegacyConverter::supports_binding() const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 10));
        else
                return check_version(Version(4, 20));
@@ -591,7 +579,7 @@ void LegacyConverter::visit(VariableDeclaration &var)
 
 bool LegacyConverter::supports_interface_blocks(const string &iface) const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
        {
                if(iface=="uniform")
                        return check_version(Version(3, 0));
@@ -608,7 +596,7 @@ bool LegacyConverter::supports_interface_blocks(const string &iface) const
 
 bool LegacyConverter::supports_interface_block_location() const
 {
-       if(features.gl_api==OPENGL_ES2)
+       if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 20));
        else if(check_version(Version(4, 40)))
                return true;