X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=71e5c39a948aabc7db12e701a80bcca32cfef3dc;hb=cc3f4aaaf8d2b34347f69b026c10f82797059aa4;hp=c8058c4fe9a228b102cbe4792daa83dc3f921f70;hpb=d80750e7c20ea061f210b756196cc844b762b852;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index c8058c4f..71e5c39a 100644 --- a/source/glsl/syntax.cpp +++ b/source/glsl/syntax.cpp @@ -94,7 +94,9 @@ void Block::visit(NodeVisitor &visitor) Expression::Expression(): - oper(0) + oper(0), + type(0), + lvalue(false) { } @@ -159,6 +161,18 @@ void MemberAccess::visit(NodeVisitor &visitor) } +Swizzle::Swizzle(): + count(0) +{ + fill(components, components+4, 0); +} + +void Swizzle::visit(NodeVisitor &visitor) +{ + visitor.visit(*this); +} + + void UnaryExpression::visit(NodeVisitor &visitor) { visitor.visit(*this); @@ -172,14 +186,12 @@ void BinaryExpression::visit(NodeVisitor &visitor) Assignment::Assignment(): - self_referencing(false), - target_declaration(0) + self_referencing(false) { } Assignment::Assignment(const Assignment &other): BinaryExpression(other), - self_referencing(other.self_referencing), - target_declaration(0) + self_referencing(other.self_referencing) { } void Assignment::visit(NodeVisitor &visitor) @@ -188,6 +200,24 @@ void Assignment::visit(NodeVisitor &visitor) } +Assignment::Target::Target(Statement *d): + declaration(d), + chain_len(0) +{ + fill(chain, chain+7, 0); +} + +bool Assignment::Target::operator<(const Target &other) const +{ + if(declaration!=other.declaration) + return declarationstruct_declaration==this) + interface_block->struct_declaration = 0; +} + void StructDeclaration::visit(NodeVisitor &visitor) { visitor.visit(*this); @@ -319,10 +362,10 @@ void VariableDeclaration::visit(NodeVisitor &visitor) InterfaceBlock::InterfaceBlock(): array(false), + type_declaration(0), + struct_declaration(0), linked_block(0) -{ - members.use_braces = true; -} +{ } InterfaceBlock::InterfaceBlock(const InterfaceBlock &other): Statement(other), @@ -331,6 +374,8 @@ InterfaceBlock::InterfaceBlock(const InterfaceBlock &other): members(other.members), instance_name(other.instance_name), array(other.array), + type_declaration(0), + struct_declaration(0), linked_block(0) { } @@ -338,6 +383,8 @@ InterfaceBlock::~InterfaceBlock() { if(linked_block && linked_block->linked_block==this) linked_block->linked_block = 0; + if(struct_declaration && struct_declaration->interface_block==this) + struct_declaration->interface_block = 0; } void InterfaceBlock::visit(NodeVisitor &visitor)