X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fvisitor.h;fp=source%2Fglsl%2Fvisitor.h;h=e0d74f6226927299913e3e9d41892042eb52f6bb;hb=518f751d385b733adbf43fe4056403740709edec;hp=83b310f62ebadbcef621a9b8d1aa65eb571e59c1;hpb=f7b29fcfe408965c9cba79095eb05c49eca4a98e;p=libs%2Fgl.git diff --git a/source/glsl/visitor.h b/source/glsl/visitor.h index 83b310f6..e0d74f62 100644 --- a/source/glsl/visitor.h +++ b/source/glsl/visitor.h @@ -110,6 +110,23 @@ private: virtual void visit(Iteration &); }; +/** Reorders a set of nodes so they appear before another node. Only nodes +on the same hierarchly level as the target node are reordered. */ +class NodeReorderer: private TraversingVisitor +{ +private: + Node *reorder_before; + const std::set *to_reorder; + +public: + NodeReorderer(); + + void apply(Stage &, Node &, const std::set &); + +private: + virtual void visit(Block &); +}; + } // namespace SL } // namespace GL } // namespace Msp