]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/optimize.h
Make ConstantFolder check the type of the value directly
[libs/gl.git] / source / glsl / optimize.h
index e21dd98fd0fcbe63e578e3012cd072d108c5437d..a714a97a1b45ce49cf78a5c0fd4c69d2a4b6a661 100644 (file)
@@ -175,7 +175,6 @@ 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>
@@ -300,6 +299,7 @@ private:
        Assignment *r_assignment;
        bool assignment_target;
        bool r_side_effects;
+       bool in_struct;
        bool composite_reference;
        Assignment::Target r_reference;
        std::set<Node *> unused_nodes;
@@ -323,8 +323,7 @@ private:
        virtual void visit(FunctionCall &);
        void record_assignment(const Assignment::Target &, Node &);
        virtual void visit(ExpressionStatement &);
-       // Ignore structs because their members can't be accessed directly.
-       virtual void visit(StructDeclaration &) { }
+       virtual void visit(StructDeclaration &);
        virtual void visit(VariableDeclaration &);
        virtual void visit(InterfaceBlock &);
        void merge_variables(const BlockVariableMap &);