From 37e2139a0c5721ea7e0104b5afc4cd97ad2dcb6c Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 8 Nov 2021 19:21:41 +0200 Subject: [PATCH] Rename LegacyConverter to FeatureConverter --- source/glsl/compiler.cpp | 2 +- source/glsl/finalize.cpp | 48 ++++++++++++++++++++-------------------- source/glsl/finalize.h | 2 +- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index e658a79e..b3ffba14 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -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); } diff --git a/source/glsl/finalize.cpp b/source/glsl/finalize.cpp index 2fff7549..27760afe 100644 --- a/source/glsl/finalize.cpp +++ b/source/glsl/finalize.cpp @@ -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 &expr) +void FeatureConverter::visit(RefPtr &expr) { r_replaced_reference = 0; expr->visit(*this); @@ -355,7 +355,7 @@ void LegacyConverter::visit(RefPtr &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_versionsource==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) diff --git a/source/glsl/finalize.h b/source/glsl/finalize.h index 4f6ee419..6fa0b094 100644 --- a/source/glsl/finalize.h +++ b/source/glsl/finalize.h @@ -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; -- 2.43.0