summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolume.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-12-15 12:34:37 +0800
committerErik Kundiman <erik@megapahit.org>2024-12-15 12:34:37 +0800
commit3316ffb3b571b8730d26d6e8b2ee00fc9cbdf7c0 (patch)
tree200cd8497a4fdd782ac4dbfd2ad5fb1632e03275 /indra/llmath/llvolume.cpp
parentd4e433b37af94ee11880deeede74a87a728f4775 (diff)
parent5b77436cf0ad749d36e8f0c60077eeb24698d644 (diff)
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r--indra/llmath/llvolume.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index b2f14f71cc..6bf276a3cf 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -5163,7 +5163,10 @@ bool LLVolumeFace::VertexMapData::ComparePosition::operator()(const LLVector3& a
void LLVolumeFace::remap()
{
// Generate a remap buffer
- std::vector<unsigned int> remap(mNumVertices);
+ // Documentation for meshopt_generateVertexRemapMulti claims that remap should use vertice count
+ // but all examples use indice count. There are out of bounds crashes when using vertice count.
+ // To be on the safe side use bigger of the two.
+ std::vector<unsigned int> remap(llmax(mNumIndices, mNumVertices));
S32 remap_vertices_count = static_cast<S32>(LLMeshOptimizer::generateRemapMultiU16(&remap[0],
mIndices,
mNumIndices,