Browse Source

MeshTools: fix concatenate() for more than 4 GB of data.

This isn't as easy to auto-test, unfortunately, so hopefully the comment
will ensure it doesn't regress again.
pull/617/head
Vladimír Vondruš 3 years ago
parent
commit
b07d1aae8b
  1. 4
      src/Magnum/MeshTools/Concatenate.h

4
src/Magnum/MeshTools/Concatenate.h

@ -133,7 +133,9 @@ template<template<class> class Allocator = Containers::ArrayAllocator> void conc
there, otherwise attributes that are not present in `meshes` would
be garbage */
Containers::arrayResize<Allocator>(vertexData, 0);
Containers::arrayResize<Allocator>(vertexData, ValueInit, attributeStride*indexVertexCount.second);
/* A cast to std::size_t is needed in order to allow sizes over 4 GB on
64-bit */
Containers::arrayResize<Allocator>(vertexData, ValueInit, attributeStride*std::size_t(indexVertexCount.second));
}
destination = Implementation::concatenate(std::move(indexData), indexVertexCount.second, std::move(vertexData), std::move(attributeData), meshes, "MeshTools::concatenateInto():");

Loading…
Cancel
Save