]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/finalize.h
Validate location overlap and type matching for GLSL interfaces
[libs/gl.git] / source / glsl / finalize.h
index 212007131e80a3d0e37173364005d68f3b8d1166..e0904b2e40eab2272accfd1cf4c8e6d4972ac4fd 100644 (file)
@@ -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<std::string> have_default;
        NodeList<Statement>::iterator insert_point;
+       std::set<Node *> 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<Node *> 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<Statement>::iterator uniform_insert_point;
        std::set<Node *> nodes_to_remove;