]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/optimize.h
Process loop initialization outside the body in UnusedVariableRemover
[libs/gl.git] / source / glsl / optimize.h
index aebe080c585206b14d533a4c09ef3c926878392d..9b7b7affecf58035f19c2457cbd08c8c4adddf3d 100644 (file)
@@ -195,6 +195,7 @@ private:
        virtual void visit(StructDeclaration &) { }
        virtual void visit(VariableDeclaration &);
        virtual void visit(InterfaceBlock &) { }
+       virtual void visit(FunctionDeclaration &);
 };
 
 /** Replaces expressions consisting entirely of literals with the results of
@@ -275,6 +276,7 @@ private:
        virtual void visit(Iteration &);
 };
 
+/** Removes code which is never executed due to flow control statements. */
 class UnreachableCodeRemover: private TraversingVisitor
 {
 private:
@@ -327,7 +329,6 @@ private:
 
        struct VariableInfo
        {
-               InterfaceBlock *interface_block = 0;
                std::vector<AssignmentInfo *> assignments;
                bool initialized = false;
                bool output = false;
@@ -339,7 +340,6 @@ private:
        Stage *stage = 0;
        BlockVariableMap variables;
        std::list<AssignmentInfo> assignments;
-       InterfaceBlock *interface_block = 0;
        Assignment *r_assignment = 0;
        bool assignment_target = false;
        bool r_side_effects = false;