X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=inline;f=source%2Fglsl%2Foptimize.h;h=85f11780baf45a8b77401aecccee255215a0bb2f;hb=5f6ee612cb83029de9559bae644c9a3b4e579259;hp=c932767e99807325f159372e626895aafa213c5b;hpb=1cd0ea7f79b2b0dedd8a2a6622e5d2e8b2ea2512;p=libs%2Fgl.git diff --git a/source/glsl/optimize.h b/source/glsl/optimize.h index c932767e..85f11780 100644 --- a/source/glsl/optimize.h +++ b/source/glsl/optimize.h @@ -165,6 +165,22 @@ private: virtual void visit(Iteration &); }; +/** Removes types which are not used anywhere. */ +class UnusedTypeRemover: private TraversingVisitor +{ +private: + std::set 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