X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=7f2efdce93ebb30557be4b713d49125bca646da0;hb=7f29c6d2a4eee36538d7ccf24980e749592e2444;hp=b20f63caf2030887a5a4ea6203346f401253e36b;hpb=f08bd843fbe63a0bf5bcbc21308f2751d08f00c1;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index b20f63ca..7f2efdce 100644 --- a/source/glsl/syntax.cpp +++ b/source/glsl/syntax.cpp @@ -117,6 +117,21 @@ void VariableReference::visit(NodeVisitor &visitor) } +InterfaceBlockReference::InterfaceBlockReference(): + declaration(0) +{ } + +InterfaceBlockReference::InterfaceBlockReference(const InterfaceBlockReference &other): + name(other.name), + declaration(0) +{ } + +void InterfaceBlockReference::visit(NodeVisitor &visitor) +{ + visitor.visit(*this); +} + + MemberAccess::MemberAccess(): declaration(0) { } @@ -166,15 +181,15 @@ void Assignment::visit(NodeVisitor &visitor) FunctionCall::FunctionCall(): - declaration(0), - constructor(false) + constructor(false), + declaration(0) { } FunctionCall::FunctionCall(const FunctionCall &other): name(other.name), - declaration(0), constructor(other.constructor), - arguments(other.arguments) + arguments(other.arguments), + declaration(0) { } void FunctionCall::visit(NodeVisitor &visitor) @@ -226,27 +241,33 @@ void StructDeclaration::visit(NodeVisitor &visitor) VariableDeclaration::VariableDeclaration(): constant(false), - type_declaration(0), array(false), + type_declaration(0), linked_declaration(0) { } VariableDeclaration::VariableDeclaration(const VariableDeclaration &other): + layout(other.layout), constant(other.constant), sampling(other.sampling), interpolation(other.interpolation), interface(other.interface), precision(other.precision), type(other.type), - type_declaration(0), name(other.name), array(other.array), array_size(other.array_size), init_expression(other.init_expression), - linked_declaration(0), - layout(other.layout) + type_declaration(0), + linked_declaration(0) { } +VariableDeclaration::~VariableDeclaration() +{ + if(linked_declaration && linked_declaration->linked_declaration==this) + linked_declaration->linked_declaration = 0; +} + void VariableDeclaration::visit(NodeVisitor &visitor) { visitor.visit(*this); @@ -254,11 +275,27 @@ void VariableDeclaration::visit(NodeVisitor &visitor) InterfaceBlock::InterfaceBlock(): - array(false) + array(false), + linked_block(0) { members.use_braces = true; } +InterfaceBlock::InterfaceBlock(const InterfaceBlock &other): + interface(other.interface), + name(other.name), + members(other.members), + instance_name(other.instance_name), + array(other.array), + linked_block(0) +{ } + +InterfaceBlock::~InterfaceBlock() +{ + if(linked_block && linked_block->linked_block==this) + linked_block->linked_block = 0; +} + void InterfaceBlock::visit(NodeVisitor &visitor) { visitor.visit(*this); @@ -273,8 +310,8 @@ FunctionDeclaration::FunctionDeclaration(const FunctionDeclaration &other): return_type(other.return_type), name(other.name), parameters(other.parameters), - definition(other.definition==&other ? this : 0), - body(other.body) + body(other.body), + definition(other.definition==&other ? this : 0) { } void FunctionDeclaration::visit(NodeVisitor &visitor)