Fix non-determinism in XGL importer output due to std::multimap value ordering not guaranteed < C++11.
One step closer to a fully reproducible regression test suite.
This commit is contained in:
committed by
Alexander Gessler
parent
14324c60cf
commit
8666b614c6
@@ -431,6 +431,12 @@ aiNode* XGLImporter::ReadObject(TempScope& scope, bool skipFirst, const char* cl
|
||||
throw;
|
||||
}
|
||||
|
||||
// FIX: since we used std::multimap<> to keep meshes by id, mesh order now depends on the behaviour
|
||||
// of the multimap implementation with respect to the ordering of entries with same values.
|
||||
// C++11 gives the guarantee that it uses insertion order, before it is implementation-specific.
|
||||
// Sort by material id to always guarantee a deterministic result.
|
||||
std::sort(meshes.begin(), meshes.end(), SortMeshByMaterialId(scope));
|
||||
|
||||
// link meshes to node
|
||||
nd->mNumMeshes = static_cast<unsigned int>(meshes.size());
|
||||
if (nd->mNumMeshes) {
|
||||
|
||||
Reference in New Issue
Block a user