+ bool push_constant = false;
+ if(iface.layout)
+ {
+ auto i = find_member(iface.layout->qualifiers, string("push_constant"), &Layout::Qualifier::name);
+ push_constant = (i!=iface.layout->qualifiers.end());
+ }
+
+ if((!supports_interface_blocks(iface.interface) || (push_constant && features.target_api!=VULKAN)) && iface.type_declaration)
+ {
+ if(!iface.instance_name.empty())
+ unsupported("ARB_uniform_buffer_object required for interface block instances");
+ else if(iface.struct_declaration)
+ {
+ for(const RefPtr<Statement> &s: iface.struct_declaration->members.body)
+ if(VariableDeclaration *var = dynamic_cast<VariableDeclaration *>(s.get()))
+ var->interface = iface.interface;
+ 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");
+ }
+}
+
+
+void QualifierConverter::apply()
+{
+ stage->content.visit(*this);
+}
+
+bool QualifierConverter::supports_interface_layouts() const
+{
+ if(features.target_api==VULKAN)
+ return true;
+ else if(features.target_api==OPENGL_ES)