]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/generate.h
Resolve and validate the parameters of constructors in GLSL
[libs/gl.git] / source / glsl / generate.h
index 402f07f480b239e39f76dd7334656337955b2ff3..58bc4ca202e6bdbf60f5d625c1f5b5ba2004ef14 100644 (file)
@@ -82,6 +82,7 @@ private:
        bool record_target;
        bool r_self_referencing;
        Assignment::Target r_assignment_target;
+       std::vector<VariableDeclaration *> redeclared_builtins;
        std::set<Node *> nodes_to_remove;
 
 public:
@@ -117,8 +118,15 @@ private:
                SAME_TYPE
        };
 
+       struct ArgumentInfo
+       {
+               BasicTypeDeclaration *type;
+               unsigned component_count;
+       };
+
        Stage *stage;
        std::vector<BasicTypeDeclaration *> basic_types;
+       NodeList<Statement>::iterator insert_point;
        bool r_any_resolved;
 
 public:
@@ -136,10 +144,11 @@ private:
        BasicTypeDeclaration *find_type(BasicTypeDeclaration &, BasicTypeDeclaration::Kind, unsigned);
        void convert_to(RefPtr<Expression> &, BasicTypeDeclaration &);
        bool convert_to_element(RefPtr<Expression> &, BasicTypeDeclaration &);
+       bool truncate_vector(RefPtr<Expression> &, unsigned);
        void resolve(Expression &, TypeDeclaration *, bool);
 
+       virtual void visit(Block &);
        virtual void visit(Literal &);
-       virtual void visit(ParenthesizedExpression &);
        virtual void visit(VariableReference &);
        virtual void visit(InterfaceBlockReference &);
        virtual void visit(MemberAccess &);
@@ -149,6 +158,7 @@ private:
        virtual void visit(BinaryExpression &);
        virtual void visit(Assignment &);
        virtual void visit(TernaryExpression &);
+       void visit_constructor(FunctionCall &);
        virtual void visit(FunctionCall &);
        virtual void visit(BasicTypeDeclaration &);
        virtual void visit(VariableDeclaration &);