X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.h;h=f7e778b89ef65d417afd1f44751930311c5e94ed;hb=64d98b0b4fb3214a3ca67ab1b239c120748e8e35;hp=e9c76ebab9974749858c217475bc2bccf7b31729;hpb=efeb3137935ec5ef6a16531c2e6b915caa3db481;p=libs%2Fgl.git diff --git a/source/glsl/syntax.h b/source/glsl/syntax.h index e9c76eba..f7e778b8 100644 --- a/source/glsl/syntax.h +++ b/source/glsl/syntax.h @@ -3,10 +3,11 @@ #include #include +#include #include #include #include -#include "extension.h" +#include "features.h" #include "sourcemap.h" #pragma push_macro("interface") @@ -90,6 +91,7 @@ class NodeArray: public NodeContainer > > struct StructDeclaration; struct VariableDeclaration; +struct InterfaceBlock; struct FunctionDeclaration; struct Statement: Node @@ -106,9 +108,9 @@ struct Block: Node { NodeList body; bool use_braces; - bool anonymous; std::map types; std::map variables; + std::map interfaces; Block *parent; Block(); @@ -151,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 left; @@ -242,9 +256,9 @@ struct Layout: Node { struct Qualifier { - // TODO the standard calls this name, not identifier - std::string identifier; - std::string value; + std::string name; + bool has_value; + int value; }; std::vector qualifiers; @@ -303,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 &); @@ -383,11 +399,8 @@ struct Stage Type type; Stage *previous; Block content; - std::map in_variables; - std::map out_variables; std::map locations; - Version required_version; - std::vector required_extensions; + Features required_features; Stage(Type);