X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=b224763248f26aa20f2d7e537ccbc6aa224acdb7;hb=eb7ffda6876bd2eeeb64dcb7c82236f36fe5cf43;hp=23b8f0301e9bd76196ec15b7388ef74f5ed2887e;hpb=20a86c5905e1f7527d3c9edc3f56f6b7679c268a;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index 23b8f030..b2247632 100644 --- a/source/glsl/syntax.cpp +++ b/source/glsl/syntax.cpp @@ -138,14 +138,16 @@ void InterfaceBlockReference::visit(NodeVisitor &visitor) MemberAccess::MemberAccess(): - declaration(0) + declaration(0), + index(-1) { } MemberAccess::MemberAccess(const MemberAccess &other): Expression(other), left(other.left), member(other.member), - declaration(0) + declaration(0), + index(-1) { } void MemberAccess::visit(NodeVisitor &visitor) @@ -545,6 +547,21 @@ bool is_same_type(const TypeDeclaration &type1, const TypeDeclaration &type2) return false; } +int get_layout_value(const Layout &layout, const string &name, int def_value) +{ + for(vector::const_iterator i=layout.qualifiers.begin(); i!=layout.qualifiers.end(); ++i) + if(i->name==name) + return i->value; + return def_value; +} + +void add_to_chain(Assignment::Target &target, Assignment::Target::ChainType type, unsigned index) +{ + if(target.chain_len<7) + target.chain[target.chain_len] = type | min(index, 0x3F); + ++target.chain_len; +} + } // namespace SL } // namespace GL } // namespace Msp