check_assignment_target(iface.declaration);
}
-void VariableResolver::add_to_chain(Assignment::Target::ChainType type, unsigned index)
-{
- if(r_assignment_target.chain_len<7)
- r_assignment_target.chain[r_assignment_target.chain_len] = type | min<unsigned>(index, 0x3F);
- ++r_assignment_target.chain_len;
-}
-
void VariableResolver::visit(MemberAccess &memacc)
{
TraversingVisitor::visit(memacc);
++index;
if(record_target)
- add_to_chain(Assignment::Target::MEMBER, index);
+ add_to_chain(r_assignment_target, Assignment::Target::MEMBER, index);
}
}
else if(BasicTypeDeclaration *basic = dynamic_cast<BasicTypeDeclaration *>(memacc.left->type))
unsigned mask = 0;
for(unsigned i=0; i<swizzle.count; ++i)
mask |= 1<<swizzle.components[i];
- add_to_chain(Assignment::Target::SWIZZLE, mask);
+ add_to_chain(r_assignment_target, Assignment::Target::SWIZZLE, mask);
}
}
if(Literal *literal_subscript = dynamic_cast<Literal *>(binary.right.get()))
if(literal_subscript->value.check_type<int>())
index = literal_subscript->value.value<int>();
- add_to_chain(Assignment::Target::ARRAY, index);
+ add_to_chain(r_assignment_target, Assignment::Target::ARRAY, index);
}
}
else
void check_assignment_target(Statement *);
virtual void visit(VariableReference &);
virtual void visit(InterfaceBlockReference &);
- void add_to_chain(Assignment::Target::ChainType, unsigned);
virtual void visit(MemberAccess &);
virtual void visit(Swizzle &);
virtual void visit(BinaryExpression &);
bool is_same_type(const TypeDeclaration &, const TypeDeclaration &);
int get_layout_value(const Layout &, const std::string &, int = -1);
+void add_to_chain(Assignment::Target &, Assignment::Target::ChainType, unsigned);
} // namespace SL
} // namespace GL