X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Foptimize.h;h=4c57eaea94844192b29d3a12c9862d754af6dc2c;hp=e7592c00a29956e7ad4ab09384cf9798b3d1aacf;hb=d9d7ab44d5f88c4537906e77c49db06d6bdc099c;hpb=6c5380021ff5c42f750e75c0880882b77476b8c4 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. */