X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Foptimize.h;h=4c57eaea94844192b29d3a12c9862d754af6dc2c;hb=9cfccf5c4e366e033cfd5eebf8955d2b13202b46;hp=e7592c00a29956e7ad4ab09384cf9798b3d1aacf;hpb=22d5405729048ee2677a1e45e309e6328de64a26;p=libs%2Fgl.git diff --git a/source/glsl/optimize.h b/source/glsl/optimize.h index e7592c00..4c57eaea 100644 --- a/source/glsl/optimize.h +++ b/source/glsl/optimize.h @@ -9,6 +9,22 @@ namespace Msp { namespace GL { namespace SL { +/** Assigns values to specialization constants, turning them into normal +constants. */ +class ConstantSpecializer: private TraversingVisitor +{ +private: + const std::map *values; + +public: + ConstantSpecializer(); + + void apply(Stage &, const std::map &); + +private: + virtual void visit(VariableDeclaration &); +}; + /** Finds functions which are candidates for inlining. Currently this means functions which have no flow control statements, no more than one return statement, and are only called once. */