summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerjointmesh.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-03-15 01:18:27 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-03-15 01:18:27 +0000
commit672a76d0ea08a0d0fc824e103ee4c4242b7e03ec (patch)
treeb623a9c884383ad75ed755b2c373db2b90643671 /indra/newview/llviewerjointmesh.cpp
parent04611efae8a3291ceba8a29dd920bdae0d404830 (diff)
reverting premature commit at 82410.
Diffstat (limited to 'indra/newview/llviewerjointmesh.cpp')
-rw-r--r--indra/newview/llviewerjointmesh.cpp55
1 files changed, 8 insertions, 47 deletions
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index fe00c25c63..2677b33af8 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -866,53 +866,13 @@ static F64 sUpdateGeometryRunAvgOn[10];
static U32 sUpdateGeometryRunCount = 0 ;
static U32 sUpdateGeometryCalls = 0 ;
static U32 sUpdateGeometryLastProcessor = 0 ;
-static BOOL sVectorizePerfTest = FALSE;
-static U32 sVectorizeProcessor = 0;
-
-//static
void (*LLViewerJointMesh::sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh);
-//static
-void LLViewerJointMesh::updateVectorize()
-{
- sVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest");
- sVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor");
- BOOL vectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable");
- BOOL vectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin");
-
- std::string vp;
- switch(sVectorizeProcessor)
- {
- case 2: vp = "SSE2"; break; // *TODO: replace the magic #s
- case 1: vp = "SSE"; break;
- default: vp = "COMPILER DEFAULT"; break;
- }
- llinfos << "Vectorization : " << ( vectorizeEnable ? "ENABLED" : "DISABLED" ) << llendl ;
- llinfos << "Vector Processor : " << vp << llendl ;
- llinfos << "Vectorized Skinning : " << ( vectorizeSkin ? "ENABLED" : "DISABLED" ) << llendl ;
- if(vectorizeEnable && vectorizeSkin)
- {
- switch(sVectorizeProcessor)
- {
- case 2:
- sUpdateGeometryFunc = &updateGeometrySSE2;
- break;
- case 1:
- sUpdateGeometryFunc = &updateGeometrySSE;
- break;
- default:
- sUpdateGeometryFunc = &updateGeometryVectorized;
- break;
- }
- }
- else
- {
- sUpdateGeometryFunc = &updateGeometryOriginal;
- }
-}
-
void LLViewerJointMesh::updateGeometry()
{
+ extern BOOL gVectorizePerfTest;
+ extern U32 gVectorizeProcessor;
+
if (!(mValid
&& mMesh
&& mFace
@@ -923,7 +883,7 @@ void LLViewerJointMesh::updateGeometry()
return;
}
- if (!sVectorizePerfTest)
+ if (!gVectorizePerfTest)
{
// Once we've measured performance, just run the specified
// code version.
@@ -956,13 +916,13 @@ void LLViewerJointMesh::updateGeometry()
{
F64 time_since_app_start = ug_timer.getElapsedSeconds();
if(sUpdateGeometryGlobalTime == 0.0
- || sUpdateGeometryLastProcessor != sVectorizeProcessor)
+ || sUpdateGeometryLastProcessor != gVectorizeProcessor)
{
sUpdateGeometryGlobalTime = time_since_app_start;
sUpdateGeometryElapsedTime = 0;
sUpdateGeometryCalls = 0;
sUpdateGeometryRunCount = 0;
- sUpdateGeometryLastProcessor = sVectorizeProcessor;
+ sUpdateGeometryLastProcessor = gVectorizeProcessor;
sUpdateGeometryCallPointer = false;
return;
}
@@ -1009,7 +969,7 @@ void LLViewerJointMesh::updateGeometry()
F64 perf_boost = ( sUpdateGeometryElapsedTimeOff - sUpdateGeometryElapsedTimeOn ) / sUpdateGeometryElapsedTimeOn;
llinfos << "run averages (" << (F64)sUpdateGeometryRunCount
<< "/10) vectorize off " << a
- << "% : vectorize type " << sVectorizeProcessor
+ << "% : vectorize type " << gVectorizeProcessor
<< " " << b
<< "% : performance boost "
<< perf_boost * 100.0
@@ -1023,6 +983,7 @@ void LLViewerJointMesh::updateGeometry()
// We have data now on which version is faster. Switch to that
// code and save the data for next run.
+ gVectorizePerfTest = FALSE;
gSavedSettings.setBOOL("VectorizePerfTest", FALSE);
if (perf_boost > 0.0)