]> git.tdb.fi Git - libs/gl.git/commitdiff
Rename LegacyConverter to FeatureConverter
authorMikko Rasa <tdb@tdb.fi>
Mon, 8 Nov 2021 17:21:41 +0000 (19:21 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 8 Nov 2021 17:21:41 +0000 (19:21 +0200)
source/glsl/compiler.cpp
source/glsl/finalize.cpp
source/glsl/finalize.h

index e658a79ea98c2adc7c469b092f43ca84da9db161..b3ffba14f055c2978ede87331754920ebf87cfed 100644 (file)
@@ -396,7 +396,7 @@ void Compiler::finalize(Stage &stage, Mode mode)
 {
        if(mode==PROGRAM)
        {
-               LegacyConverter().apply(stage, features);
+               FeatureConverter().apply(stage, features);
                resolve(stage, RESOLVE_VARIABLES|RESOLVE_FUNCTIONS);
                PrecisionConverter().apply(stage);
        }
index 2fff7549cab5b3c150feb3f7c223d314da324999..27760afeabb4770d9d79028c52019ace496e9d82 100644 (file)
@@ -310,7 +310,7 @@ void PrecisionConverter::visit(VariableDeclaration &var)
 }
 
 
-void LegacyConverter::apply(Stage &s, const Features &feat)
+void FeatureConverter::apply(Stage &s, const Features &feat)
 {
        stage = &s;
        features = feat;
@@ -326,7 +326,7 @@ void LegacyConverter::apply(Stage &s, const Features &feat)
                unsupported(format("Stage %s is not supported", Stage::get_stage_name(s.type)));
 }
 
-void LegacyConverter::unsupported(const string &reason)
+void FeatureConverter::unsupported(const string &reason)
 {
        Diagnostic diagnostic;
        diagnostic.severity = Diagnostic::ERR;
@@ -336,7 +336,7 @@ void LegacyConverter::unsupported(const string &reason)
        stage->diagnostics.push_back(diagnostic);
 }
 
-void LegacyConverter::visit(Block &block)
+void FeatureConverter::visit(Block &block)
 {
        for(auto i=block.body.begin(); i!=block.body.end(); ++i)
        {
@@ -346,7 +346,7 @@ void LegacyConverter::visit(Block &block)
        }
 }
 
-void LegacyConverter::visit(RefPtr<Expression> &expr)
+void FeatureConverter::visit(RefPtr<Expression> &expr)
 {
        r_replaced_reference = 0;
        expr->visit(*this);
@@ -355,7 +355,7 @@ void LegacyConverter::visit(RefPtr<Expression> &expr)
        r_replaced_reference = 0;
 }
 
-bool LegacyConverter::check_version(const Version &feature_version) const
+bool FeatureConverter::check_version(const Version &feature_version) const
 {
        if(features.glsl_version<feature_version)
                return false;
@@ -365,7 +365,7 @@ bool LegacyConverter::check_version(const Version &feature_version) const
        return true;
 }
 
-bool LegacyConverter::check_extension(bool Features::*extension) const
+bool FeatureConverter::check_extension(bool Features::*extension) const
 {
        if(!(features.*extension))
                return false;
@@ -375,7 +375,7 @@ bool LegacyConverter::check_extension(bool Features::*extension) const
        return true;
 }
 
-bool LegacyConverter::supports_stage(Stage::Type st) const
+bool FeatureConverter::supports_stage(Stage::Type st) const
 {
        if(st==Stage::GEOMETRY)
        {
@@ -388,7 +388,7 @@ bool LegacyConverter::supports_stage(Stage::Type st) const
                return true;
 }
 
-bool LegacyConverter::supports_unified_interface_syntax() const
+bool FeatureConverter::supports_unified_interface_syntax() const
 {
        if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 0));
@@ -396,7 +396,7 @@ bool LegacyConverter::supports_unified_interface_syntax() const
                return check_version(Version(1, 30));
 }
 
-void LegacyConverter::visit(VariableReference &var)
+void FeatureConverter::visit(VariableReference &var)
 {
        if(var.declaration==frag_out && !supports_unified_interface_syntax())
        {
@@ -405,12 +405,12 @@ void LegacyConverter::visit(VariableReference &var)
        }
 }
 
-void LegacyConverter::visit(InterfaceBlockReference &iface)
+void FeatureConverter::visit(InterfaceBlockReference &iface)
 {
        r_flattened_interface = nodes_to_remove.count(iface.declaration);
 }
 
