]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/optimize.h
Better way to request features for different GLSL versions
[libs/gl.git] / source / glsl / optimize.h
index 6d4b1bcb5d2c2e5d883d7ab640390481c8c7e84e..4c57eaea94844192b29d3a12c9862d754af6dc2c 100644 (file)
@@ -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<std::string, int> *values;
+
+public:
+       ConstantSpecializer();
+
+       void apply(Stage &, const std::map<std::string, int> &);
+
+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. */
@@ -49,7 +65,6 @@ private:
 
        FunctionDeclaration *source_func;
        Block staging_block;
-       std::string remap_prefix;
        Pass pass;
        RefPtr<Statement> r_inlined_statement;
        std::set<Node *> dependencies;