X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompatibility.cpp;h=3700a9c9a3379653e661ad0f56799eb454c03c20;hb=f526938b407e061c7424adedc34af4d1ff687f90;hp=55fa30d9154af0812be6ae5ccf9c7b6e58b56477;hpb=c288e8d074f303f275ce03bf09c8799b2c8fde6e;p=libs%2Fgl.git diff --git a/source/glsl/compatibility.cpp b/source/glsl/compatibility.cpp index 55fa30d9..3700a9c9 100644 --- a/source/glsl/compatibility.cpp +++ b/source/glsl/compatibility.cpp @@ -341,10 +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) { - stage->content.body.splice(uniform_insert_point, iface.members.body); - nodes_to_remove.insert(&iface); + if(!iface.instance_name.empty()) + unsupported("ARB_uniform_buffer_object required for interface block instances"); + else if(iface.struct_declaration) + { + 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"); } }