-void LegacyConverter::visit(MemberAccess &memacc)
+void FeatureConverter::visit(MemberAccess &memacc)
 {
        r_flattened_interface = false;
        visit(memacc.left);
@@ -422,14 +422,14 @@ void LegacyConverter::visit(MemberAccess &memacc)
        }
 }
 
-void LegacyConverter::visit(Assignment &assign)
+void FeatureConverter::visit(Assignment &assign)
 {
        TraversingVisitor::visit(assign);
        if(assign.target.declaration==frag_out && !supports_unified_interface_syntax())
                assign.target.declaration = 0;
 }
 
-bool LegacyConverter::supports_unified_sampling_functions() const
+bool FeatureConverter::supports_unified_sampling_functions() const
 {
        if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 0));
@@ -437,7 +437,7 @@ bool LegacyConverter::supports_unified_sampling_functions() const
                return check_version(Version(1, 30));
 }
 
-void LegacyConverter::visit(FunctionCall &call)
+void FeatureConverter::visit(FunctionCall &call)
 {
        if(call.declaration && call.declaration->source==BUILTIN_SOURCE)
        {
@@ -474,7 +474,7 @@ void LegacyConverter::visit(FunctionCall &call)
        TraversingVisitor::visit(call);
 }
 
-bool LegacyConverter::supports_interface_layouts() const
+bool FeatureConverter::supports_interface_layouts() const
 {
        if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 0));
@@ -486,7 +486,7 @@ bool LegacyConverter::supports_interface_layouts() const
                return false;
 }
 
-bool LegacyConverter::supports_stage_interface_layouts() const
+bool FeatureConverter::supports_stage_interface_layouts() const
 {
        if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 10));
@@ -496,7 +496,7 @@ bool LegacyConverter::supports_stage_interface_layouts() const
                return check_extension(&Features::arb_separate_shader_objects);
 }
 
-bool LegacyConverter::supports_centroid_sampling() const
+bool FeatureConverter::supports_centroid_sampling() const
 {
        if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 0));
@@ -506,7 +506,7 @@ bool LegacyConverter::supports_centroid_sampling() const
                return check_extension(&Features::ext_gpu_shader4);
 }
 
-bool LegacyConverter::supports_sample_sampling() const
+bool FeatureConverter::supports_sample_sampling() const
 {
        if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 20));
@@ -516,7 +516,7 @@ bool LegacyConverter::supports_sample_sampling() const
                return check_extension(&Features::arb_gpu_shader5);
 }
 
-bool LegacyConverter::supports_uniform_location() const
+bool FeatureConverter::supports_uniform_location() const
 {
        if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 10));
@@ -526,7 +526,7 @@ bool LegacyConverter::supports_uniform_location() const
                return check_extension(&Features::arb_explicit_uniform_location);
 }
 
-bool LegacyConverter::supports_binding() const
+bool FeatureConverter::supports_binding() const
 {
        if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 10));
@@ -534,7 +534,7 @@ bool LegacyConverter::supports_binding() const
                return check_version(Version(4, 20));
 }
 
-void LegacyConverter::visit(VariableDeclaration &var)
+void FeatureConverter::visit(VariableDeclaration &var)
 {
        if(var.layout)
        {
@@ -617,7 +617,7 @@ void LegacyConverter::visit(VariableDeclaration &var)
        TraversingVisitor::visit(var);
 }
 
-bool LegacyConverter::supports_interface_blocks(const string &iface) const
+bool FeatureConverter::supports_interface_blocks(const string &iface) const
 {
        if(features.target_api==OPENGL_ES)
        {
@@ -634,7 +634,7 @@ bool LegacyConverter::supports_interface_blocks(const string &iface) const
                return false;
 }
 
-bool LegacyConverter::supports_interface_block_location() const
+bool FeatureConverter::supports_interface_block_location() const
 {
        if(features.target_api==OPENGL_ES)
                return check_version(Version(3, 20));
@@ -644,7 +644,7 @@ bool LegacyConverter::supports_interface_block_location() const
                return check_extension(&Features::arb_enhanced_layouts);
 }
 
-void LegacyConverter::visit(InterfaceBlock &iface)
+void FeatureConverter::visit(InterfaceBlock &iface)
 {
        bool push_constant = false;
        if(iface.layout)
index 4f6ee4193bd869ba61ace5191cc1cd9382b14b4e..6fa0b094b584953bff323097b8162b393eb9c01c 100644 (file)
@@ -78,7 +78,7 @@ private:
 
 /** Converts structures of the syntax tree to match a particular set of
 features. */
-class LegacyConverter: private TraversingVisitor
+class FeatureConverter: private TraversingVisitor
 {
 private:
        Stage *stage = 0;