X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=40f6d4f660b24c84dff02a910951c71c87ad6c4e;hb=ea844415db7fb7705ecbfea9cf27df2a8f00b802;hp=1489eb9e2af7e04ec542deb1c740efa6d8fc4d7f;hpb=30904c6b6e7d885d9ade818328a2137c204e7efe;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index 1489eb9e..40f6d4f6 100644 --- a/source/glsl/syntax.cpp +++ b/source/glsl/syntax.cpp @@ -402,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);