From 3873b2221807d2d52b9ca111eecb4c3993af3ac9 Mon Sep 17 00:00:00 2001 From: Beq Date: Tue, 8 Oct 2024 18:45:16 +0100 Subject: [PATCH] FIRE-34600 - updateParticles AVX2 bug again Let's be more strict about the access to the vector. --- indra/newview/llviewerpartsim.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 69b3226ec2..8f3190a499 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -399,8 +399,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) // Kill dead particles (either flagged dead, or too old) if ((part->mLastUpdateTime > part->mMaxAge) || (LLViewerPart::LL_PART_DEAD_MASK == part->mFlags)) { - mParticles[i] = mParticles.back() ; - mParticles.pop_back() ; + vector_replace_with_last(mParticles, mParticles.begin() + i); // FIRE-34600 - bugsplat AVX2 particle count mismatch delete part ; } else @@ -410,8 +409,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) { // Transfer particles between groups LLViewerPartSim::getInstance()->put(part) ; - mParticles[i] = mParticles.back() ; - mParticles.pop_back() ; + vector_replace_with_last(mParticles, mParticles.begin() + i); // FIRE-34600 - bugsplat AVX2 particle count mismatch } else {