X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Ffinalize.h;h=e0904b2e40eab2272accfd1cf4c8e6d4972ac4fd;hb=20a86c5905e1f7527d3c9edc3f56f6b7679c268a;hp=212007131e80a3d0e37173364005d68f3b8d1166;hpb=c8de66203565f07f10898a74dbd55072432790fc;p=libs%2Fgl.git diff --git a/source/glsl/finalize.h b/source/glsl/finalize.h index 21200713..e0904b2e 100644 --- a/source/glsl/finalize.h +++ b/source/glsl/finalize.h @@ -8,17 +8,18 @@ namespace Msp { namespace GL { namespace SL { -/** Generates default precision declarations if they are missing, to satisfy -GLSL ES requirements. */ -class DefaultPrecisionGenerator: private TraversingVisitor +/** Generates default precision declarations or removes precision declarations +according to the requirements of the target API. */ +class PrecisionConverter: private TraversingVisitor { private: Stage *stage; std::set have_default; NodeList::iterator insert_point; + std::set nodes_to_remove; public: - DefaultPrecisionGenerator(); + PrecisionConverter(); void apply(Stage &); @@ -28,21 +29,6 @@ private: virtual void visit(VariableDeclaration &); }; -/** Removes precision qualifiers from variable declarations, as well as -default precision declarations. */ -class PrecisionRemover: private TraversingVisitor -{ -private: - std::set nodes_to_remove; - -public: - void apply(Stage &); - -private: - virtual void visit(Precision &); - virtual void visit(VariableDeclaration &); -}; - /** Converts structures of the syntax tree to match a particular set of features. */ class LegacyConverter: private TraversingVisitor @@ -50,7 +36,6 @@ class LegacyConverter: private TraversingVisitor private: Stage *stage; Features features; - std::string r_type; VariableDeclaration *frag_out; NodeList::iterator uniform_insert_point; std::set nodes_to_remove;