void LegacyConverter::visit(Assignment &assign)
{
TraversingVisitor::visit(assign);
- if(assign.target_declaration==frag_out && !supports_unified_interface_syntax())
- assign.target_declaration = 0;
+ if(assign.target.declaration==frag_out && !supports_unified_interface_syntax())
+ assign.target.declaration = 0;
}
bool LegacyConverter::supports_unified_sampling_functions() 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");
}
}