struct TypeDeclaration;
struct VariableDeclaration;
-struct InterfaceBlock;
struct FunctionDeclaration;
struct Statement: Node
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<Expression> left;
Kind kind = ALIAS;
unsigned size = 0;
bool sign = true;
+ bool extended_alignment = false;
std::string base;
TypeDeclaration *base_type = 0;
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 &);
NodePtr<Expression> init_expression;
TypeDeclaration *type_declaration = 0;
+ StructDeclaration *block_declaration = 0;
VariableDeclaration *linked_declaration = 0;
VariableDeclaration() = default;
virtual void visit(NodeVisitor &);
};
-struct InterfaceBlock: Statement
-{
- NodePtr<Layout> layout;
- std::string interface;
- std::string block_name;
- NodePtr<Block> 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;
};
Type type;
- Stage *previous;
+ Stage *previous = 0;
Block content;
std::map<std::string, TypeDeclaration *> types;
- std::map<std::string, InterfaceBlock *> interface_blocks;
+ std::map<std::string, VariableDeclaration *> interface_blocks;
std::map<std::string, FunctionDeclaration *> functions;
std::map<std::string, unsigned> locations;
std::map<std::string, unsigned> texture_bindings;
std::map<std::string, unsigned> uniform_block_bindings;
+ unsigned n_clip_distances = 0;
Features required_features;
std::vector<Diagnostic> diagnostics;
};
std::string get_unused_variable_name(const Block &, const std::string &);
-
-int get_layout_value(const Layout &, const std::string &, int = -1);
+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<Layout> &, const Layout::Qualifier &);
void add_to_chain(Assignment::Target &, Assignment::Target::ChainType, unsigned);
+bool targets_overlap(const Assignment::Target &, const Assignment::Target &);
} // namespace SL
} // namespace GL