X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=4526bf2bd986075f6bfe50e50dae1eabf2ebd204;hb=59347f76bc985e8c9c769d4a3eee672cba9c920b;hp=32a7b12c6639aebd69344aa7a2f6408c67de308f;hpb=d8bdf61007978e2c3670a22a58e2f105e8347537;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index 32a7b12c..4526bf2b 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) @@ -269,6 +271,7 @@ void InterfaceLayout::visit(NodeVisitor &visitor) BasicTypeDeclaration::BasicTypeDeclaration(): kind(ALIAS), size(0), + sign(true), base_type(0) { } @@ -276,6 +279,7 @@ BasicTypeDeclaration::BasicTypeDeclaration(const BasicTypeDeclaration &other): TypeDeclaration(other), kind(other.kind), size(other.size), + sign(other.sign), base(other.base), base_type(0) { } @@ -485,6 +489,21 @@ string get_unused_variable_name(const Block &block, const string &base) } } +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