X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.h;h=95347e1bbb5831deaf9ffceb58cc1e196df25cde;hp=7a372dc59e2402d5f1872da7aa24415c66c1e783;hb=03b2ea5c9c611cfa5f02afb49ed7e05743e691b4;hpb=4ecc965177df174ed2d26cfedf24665c8879acda diff --git a/source/glsl/syntax.h b/source/glsl/syntax.h index 7a372dc5..95347e1b 100644 --- a/source/glsl/syntax.h +++ b/source/glsl/syntax.h @@ -111,7 +111,6 @@ class NodeArray: public NodeContainer > > struct TypeDeclaration; struct VariableDeclaration; -struct InterfaceBlock; struct FunctionDeclaration; struct Statement: Node @@ -166,19 +165,6 @@ struct VariableReference: Expression virtual void visit(NodeVisitor &); }; -struct InterfaceBlockReference: Expression -{ - std::string name; - - InterfaceBlock *declaration = 0; - - InterfaceBlockReference() = default; - InterfaceBlockReference(const InterfaceBlockReference &); - - virtual InterfaceBlockReference *clone() const { return new InterfaceBlockReference(*this); } - virtual void visit(NodeVisitor &); -}; - struct MemberAccess: Expression { NodePtr left; @@ -391,13 +377,13 @@ struct ImageTypeDeclaration: TypeDeclaration struct StructDeclaration: TypeDeclaration { Block members; + std::string block_name; bool extended_alignment = false; - InterfaceBlock *interface_block = 0; + VariableDeclaration *block_declaration = 0; StructDeclaration(); StructDeclaration(const StructDeclaration &); - ~StructDeclaration(); virtual StructDeclaration *clone() const { return new StructDeclaration(*this); } virtual void visit(NodeVisitor &); @@ -418,6 +404,7 @@ struct VariableDeclaration: Statement NodePtr init_expression; TypeDeclaration *type_declaration = 0; + StructDeclaration *block_declaration = 0; VariableDeclaration *linked_declaration = 0; VariableDeclaration() = default; @@ -428,29 +415,6 @@ struct VariableDeclaration: Statement virtual void visit(NodeVisitor &); }; -struct InterfaceBlock: Statement -{ - NodePtr layout; - std::string interface; - std::string block_name; - NodePtr members; - std::string instance_name; - bool array = false; - - /* 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 = 0; - StructDeclaration *struct_declaration = 0; - InterfaceBlock *linked_block = 0; - - InterfaceBlock() = default; - InterfaceBlock(const InterfaceBlock &); - ~InterfaceBlock(); - - virtual InterfaceBlock *clone() const { return new InterfaceBlock(*this); } - virtual void visit(NodeVisitor &); -}; - struct FunctionDeclaration: Statement { std::string return_type; @@ -530,7 +494,7 @@ struct Stage Stage *previous = 0; Block content; std::map types; - std::map interface_blocks; + std::map interface_blocks; std::map functions; std::map locations; std::map texture_bindings; @@ -554,7 +518,7 @@ struct Module }; std::string get_unused_variable_name(const Block &, const std::string &); -const TypeDeclaration *get_ultimate_base_type(const TypeDeclaration *); +TypeDeclaration *get_ultimate_base_type(TypeDeclaration *); bool has_layout_qualifier(const Layout *, const std::string &); int get_layout_value(const Layout *, const std::string &, int = -1); void add_layout_qualifier(RefPtr &, const Layout::Qualifier &);