X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=40f6d4f660b24c84dff02a910951c71c87ad6c4e;hb=ea844415db7fb7705ecbfea9cf27df2a8f00b802;hp=ccdb7197e570d7f786b65129b12e9196a884ccb4;hpb=c849969d056972dd976cfa616363f1bc8cbc6291;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index ccdb7197..40f6d4f6 100644 --- a/source/glsl/syntax.cpp +++ b/source/glsl/syntax.cpp @@ -294,6 +294,7 @@ void VariableDeclaration::visit(NodeVisitor &visitor) InterfaceBlock::InterfaceBlock(const InterfaceBlock &other): Statement(other), + layout(other.layout), interface(other.interface), block_name(other.block_name), members(other.members), @@ -401,6 +402,19 @@ string get_unused_variable_name(const Block &block, const string &base) } } +const TypeDeclaration *get_ultimate_base_type(const TypeDeclaration *type) +{ + if(!type) + return 0; + while(const BasicTypeDeclaration *basic = dynamic_cast(type)) + { + if(!basic->base_type) + break; + type = basic->base_type; + } + return type; +} + int get_layout_value(const Layout &layout, const string &name, int def_value) { auto i = find_member(layout.qualifiers, name, &Layout::Qualifier::name);