Explicit enforcement of alignment for all aligned types, including structures with aligned members. (Compiler handholding)
This commit is contained in:
@@ -231,9 +231,9 @@ BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
||||
mBaseCoords = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||
mBaseNormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||
mBaseBinormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||
mTexCoords = (LLVector2*) ll_aligned_malloc_16(numVertices*sizeof(LLVector2));
|
||||
mDetailTexCoords = (LLVector2*) ll_aligned_malloc_16(numVertices*sizeof(LLVector2));
|
||||
mWeights = (F32*) ll_aligned_malloc_16(numVertices*sizeof(F32));
|
||||
mTexCoords = (LLVector2*) ll_aligned_malloc_16((numVertices+numVertices%2)*sizeof(LLVector2));
|
||||
mDetailTexCoords = (LLVector2*) ll_aligned_malloc_16((numVertices+numVertices%2)*sizeof(LLVector2));
|
||||
mWeights = (F32*) ll_aligned_malloc_16(((numVertices)*sizeof(F32)+0xF) & ~0xF);
|
||||
for (i = 0; i < numVertices; i++)
|
||||
{
|
||||
mBaseCoords[i].clear();
|
||||
|
||||
@@ -68,7 +68,16 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
|
||||
{
|
||||
friend class LLPolySkeletalDistortion;
|
||||
public:
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
LLPolySkeletalDistortionInfo();
|
||||
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
||||
|
||||
@@ -77,12 +86,12 @@ public:
|
||||
protected:
|
||||
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
|
||||
bone_info_list_t mBoneInfoList;
|
||||
};
|
||||
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLPolySkeletalDeformation
|
||||
// A set of joint scale data for deforming the avatar mesh
|
||||
//-----------------------------------------------------------------------------
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLPolySkeletalDistortion : public LLViewerVisualParam
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
// LLMatrix3a is the base class for LLRotation, which should be used instead any time you're dealing with a
|
||||
// rotation matrix.
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLMatrix3a
|
||||
{
|
||||
public:
|
||||
@@ -113,8 +114,9 @@ protected:
|
||||
|
||||
LL_ALIGN_16(LLVector4a mColumns[3]);
|
||||
|
||||
};
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLRotation : public LLMatrix3a
|
||||
{
|
||||
public:
|
||||
@@ -123,6 +125,6 @@ public:
|
||||
|
||||
// Returns true if this rotation is orthonormal with det ~= 1
|
||||
inline bool isOkRotation() const;
|
||||
};
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -932,10 +932,10 @@ protected:
|
||||
MIN = 3
|
||||
} eDName;
|
||||
|
||||
LLVector4a mCenter;
|
||||
LLVector4a mSize;
|
||||
LLVector4a mMax;
|
||||
LLVector4a mMin;
|
||||
LL_ALIGN_16(LLVector4a mCenter);
|
||||
LL_ALIGN_16(LLVector4a mSize);
|
||||
LL_ALIGN_16(LLVector4a mMax);
|
||||
LL_ALIGN_16(LLVector4a mMin);
|
||||
|
||||
oct_node* mParent;
|
||||
U8 mOctant;
|
||||
@@ -964,6 +964,26 @@ public:
|
||||
: BaseType(center, size, parent)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef LL_OCTREE_POOLS
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return getPool(size).malloc();
|
||||
}
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
getPool(sizeof(LLOctreeNode<T>)).free(ptr);
|
||||
}
|
||||
#else
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool balance()
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
LLVector4a mV;
|
||||
LL_ALIGN_16(LLVector4a mV);
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
/////////////////////////////
|
||||
#include "llquaternion.h"
|
||||
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLQuaternion2
|
||||
{
|
||||
public:
|
||||
@@ -100,8 +101,8 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
LLVector4a mQ;
|
||||
LL_ALIGN_16(LLVector4a mQ);
|
||||
|
||||
};
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -750,10 +750,10 @@ public:
|
||||
class PathPt
|
||||
{
|
||||
public:
|
||||
LLMatrix4a mRot;
|
||||
LLVector4a mPos;
|
||||
LL_ALIGN_16(LLMatrix4a mRot);
|
||||
LL_ALIGN_16(LLVector4a mPos);
|
||||
|
||||
LLVector4a mScale;
|
||||
LL_ALIGN_16(LLVector4a mScale);
|
||||
F32 mTexT;
|
||||
F32 pad[3]; //for alignment
|
||||
PathPt()
|
||||
|
||||
@@ -127,13 +127,14 @@ public:
|
||||
LL_ALIGN_16(LLVector4a mExtents[2]); // extents (min, max) of this node and all its children
|
||||
};
|
||||
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLOctreeTriangleRayIntersect : public LLOctreeTraveler<LLVolumeTriangle>
|
||||
{
|
||||
public:
|
||||
const LLVolumeFace* mFace;
|
||||
LLVector4a mStart;
|
||||
LLVector4a mDir;
|
||||
LLVector4a mEnd;
|
||||
LL_ALIGN_16(LLVector4a mStart);
|
||||
LL_ALIGN_16(LLVector4a mDir);
|
||||
LL_ALIGN_16(LLVector4a mEnd);
|
||||
LLVector4a* mIntersection;
|
||||
LLVector2* mTexCoord;
|
||||
LLVector4a* mNormal;
|
||||
@@ -148,7 +149,7 @@ public:
|
||||
void traverse(const LLOctreeNode<LLVolumeTriangle>* node);
|
||||
|
||||
virtual void visit(const LLOctreeNode<LLVolumeTriangle>* node);
|
||||
};
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
class LLVolumeOctreeValidate : public LLOctreeTraveler<LLVolumeTriangle>
|
||||
{
|
||||
|
||||
@@ -322,6 +322,7 @@ public:
|
||||
Does not stack.
|
||||
Caches inverse of projection matrix used in gGLObliqueProjectionInverse
|
||||
*/
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLGLUserClipPlane
|
||||
{
|
||||
public:
|
||||
@@ -332,11 +333,12 @@ public:
|
||||
void setPlane(F32 a, F32 b, F32 c, F32 d);
|
||||
|
||||
private:
|
||||
bool mApply;
|
||||
|
||||
LLMatrix4a mProjection;
|
||||
LLMatrix4a mModelview;
|
||||
};
|
||||
LL_ALIGN_16(LLMatrix4a mProjection);
|
||||
LL_ALIGN_16(LLMatrix4a mModelview);
|
||||
|
||||
bool mApply;
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
/*
|
||||
Modify and load projection matrix to push depth values to far clip plane.
|
||||
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
static U32 getRiggedDataMask(U32 type);
|
||||
|
||||
public: //aligned members
|
||||
LLVector4a mExtents[2];
|
||||
LL_ALIGN_16(LLVector4a mExtents[2]);
|
||||
|
||||
private:
|
||||
F32 adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius );
|
||||
|
||||
@@ -40,13 +40,24 @@
|
||||
class LLVOAvatar;
|
||||
class LLViewerJointMesh;
|
||||
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLPreviewAnimation : public LLViewerDynamicTexture
|
||||
{
|
||||
public:
|
||||
virtual ~LLPreviewAnimation();
|
||||
|
||||
public:
|
||||
LLPreviewAnimation(S32 width, S32 height);
|
||||
LLPreviewAnimation(S32 width, S32 height);
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
/*virtual*/ S8 getType() const ;
|
||||
|
||||
@@ -69,7 +80,7 @@ protected:
|
||||
LLVector3 mCameraOffset;
|
||||
LLVector3 mCameraRelPos;
|
||||
LLPointer<LLVOAvatar> mDummyAvatar;
|
||||
};
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
class LLFloaterBvhPreview : public LLFloaterNameDesc
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ private:
|
||||
protected:
|
||||
void draw();
|
||||
|
||||
LLPreviewAnimation mAnimPreview;
|
||||
LL_ALIGN_16(LLPreviewAnimation mAnimPreview);
|
||||
LLRect mPreviewRect;
|
||||
S32 mLastMouseX;
|
||||
S32 mLastMouseY;
|
||||
|
||||
@@ -52,6 +52,16 @@ protected:
|
||||
public:
|
||||
LLImagePreviewSculpted(S32 width, S32 height);
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
/*virtual*/ S8 getType() const ;
|
||||
|
||||
void setPreviewTarget(LLImageRaw *imagep, F32 distance);
|
||||
@@ -85,6 +95,16 @@ protected:
|
||||
public:
|
||||
LLImagePreviewAvatar(S32 width, S32 height);
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
/*virtual*/ S8 getType() const ;
|
||||
|
||||
void setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male);
|
||||
|
||||
@@ -302,6 +302,16 @@ public:
|
||||
LLModelPreview(S32 width, S32 height, LLFloater* fmp);
|
||||
virtual ~LLModelPreview();
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
void resetPreviewTarget();
|
||||
void setPreviewTarget(F32 distance);
|
||||
void setTexture(U32 name) { mTextureName = name; }
|
||||
|
||||
@@ -3576,6 +3576,7 @@ void renderLights(LLDrawable* drawablep)
|
||||
}
|
||||
}
|
||||
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect
|
||||
{
|
||||
public:
|
||||
@@ -3648,7 +3649,7 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
void renderRaycast(LLDrawable* drawablep)
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
|
||||
void validate();
|
||||
|
||||
LLVector4a mExtents[2];
|
||||
LL_ALIGN_16(LLVector4a mExtents[2]);
|
||||
|
||||
LLPointer<LLVertexBuffer> mVertexBuffer;
|
||||
LLPointer<LLViewerTexture> mTexture;
|
||||
|
||||
@@ -65,6 +65,16 @@ public:
|
||||
LLWearable *wearable,
|
||||
F32 param_weight);
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
/*virtual*/ S8 getType() const ;
|
||||
|
||||
BOOL needsRender();
|
||||
@@ -110,6 +120,17 @@ protected:
|
||||
/*virtual */ ~LLVisualParamReset(){}
|
||||
public:
|
||||
LLVisualParamReset();
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
/*virtual */ BOOL render();
|
||||
/*virtual*/ S8 getType() const ;
|
||||
|
||||
|
||||
@@ -79,6 +79,16 @@ public:
|
||||
LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height);
|
||||
virtual ~LLViewerTexLayerSetBuffer();
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
public:
|
||||
/*virtual*/ S8 getType() const;
|
||||
BOOL isInitialized(void) const;
|
||||
|
||||
Reference in New Issue
Block a user