]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.h
Improve support for interface blocks
[libs/gl.git] / source / glsl / syntax.h
index 4ff05fa1a09f9275760dcbfe617610dc6d21a2e3..f7e778b89ef65d417afd1f44751930311c5e94ed 100644 (file)
@@ -110,7 +110,7 @@ struct Block: Node
        bool use_braces;
        std::map<std::string, StructDeclaration *> types;
        std::map<std::string, VariableDeclaration *> variables;
-       std::set<InterfaceBlock *> interfaces;
+       std::map<std::string, InterfaceBlock *> interfaces;
        Block *parent;
 
        Block();
@@ -153,6 +153,18 @@ struct VariableReference: Expression
        virtual void visit(NodeVisitor &);
 };
 
+struct InterfaceBlockReference: Expression
+{
+       std::string name;
+       InterfaceBlock *declaration;
+
+       InterfaceBlockReference();
+       InterfaceBlockReference(const InterfaceBlockReference &);
+
+       virtual InterfaceBlockReference *clone() const { return new InterfaceBlockReference(*this); }
+       virtual void visit(NodeVisitor &);
+};
+
 struct MemberAccess: Expression
 {
        NodePtr<Expression> left;
@@ -305,8 +317,10 @@ struct InterfaceBlock: Statement
        Block members;
        std::string instance_name;
        bool array;
+       InterfaceBlock *linked_block;
 
        InterfaceBlock();
+       InterfaceBlock(const InterfaceBlock &);
 
        virtual InterfaceBlock *clone() const { return new InterfaceBlock(*this); }
        virtual void visit(NodeVisitor &);