X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fcompatibility.cpp;h=3700a9c9a3379653e661ad0f56799eb454c03c20;hp=a5ba8247a53d705c82223d9b8241e5d28dbea14e;hb=041ba4b1acd55337239c5ce24cc310118c621206;hpb=cd01b904990d306eadd120f306b1d0ceb4d8f5c8 diff --git a/source/glsl/compatibility.cpp b/source/glsl/compatibility.cpp index a5ba8247..3700a9c9 100644 --- a/source/glsl/compatibility.cpp +++ b/source/glsl/compatibility.cpp @@ -341,15 +341,20 @@ bool LegacyConverter::supports_interface_blocks(const string &iface) const void LegacyConverter::visit(InterfaceBlock &iface) { - if(!supports_interface_blocks(iface.interface)) + if(!supports_interface_blocks(iface.interface) && iface.type_declaration) { if(!iface.instance_name.empty()) unsupported("ARB_uniform_buffer_object required for interface block instances"); - else + else if(iface.struct_declaration) { - stage->content.body.splice(uniform_insert_point, iface.members.body); + stage->content.body.splice(uniform_insert_point, iface.struct_declaration->members.body); nodes_to_remove.insert(&iface); + nodes_to_remove.insert(iface.struct_declaration); } + else + /* If the interface block is an array, it should have an instance + name too, so this should never be reached */ + throw logic_error("Unexpected interface block configuration"); } }