summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2025-04-15 19:31:20 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2025-04-15 19:31:20 +0300
commitae931987356a71dbe8fc7ec31f2a2fe9108b4495 (patch)
treed8edd9820ad2848f4adebc310ffe25d6ec355885 /indra/llmath
parent5a893f262f6c8367e7098ac68f8d605e80695745 (diff)
parentcf2b4dbfb280986cf859b12fd55158d7b9e0ac3d (diff)
Merge branch 'main' into marchcat/maint-c-restore
# Conflicts: # indra/llcommon/lldate.h # indra/newview/llappviewer.cpp # indra/newview/llinventorybridge.cpp # indra/newview/llmaterialeditor.cpp # indra/newview/llviewerparceloverlay.cpp # indra/newview/llvoavatar.cpp
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llmatrix3a.cpp2
-rw-r--r--indra/llmath/llmatrix4a.cpp2
-rw-r--r--indra/llmath/llrigginginfo.cpp2
-rw-r--r--indra/llmath/llvector4a.cpp2
-rw-r--r--indra/llmath/llvolume.cpp41
-rw-r--r--indra/llmath/llvolumeoctree.cpp2
-rw-r--r--indra/llmath/v3colorutil.h1
7 files changed, 44 insertions, 8 deletions
diff --git a/indra/llmath/llmatrix3a.cpp b/indra/llmath/llmatrix3a.cpp
index 48a72e71e1..c0b00201cf 100644
--- a/indra/llmath/llmatrix3a.cpp
+++ b/indra/llmath/llmatrix3a.cpp
@@ -24,6 +24,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "llmath.h"
static LL_ALIGN_16(const F32 M_IDENT_3A[12]) =
diff --git a/indra/llmath/llmatrix4a.cpp b/indra/llmath/llmatrix4a.cpp
index 00e30a248b..bfb4c2b07a 100644
--- a/indra/llmath/llmatrix4a.cpp
+++ b/indra/llmath/llmatrix4a.cpp
@@ -24,6 +24,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "llmath.h"
#include "llmatrix4a.h"
diff --git a/indra/llmath/llrigginginfo.cpp b/indra/llmath/llrigginginfo.cpp
index 23dbddd78e..2f59f685d5 100644
--- a/indra/llmath/llrigginginfo.cpp
+++ b/indra/llmath/llrigginginfo.cpp
@@ -24,6 +24,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "llmath.h"
#include "llrigginginfo.h"
diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp
index 0ac91366b6..b81d50f0f9 100644
--- a/indra/llmath/llvector4a.cpp
+++ b/indra/llmath/llvector4a.cpp
@@ -24,6 +24,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "llmemory.h"
#include "llmath.h"
#include "llquantize.h"
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 44b6e7923b..76e5e3aae9 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -5586,14 +5586,22 @@ struct MikktData
{
U32 count = face->mNumIndices;
- p.resize(count);
- n.resize(count);
- tc.resize(count);
- t.resize(count);
+ try
+ {
+ p.resize(count);
+ n.resize(count);
+ tc.resize(count);
+ t.resize(count);
- if (face->mWeights)
+ if (face->mWeights)
+ {
+ w.resize(count);
+ }
+ }
+ catch (std::bad_alloc&)
{
- w.resize(count);
+ LLError::LLUserWarningMsg::showOutOfMemory();
+ LL_ERRS("LLCoros") << "Bad memory allocation in MikktData, elements count: " << count << LL_ENDL;
}
@@ -5665,7 +5673,16 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
// and is executed on a background thread
MikktData data(this);
mikk::Mikktspace ctx(data);
- ctx.genTangSpace();
+ try
+ {
+ ctx.genTangSpace();
+ }
+ catch (std::bad_alloc&)
+ {
+ LLError::LLUserWarningMsg::showOutOfMemory();
+ LL_ERRS("LLCoros") << "Bad memory allocation in MikktData::genTangSpace" << LL_ENDL;
+ }
+
//re-weld
meshopt_Stream mos[] =
@@ -5678,7 +5695,15 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
};
std::vector<U32> remap;
- remap.resize(data.p.size());
+ try
+ {
+ remap.resize(data.p.size());
+ }
+ catch (std::bad_alloc&)
+ {
+ LLError::LLUserWarningMsg::showOutOfMemory();
+ LL_ERRS("LLCoros") << "Failed to allocate memory for remap: " << (S32)data.p.size() << LL_ENDL;
+ }
U32 stream_count = data.w.empty() ? 4 : 5;
diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp
index 71288daa89..141317ee8d 100644
--- a/indra/llmath/llvolumeoctree.cpp
+++ b/indra/llmath/llvolumeoctree.cpp
@@ -24,6 +24,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "llvolumeoctree.h"
#include "llvector4a.h"
diff --git a/indra/llmath/v3colorutil.h b/indra/llmath/v3colorutil.h
index 62005f76a0..af8799e42a 100644
--- a/indra/llmath/v3colorutil.h
+++ b/indra/llmath/v3colorutil.h
@@ -28,6 +28,7 @@
#define LL_V3COLORUTIL_H
#include "v3color.h"
+#include "v4color.h"
inline LLColor3 componentDiv(LLColor3 const &left, LLColor3 const & right)
{