]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/optimize.h
Remove unused type declarations from GLSL during optimization
[libs/gl.git] / source / glsl / optimize.h
index c932767e99807325f159372e626895aafa213c5b..85f11780baf45a8b77401aecccee255215a0bb2f 100644 (file)
@@ -165,6 +165,22 @@ private:
        virtual void visit(Iteration &);
 };
 
+/** Removes types which are not used anywhere. */
+class UnusedTypeRemover: private TraversingVisitor
+{
+private:
+       std::set<Node *> unused_nodes;
+
+public:
+       bool apply(Stage &);
+
+private:
+       virtual void visit(BasicTypeDeclaration &);
+       virtual void visit(ImageTypeDeclaration &);
+       virtual void visit(StructDeclaration &);
+       virtual void visit(VariableDeclaration &);
+};
+
 /** Removes variable declarations with no references to them.  Assignment
 statements where the result is not used are also removed. */
 class UnusedVariableRemover: private TraversingVisitor