]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/optimize.h
Refactor variable renaming in InlineContentInjector once again
[libs/gl.git] / source / glsl / optimize.h
index bffc5a036197cc7f3a46e829018a38d98dac7495..f6604743810ff1e275198ee554badcd53a75ffa2 100644 (file)
@@ -39,11 +39,18 @@ dependencies of the inlined statements to appear before the target function. */
 class InlineContentInjector: private TraversingVisitor
 {
 private:
+       enum Pass
+       {
+               DEPENDS,
+               REFERENCED,
+               INLINE,
+               RENAME
+       };
+
        FunctionDeclaration *source_func;
-       Block *target_block;
-       std::map<std::string, VariableDeclaration *> variable_map;
+       Block staging_block;
        std::string remap_prefix;
-       unsigned remap_names;
+       Pass pass;
        RefPtr<Statement> r_inlined_statement;
        std::set<Node *> dependencies;
        std::set<std::string> referenced_names;