]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.h
Transform interface block contents into structs
[libs/gl.git] / source / glsl / syntax.h
index 2c832c149e2467ba346867eb453cc8850b7a11a6..30acca42b957bd42b547b642173032160fcdd0df 100644 (file)
@@ -48,6 +48,7 @@ struct Operator
 
 enum
 {
+       INTERNAL_SOURCE = -2,
        BUILTIN_SOURCE = -1,
        GENERATED_SOURCE = 0
 };
@@ -352,7 +353,11 @@ struct StructDeclaration: TypeDeclaration
 {
        Block members;
 
+       InterfaceBlock *interface_block;
+
        StructDeclaration();
+       StructDeclaration(const StructDeclaration &);
+       ~StructDeclaration();
 
        virtual StructDeclaration *clone() const { return new StructDeclaration(*this); }
        virtual void visit(NodeVisitor &);
@@ -387,10 +392,14 @@ struct InterfaceBlock: Statement
 {
        std::string interface;
        std::string name;
-       Block members;
+       NodePtr<Block> members;
        std::string instance_name;
        bool array;
 
+       /* An interface block's ultimate base type is always a struct.  The
+       immediate type may be either that same struct or an array of it. */
+       TypeDeclaration *type_declaration;
+       StructDeclaration *struct_declaration;
        InterfaceBlock *linked_block;
 
        InterfaceBlock();