]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compatibility.h
Always remove location qualifier if not supported
[libs/gl.git] / source / glsl / compatibility.h
index f91f188274c99c3d6cb06e05898fb7ae10655b33..212007131e80a3d0e37173364005d68f3b8d1166 100644 (file)
@@ -8,6 +8,8 @@ namespace Msp {
 namespace GL {
 namespace SL {
 
+/** Generates default precision declarations if they are missing, to satisfy
+GLSL ES requirements. */
 class DefaultPrecisionGenerator: private TraversingVisitor
 {
 private:
@@ -24,9 +26,10 @@ private:
        virtual void visit(Block &);
        virtual void visit(Precision &);
        virtual void visit(VariableDeclaration &);
-       using TraversingVisitor::visit;
 };
 
+/** Removes precision qualifiers from variable declarations, as well as
+default precision declarations. */
 class PrecisionRemover: private TraversingVisitor
 {
 private:
@@ -38,15 +41,16 @@ public:
 private:
        virtual void visit(Precision &);
        virtual void visit(VariableDeclaration &);
-       using TraversingVisitor::visit;
 };
 
+/** Converts structures of the syntax tree to match a particular set of
+features. */
 class LegacyConverter: private TraversingVisitor
 {
 private:
        Stage *stage;
        Features features;
-       std::string type;
+       std::string r_type;
        VariableDeclaration *frag_out;
        NodeList<Statement>::iterator uniform_insert_point;
        std::set<Node *> nodes_to_remove;
@@ -57,6 +61,8 @@ public:
        virtual void apply(Stage &, const Features &);
 
 private:
+       void unsupported(const std::string &);
+
        virtual void visit(Block &);
        bool check_version(const Version &) const;
        bool check_extension(bool Features::*) const;
@@ -72,7 +78,6 @@ private:
        virtual void visit(VariableDeclaration &);
        bool supports_interface_blocks(const std::string &) const;
        virtual void visit(InterfaceBlock &);
-       using TraversingVisitor::visit;
 };
 
 } // namespace SL