X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=c54a82979081cc03e3a2c4bbb66e55cb9b2aa934;hb=3773733011653d67e47768cf031e95f8f68cf714;hp=23b8f0301e9bd76196ec15b7388ef74f5ed2887e;hpb=20a86c5905e1f7527d3c9edc3f56f6b7679c268a;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index 23b8f030..c54a8297 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,14 @@ 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; +} + } // namespace SL } // namespace GL } // namespace Msp