summaryrefslogtreecommitdiff
path: root/indra/newview/llface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r--indra/newview/llface.cpp54
1 files changed, 45 insertions, 9 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 965ac1cad0..0a9976f511 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -184,22 +184,33 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
mUsingAtlas = FALSE ;
}
+static LLFastTimer::DeclareTimer FTM_DESTROY_FACE("Destroy Face");
+static LLFastTimer::DeclareTimer FTM_DESTROY_TEXTURE("Texture");
+static LLFastTimer::DeclareTimer FTM_DESTROY_DRAWPOOL("Drawpool");
+static LLFastTimer::DeclareTimer FTM_DESTROY_TEXTURE_MATRIX("Texture Matrix");
+static LLFastTimer::DeclareTimer FTM_DESTROY_DRAW_INFO("Draw Info");
+static LLFastTimer::DeclareTimer FTM_DESTROY_ATLAS("Atlas");
+static LLFastTimer::DeclareTimer FTM_FACE_DEREF("Deref");
void LLFace::destroy()
{
+ LLFastTimer t(FTM_DESTROY_FACE);
if(mTexture.notNull())
{
+ LLFastTimer t(FTM_DESTROY_TEXTURE);
mTexture->removeFace(this) ;
}
if (mDrawPoolp)
{
+ LLFastTimer t(FTM_DESTROY_DRAWPOOL);
mDrawPoolp->removeFace(this);
mDrawPoolp = NULL;
}
if (mTextureMatrix)
{
+ LLFastTimer t(FTM_DESTROY_TEXTURE_MATRIX);
delete mTextureMatrix;
mTextureMatrix = NULL;
@@ -214,11 +225,21 @@ void LLFace::destroy()
}
}
- setDrawInfo(NULL);
+ {
+ LLFastTimer t(FTM_DESTROY_DRAW_INFO);
+ setDrawInfo(NULL);
+ }
+
+ {
+ LLFastTimer t(FTM_DESTROY_ATLAS);
+ removeAtlas();
+ }
- removeAtlas();
- mDrawablep = NULL;
- mVObjp = NULL;
+ {
+ LLFastTimer t(FTM_FACE_DEREF);
+ mDrawablep = NULL;
+ mVObjp = NULL;
+ }
}
@@ -868,7 +889,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
llpushcallstacks ;
const LLVolumeFace &vf = volume.getVolumeFace(f);
S32 num_vertices = (S32)vf.mVertices.size();
- S32 num_indices = (S32)vf.mIndices.size();
+ S32 num_indices = LLPipeline::sUseTriStrips ? (S32)vf.mTriStrip.size() : (S32) vf.mIndices.size();
if (mVertexBuffer.notNull())
{
@@ -1058,9 +1079,19 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (full_rebuild)
{
mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex);
- for (U16 i = 0; i < num_indices; i++)
+ if (LLPipeline::sUseTriStrips)
+ {
+ for (U16 i = 0; i < num_indices; i++)
+ {
+ *indicesp++ = vf.mTriStrip[i] + index_offset;
+ }
+ }
+ else
{
- *indicesp++ = vf.mIndices[i] + index_offset;
+ for (U16 i = 0; i < num_indices; i++)
+ {
+ *indicesp++ = vf.mIndices[i] + index_offset;
+ }
}
}
@@ -1572,8 +1603,13 @@ S32 LLFace::pushVertices(const U16* index_array) const
{
if (mIndicesCount)
{
- mVertexBuffer->drawRange(LLRender::TRIANGLES, mGeomIndex, mGeomIndex+mGeomCount-1, mIndicesCount, mIndicesIndex);
- gPipeline.addTrianglesDrawn(mIndicesCount/3);
+ U32 render_type = LLRender::TRIANGLES;
+ if (mDrawInfo)
+ {
+ render_type = mDrawInfo->mDrawMode;
+ }
+ mVertexBuffer->drawRange(render_type, mGeomIndex, mGeomIndex+mGeomCount-1, mIndicesCount, mIndicesIndex);
+ gPipeline.addTrianglesDrawn(mIndicesCount, render_type);
}
return mIndicesCount;