summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lldrawpoolavatar.cpp6
-rw-r--r--indra/newview/llface.cpp55
-rw-r--r--indra/newview/llfloaterimagepreview.cpp6
-rw-r--r--indra/newview/llhudicon.cpp2
-rw-r--r--indra/newview/llhudtext.cpp5
-rw-r--r--indra/newview/llviewercamera.cpp5
-rw-r--r--indra/newview/llvograss.cpp2
-rw-r--r--indra/newview/llvotextbubble.cpp33
-rw-r--r--indra/newview/llvovolume.cpp29
9 files changed, 88 insertions, 55 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 4fb8f5266e..0fa0e80cb7 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1201,14 +1201,14 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLFace* face, const LLMeshSk
if (!buff ||
buff->getTypeMask() != data_mask ||
- buff->getRequestedVerts() != vol_face.mVertices.size())
+ buff->getRequestedVerts() != vol_face.mNumVertices)
{
face->setGeomIndex(0);
face->setIndicesIndex(0);
- face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size());
+ face->setSize(vol_face.mNumVertices, vol_face.mNumIndices);
face->mVertexBuffer = new LLVertexBuffer(data_mask, 0);
- face->mVertexBuffer->allocateBuffer(vol_face.mVertices.size(), vol_face.mIndices.size(), true);
+ face->mVertexBuffer->allocateBuffer(vol_face.mNumVertices, vol_face.mNumIndices, true);
U16 offset = 0;
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 53dc335c16..77e8a6fdf9 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -928,8 +928,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
LLFastTimer t(FTM_FACE_GET_GEOM);
const LLVolumeFace &vf = volume.getVolumeFace(f);
- S32 num_vertices = (S32)vf.mVertices.size();
- S32 num_indices = LLPipeline::sUseTriStrips ? (S32)vf.mTriStrip.size() : (S32) vf.mIndices.size();
+ S32 num_vertices = (S32)vf.mNumVertices;
+ S32 num_indices = (S32) vf.mNumIndices;
if (mVertexBuffer.notNull())
{
@@ -1128,19 +1128,9 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (full_rebuild)
{
mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex);
- if (LLPipeline::sUseTriStrips)
+ for (U32 i = 0; i < (U32) num_indices; i++)
{
- for (U32 i = 0; i < (U32) num_indices; i++)
- {
- *indicesp++ = vf.mTriStrip[i] + index_offset;
- }
- }
- else
- {
- for (U32 i = 0; i < (U32) num_indices; i++)
- {
- *indicesp++ = vf.mIndices[i] + index_offset;
- }
+ *indicesp++ = vf.mIndices[i] + index_offset;
}
}
@@ -1214,28 +1204,41 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
bool bake_sunlight = !getTextureEntry()->getFullbright() &&
!mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL);
+ //VECTORIZE THIS
for (S32 i = 0; i < num_vertices; i++)
{
+ LLVector3 vf_binormal;
+ if (vf.mBinormals)
+ {
+ vf_binormal.set(vf.mBinormals+i*4);
+ }
+
+ LLVector3 vf_normal;
+ vf_normal.set(vf.mNormals+i*4);
+
+ LLVector3 vf_position;
+ vf_position.set(vf.mPositions+i*4);
+
if (rebuild_tcoord)
{
- LLVector2 tc = vf.mVertices[i].mTexCoord;
+ LLVector2 tc(vf.mTexCoords+i*2);
if (texgen != LLTextureEntry::TEX_GEN_DEFAULT)
{
- LLVector3 vec = vf.mVertices[i].mPosition;
+ LLVector3 vec = vf_position;
vec.scaleVec(scale);
switch (texgen)
{
case LLTextureEntry::TEX_GEN_PLANAR:
- planarProjection(tc, vf.mVertices[i].mNormal, vf.mCenter, vec);
+ planarProjection(tc, vf_normal, vf.mCenter, vec);
break;
case LLTextureEntry::TEX_GEN_SPHERICAL:
- sphericalProjection(tc, vf.mVertices[i].mNormal, vf.mCenter, vec);
+ sphericalProjection(tc, vf_normal, vf.mCenter, vec);
break;
case LLTextureEntry::TEX_GEN_CYLINDRICAL:
- cylindricalProjection(tc, vf.mVertices[i].mNormal, vf.mCenter, vec);
+ cylindricalProjection(tc, vf_normal, vf.mCenter, vec);
break;
default:
break;
@@ -1345,10 +1348,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (bump_code && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_TEXCOORD1))
{
- LLVector3 tangent = vf.mVertices[i].mBinormal % vf.mVertices[i].mNormal;
+ LLVector3 tangent = vf_binormal % vf_normal;
LLMatrix3 tangent_to_object;
- tangent_to_object.setRows(tangent, vf.mVertices[i].mBinormal, vf.mVertices[i].mNormal);
+ tangent_to_object.setRows(tangent, vf_binormal, vf_normal);
LLVector3 binormal = binormal_dir * tangent_to_object;
binormal = binormal * mat_normal;
@@ -1366,12 +1369,12 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_pos)
{
- *vertices++ = vf.mVertices[i].mPosition * mat_vert;
+ *vertices++ = vf_position * mat_vert;
}
if (rebuild_normal)
{
- LLVector3 normal = vf.mVertices[i].mNormal * mat_normal;
+ LLVector3 normal = vf_normal * mat_normal;
normal.normVec();
*normals++ = normal;
@@ -1379,21 +1382,21 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_binormal)
{
- LLVector3 binormal = vf.mVertices[i].mBinormal * mat_normal;
+ LLVector3 binormal = vf_binormal * mat_normal;
binormal.normVec();
*binormals++ = binormal;
}
if (rebuild_weights && vf.mWeights.size() > i)
{
- *weights++ = vf.mWeights[i];
+ (*weights++) = vf.mWeights[i];
}
if (rebuild_color)
{
if (bake_sunlight)
{
- LLVector3 normal = vf.mVertices[i].mNormal * mat_normal;
+ LLVector3 normal = vf_normal * mat_normal;
normal.normVec();
F32 da = normal * gPipeline.mSunDir;
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 159e4b41ca..dae301ae29 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -852,6 +852,7 @@ S8 LLImagePreviewSculpted::getType() const
void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
{
+#if 0 //VECTORIZE THIS
mCameraDistance = distance;
mCameraZoom = 1.f;
mCameraPitch = 0.f;
@@ -892,6 +893,7 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
{
*(index_strider++) = vf.mIndices[i];
}
+#endif
}
@@ -901,7 +903,7 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
BOOL LLImagePreviewSculpted::render()
{
mNeedsUpdate = FALSE;
-
+#if 0 //VECTORIZE THIS
LLGLSUIDefault def;
LLGLDisable no_blend(GL_BLEND);
LLGLEnable cull(GL_CULL_FACE);
@@ -959,7 +961,7 @@ BOOL LLImagePreviewSculpted::render()
mVertexBuffer->draw(LLRender::TRIANGLES, num_indices, 0);
gGL.popMatrix();
-
+#endif
return TRUE;
}
diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp
index 28b0e7356a..c7ad0bde7e 100644
--- a/indra/newview/llhudicon.cpp
+++ b/indra/newview/llhudicon.cpp
@@ -271,6 +271,7 @@ BOOL LLHUDIcon::lineSegmentIntersect(const LLVector3& start, const LLVector3& en
LLVector3 upper_left = icon_position - (x_scale * 0.5f) + y_scale;
LLVector3 upper_right = icon_position + (x_scale * 0.5f) + y_scale;
+#if 0 //VECTORIZE THIS
F32 t = 0.f;
LLVector3 dir = end-start;
@@ -284,6 +285,7 @@ BOOL LLHUDIcon::lineSegmentIntersect(const LLVector3& start, const LLVector3& en
}
return TRUE;
}
+#endif
return FALSE;
}
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index 9ed5d13831..64c01d0937 100644
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -206,6 +206,8 @@ BOOL LLHUDText::lineSegmentIntersect(const LLVector3& start, const LLVector3& en
gGL.end();
}
+#if 0 //VECTORIZE THIS
+
LLVector3 dir = end-start;
F32 t = 0.f;
@@ -218,6 +220,9 @@ BOOL LLHUDText::lineSegmentIntersect(const LLVector3& start, const LLVector3& en
return TRUE;
}
}
+
+#endif
+
}
return FALSE;
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index aa82c216d9..7eca276358 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -788,13 +788,14 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
LLMatrix4 render_mat(vo_volume->getRenderRotation(), LLVector4(vo_volume->getRenderPosition()));
num_faces = volume->getNumVolumeFaces();
+ //VECTORIZE THIS
for (i = 0; i < num_faces; i++)
{
const LLVolumeFace& face = volume->getVolumeFace(i);
- for (U32 v = 0; v < face.mVertices.size(); v++)
+ for (U32 v = 0; v < face.mNumVertices; v++)
{
- LLVector4 vec = LLVector4(face.mVertices[v].mPosition) * mat;
+ LLVector4 vec = LLVector4(face.mPositions+v*4) * mat;
if (drawablep->isActive())
{
diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp
index a82afbeb76..edb97eef24 100644
--- a/indra/newview/llvograss.cpp
+++ b/indra/newview/llvograss.cpp
@@ -640,6 +640,7 @@ BOOL LLVOGrass::lineSegmentIntersect(const LLVector3& start, const LLVector3& en
position.mV[2] += blade_height;
v[3] = v1 = position + mRegionp->getOriginAgent();
+#if 0 //VECTORIZE THIS
F32 a,b,t;
@@ -703,6 +704,7 @@ BOOL LLVOGrass::lineSegmentIntersect(const LLVector3& start, const LLVector3& en
}
}
}
+#endif
}
return ret;
diff --git a/indra/newview/llvotextbubble.cpp b/indra/newview/llvotextbubble.cpp
index 428ef20006..339da3c0bf 100644
--- a/indra/newview/llvotextbubble.cpp
+++ b/indra/newview/llvotextbubble.cpp
@@ -45,6 +45,7 @@
#include "llviewertexturelist.h"
#include "llvolume.h"
#include "pipeline.h"
+#include "llvector4a.h"
#include "llviewerregion.h"
LLVOTextBubble::LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
@@ -217,7 +218,7 @@ void LLVOTextBubble::updateFaceSize(S32 idx)
else
{
const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx);
- face->setSize(vol_face.mVertices.size(), vol_face.mIndices.size());
+ face->setSize(vol_face.mNumVertices, vol_face.mNumIndices);
}
}
@@ -235,19 +236,37 @@ void LLVOTextBubble::getGeometry(S32 idx,
const LLVolumeFace& face = getVolume()->getVolumeFace(idx);
- LLVector3 pos = getPositionAgent();
+ LLVector4a pos;
+ pos.load3(getPositionAgent().mV);
+
+ LLVector4a scale;
+ scale.load3(getScale().mV);
+
LLColor4U color = LLColor4U(getTE(idx)->getColor());
U32 offset = mDrawable->getFace(idx)->getGeomIndex();
- for (U32 i = 0; i < face.mVertices.size(); i++)
+ LLVector4a* dst_pos = (LLVector4a*) verticesp.get();
+ LLVector4a* src_pos = (LLVector4a*) face.mPositions;
+
+ LLVector4a* dst_norm = (LLVector4a*) normalsp.get();
+ LLVector4a* src_norm = (LLVector4a*) face.mNormals;
+
+ LLVector2* dst_tc = (LLVector2*) texcoordsp.get();
+ LLVector2* src_tc = (LLVector2*) face.mTexCoords;
+
+ LLVector4a::memcpyNonAliased16((F32*) dst_norm, (F32*) src_norm, face.mNumVertices*4);
+ LLVector4a::memcpyNonAliased16((F32*) dst_tc, (F32*) src_tc, face.mNumVertices*2);
+
+
+ for (U32 i = 0; i < face.mNumVertices; i++)
{
- *verticesp++ = face.mVertices[i].mPosition.scaledVec(getScale()) + pos;
- *normalsp++ = face.mVertices[i].mNormal;
- *texcoordsp++ = face.mVertices[i].mTexCoord;
+ LLVector4a t;
+ t.setMul(src_pos[i], scale);
+ dst_pos[i].setAdd(t, pos);
*colorsp++ = color;
}
- for (U32 i = 0; i < face.mIndices.size(); i++)
+ for (U32 i = 0; i < face.mNumIndices; i++)
{
*indicesp++ = face.mIndices[i] + offset;
}
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);