summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-05-22 04:35:02 -0500
committerDave Parks <davep@lindenlab.com>2010-05-22 04:35:02 -0500
commit4d57cb3c0975ff0bcea0d6fb3498f2d90962ff16 (patch)
tree09f22534b7ae5b066ae7fa1b2b9332df791c8ae0 /indra/newview/llvovolume.cpp
parent8919f4811a7dcaf47dc58159e0ba4ba042183325 (diff)
Vectorize/memory align buffers in llvolumeface WIP
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index cea964a100..7d80a66041 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -60,6 +60,7 @@
#include "llflexibleobject.h"
#include "llsky.h"
#include "lltexturefetch.h"
+#include "llvector4a.h"
#include "llviewercamera.h"
#include "llviewertexturelist.h"
#include "llviewerobjectlist.h"
@@ -1601,14 +1602,8 @@ void LLVOVolume::updateFaceSize(S32 idx)
else
{
const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx);
- if (LLPipeline::sUseTriStrips)
- {
- facep->setSize(vol_face.mVertices.size(), vol_face.mTriStrip.size());
- }
- else
- {
- facep->setSize(vol_face.mVertices.size(), vol_face.mIndices.size());
- }
+ facep->setSize(vol_face.mNumVertices, vol_face.mNumIndices);
+
}
}
@@ -1863,21 +1858,25 @@ bool LLVOVolume::hasMedia() const
LLVector3 LLVOVolume::getApproximateFaceNormal(U8 face_id)
{
LLVolume* volume = getVolume();
- LLVector3 result;
+ LLVector4a result;
+ result.clear();
+
+ LLVector3 ret;
if (volume && face_id < volume->getNumVolumeFaces())
{
const LLVolumeFace& face = volume->getVolumeFace(face_id);
- for (S32 i = 0; i < (S32)face.mVertices.size(); ++i)
+ for (S32 i = 0; i < (S32)face.mNumVertices; ++i)
{
- result += face.mVertices[i].mNormal;
+ result.add(*((LLVector4a*) face.mNormals+i*4));
}
- result = volumeDirectionToAgent(result);
- result.normVec();
+ LLVector3 ret((F32*) &result.mQ);
+ ret = volumeDirectionToAgent(ret);
+ ret.normVec();
}
- return result;
+ return ret;
}
void LLVOVolume::requestMediaDataUpdate(bool isNew)
@@ -3032,7 +3031,7 @@ F32 LLVOVolume::getBinRadius()
for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
{
const LLVolumeFace& face = volume->getVolumeFace(i);
- vert_count += face.mVertices.size();
+ vert_count += face.mNumVertices;
}
scale = 1.f/llmax(vert_count/1024.f, 1.f);