Unloading was clearing the format of VertexSetup and it wouldn't accept
the vertex array. Setting storage format should also be skipped while
loading from a file if the same format was set previously.
VertexFormat fmt;
for(VertexAttribute a: attrs)
fmt = (fmt, a);
- obj.storage(fmt);
+ if(fmt!=obj.vertices.get_format())
+ obj.storage(fmt);
}
void Mesh::Loader::vertices()
VertexSetupBackend::unload();
vertex_array = nullptr;
- vertex_format = VertexFormat();
inst_array = nullptr;
- inst_format = VertexFormat();
index_buffer = nullptr;
}