From e803bbc0db695abe73de9797510ba22646528e23 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 27 Oct 2025 02:55:56 -0400 Subject: Modernize viewer alignment macros to use alignas and fix misaligned class issues reported by ubsan/asan Signed-off-by: Rye --- indra/llprimitive/llmodel.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'indra/llprimitive/llmodel.h') diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index ac88af18f0..26448069c6 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -40,8 +40,7 @@ class domMesh; #define MAX_MODEL_FACES 8 -LL_ALIGN_PREFIX(16) -class LLMeshSkinInfo : public LLRefCount +class alignas(16) LLMeshSkinInfo : public LLRefCount { LL_ALIGN_NEW public: @@ -65,17 +64,16 @@ public: // cached multiply of mBindShapeMatrix and mInvBindMatrix matrix_list_t mBindPoseMatrix; - LL_ALIGN_16(LLMatrix4a mBindShapeMatrix); + LLMatrix4a mBindShapeMatrix; float mPelvisOffset; bool mLockScaleIfJointPosition; bool mInvalidJointsScrubbed; bool mJointNumsInitialized; U64 mHash = 0; -} LL_ALIGN_POSTFIX(16); +}; -LL_ALIGN_PREFIX(16) -class LLModel : public LLVolume +class alignas(16) LLModel : public LLVolume { LL_ALIGN_NEW public: @@ -323,7 +321,7 @@ public: // A model/object can only have 8 faces, spillover faces will // be moved to new model/object and assigned a submodel id. int mSubmodelID; -} LL_ALIGN_POSTFIX(16); +}; typedef std::vector > model_list; typedef std::queue > model_queue; -- cgit v1.3 From e1174d206c38821b23752d2f66aa5fd8f815232a Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 17 Nov 2025 05:44:55 -0500 Subject: Remove leftover boost aligned_allocator as this is now handled by c++17 aligned allocations Signed-off-by: Rye --- indra/llprimitive/llmodel.h | 2 -- indra/llrender/llrender.h | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/llprimitive/llmodel.h') diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 26448069c6..d624b6dc7a 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -33,8 +33,6 @@ #include "m4math.h" #include -#include - class daeElement; class domMesh; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 4bfc5723ee..9c17cf3470 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -43,7 +43,6 @@ #include "llglheaders.h" #include "llmatrix4a.h" #include "glm/mat4x4.hpp" -#include #include #include @@ -531,8 +530,8 @@ private: eBlendFactor mCurrBlendAlphaSFactor; eBlendFactor mCurrBlendAlphaDFactor; - std::vector > mUIOffset; - std::vector > mUIScale; + std::vector mUIOffset; + std::vector mUIScale; struct LLVBCache { -- cgit v1.3