]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/optimize.h
Fix an incorrect loop in UnusedVariableRemover
[libs/gl.git] / source / glsl / optimize.h
index ea61b671d2e1ea2a68b10c4b4682e8cb6a560260..6d8a6194e7e9f5d2076fa81938a75aff421e39c2 100644 (file)
@@ -175,13 +175,16 @@ public:
        bool apply(Stage &s) { s.content.visit(*this); return r_any_folded; }
 
 private:
-       static BasicTypeDeclaration::Kind get_value_kind(const Variant &);
        template<typename T>
        static T evaluate_logical(char, T, T);
        template<typename T>
        static bool evaluate_relation(const char *, T, T);
        template<typename T>
        static T evaluate_arithmetic(char, T, T);
+       template<typename T>
+       static T evaluate_int_special_op(char, T, T);
+       template<typename T>
+       void convert_to_result(const Variant &);
        void set_result(const Variant &, bool = false);
 
        virtual void visit(RefPtr<Expression> &);
@@ -276,6 +279,7 @@ private:
                Node *node;
                Assignment::Target target;
                std::vector<Node *> used_by;
+               unsigned in_loop;
 
                AssignmentInfo(): node(0) { }
        };
@@ -302,6 +306,8 @@ private:
        bool r_side_effects;
        bool in_struct;
        bool composite_reference;
+       unsigned in_loop;
+       std::vector<Node *> loop_ext_refs;
        Assignment::Target r_reference;
        std::set<Node *> unused_nodes;