X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Foptimize.h;h=d434c68a85c1df63594dcda6294c9698573e969f;hb=3773733011653d67e47768cf031e95f8f68cf714;hp=6d4b1bcb5d2c2e5d883d7ab640390481c8c7e84e;hpb=4790c6a06072814b21f5b3f24b53c6936915308d;p=libs%2Fgl.git diff --git a/source/glsl/optimize.h b/source/glsl/optimize.h index 6d4b1bcb..d434c68a 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. */ @@ -41,7 +57,6 @@ class InlineContentInjector: private TraversingVisitor private: enum Pass { - DEPENDS, REFERENCED, INLINE, RENAME @@ -49,7 +64,6 @@ private: FunctionDeclaration *source_func; Block staging_block; - std::string remap_prefix; Pass pass; RefPtr r_inlined_statement; std::set dependencies; @@ -110,7 +124,7 @@ private: bool trivial; bool available; - ExpressionInfo(); + ExpressionInfo(): expression(0), assign_scope(0), inline_point(0), trivial(false), available(true) { } }; std::map expressions;