diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewerjointmesh.cpp | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/linden/indra/newview/llviewerjointmesh.cpp b/linden/indra/newview/llviewerjointmesh.cpp index 5c73319..b87d564 100644 --- a/linden/indra/newview/llviewerjointmesh.cpp +++ b/linden/indra/newview/llviewerjointmesh.cpp | |||
@@ -866,13 +866,53 @@ static F64 sUpdateGeometryRunAvgOn[10]; | |||
866 | static U32 sUpdateGeometryRunCount = 0 ; | 866 | static U32 sUpdateGeometryRunCount = 0 ; |
867 | static U32 sUpdateGeometryCalls = 0 ; | 867 | static U32 sUpdateGeometryCalls = 0 ; |
868 | static U32 sUpdateGeometryLastProcessor = 0 ; | 868 | static U32 sUpdateGeometryLastProcessor = 0 ; |
869 | static BOOL sVectorizePerfTest = FALSE; | ||
870 | static U32 sVectorizeProcessor = 0; | ||
871 | |||
872 | //static | ||
869 | void (*LLViewerJointMesh::sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh); | 873 | void (*LLViewerJointMesh::sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh); |
870 | 874 | ||
871 | void LLViewerJointMesh::updateGeometry() | 875 | //static |
876 | void LLViewerJointMesh::updateVectorize() | ||
872 | { | 877 | { |
873 | extern BOOL gVectorizePerfTest; | 878 | sVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest"); |
874 | extern U32 gVectorizeProcessor; | 879 | sVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor"); |
880 | BOOL vectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable"); | ||
881 | BOOL vectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin"); | ||
875 | 882 | ||
883 | std::string vp; | ||
884 | switch(sVectorizeProcessor) | ||
885 | { | ||
886 | case 2: vp = "SSE2"; break; // *TODO: replace the magic #s | ||
887 | case 1: vp = "SSE"; break; | ||
888 | default: vp = "COMPILER DEFAULT"; break; | ||
889 | } | ||
890 | llinfos << "Vectorization : " << ( vectorizeEnable ? "ENABLED" : "DISABLED" ) << llendl ; | ||
891 | llinfos << "Vector Processor : " << vp << llendl ; | ||
892 | llinfos << "Vectorized Skinning : " << ( vectorizeSkin ? "ENABLED" : "DISABLED" ) << llendl ; | ||
893 | if(vectorizeEnable && vectorizeSkin) | ||
894 | { | ||
895 | switch(sVectorizeProcessor) | ||
896 | { | ||
897 | case 2: | ||
898 | sUpdateGeometryFunc = &updateGeometrySSE2; | ||
899 | break; | ||
900 | case 1: | ||
901 | sUpdateGeometryFunc = &updateGeometrySSE; | ||
902 | break; | ||
903 | default: | ||
904 | sUpdateGeometryFunc = &updateGeometryVectorized; | ||
905 | break; | ||
906 | } | ||
907 | } | ||
908 | else | ||
909 | { | ||
910 | sUpdateGeometryFunc = &updateGeometryOriginal; | ||
911 | } | ||
912 | } | ||
913 | |||
914 | void LLViewerJointMesh::updateGeometry() | ||
915 | { | ||
876 | if (!(mValid | 916 | if (!(mValid |
877 | && mMesh | 917 | && mMesh |
878 | && mFace | 918 | && mFace |
@@ -883,7 +923,7 @@ void LLViewerJointMesh::updateGeometry() | |||
883 | return; | 923 | return; |
884 | } | 924 | } |
885 | 925 | ||
886 | if (!gVectorizePerfTest) | 926 | if (!sVectorizePerfTest) |
887 | { | 927 | { |
888 | // Once we've measured performance, just run the specified | 928 | // Once we've measured performance, just run the specified |
889 | // code version. | 929 | // code version. |
@@ -916,13 +956,13 @@ void LLViewerJointMesh::updateGeometry() | |||
916 | { | 956 | { |
917 | F64 time_since_app_start = ug_timer.getElapsedSeconds(); | 957 | F64 time_since_app_start = ug_timer.getElapsedSeconds(); |
918 | if(sUpdateGeometryGlobalTime == 0.0 | 958 | if(sUpdateGeometryGlobalTime == 0.0 |
919 | || sUpdateGeometryLastProcessor != gVectorizeProcessor) | 959 | || sUpdateGeometryLastProcessor != sVectorizeProcessor) |
920 | { | 960 | { |
921 | sUpdateGeometryGlobalTime = time_since_app_start; | 961 | sUpdateGeometryGlobalTime = time_since_app_start; |
922 | sUpdateGeometryElapsedTime = 0; | 962 | sUpdateGeometryElapsedTime = 0; |
923 | sUpdateGeometryCalls = 0; | 963 | sUpdateGeometryCalls = 0; |
924 | sUpdateGeometryRunCount = 0; | 964 | sUpdateGeometryRunCount = 0; |
925 | sUpdateGeometryLastProcessor = gVectorizeProcessor; | 965 | sUpdateGeometryLastProcessor = sVectorizeProcessor; |
926 | sUpdateGeometryCallPointer = false; | 966 | sUpdateGeometryCallPointer = false; |
927 | return; | 967 | return; |
928 | } | 968 | } |
@@ -969,7 +1009,7 @@ void LLViewerJointMesh::updateGeometry() | |||
969 | F64 perf_boost = ( sUpdateGeometryElapsedTimeOff - sUpdateGeometryElapsedTimeOn ) / sUpdateGeometryElapsedTimeOn; | 1009 | F64 perf_boost = ( sUpdateGeometryElapsedTimeOff - sUpdateGeometryElapsedTimeOn ) / sUpdateGeometryElapsedTimeOn; |
970 | llinfos << "run averages (" << (F64)sUpdateGeometryRunCount | 1010 | llinfos << "run averages (" << (F64)sUpdateGeometryRunCount |
971 | << "/10) vectorize off " << a | 1011 | << "/10) vectorize off " << a |
972 | << "% : vectorize type " << gVectorizeProcessor | 1012 | << "% : vectorize type " << sVectorizeProcessor |
973 | << " " << b | 1013 | << " " << b |
974 | << "% : performance boost " | 1014 | << "% : performance boost " |
975 | << perf_boost * 100.0 | 1015 | << perf_boost * 100.0 |
@@ -983,7 +1023,6 @@ void LLViewerJointMesh::updateGeometry() | |||
983 | 1023 | ||
984 | // We have data now on which version is faster. Switch to that | 1024 | // We have data now on which version is faster. Switch to that |
985 | // code and save the data for next run. | 1025 | // code and save the data for next run. |
986 | gVectorizePerfTest = FALSE; | ||
987 | gSavedSettings.setBOOL("VectorizePerfTest", FALSE); | 1026 | gSavedSettings.setBOOL("VectorizePerfTest", FALSE); |
988 | 1027 | ||
989 | if (perf_boost > 0.0) | 1028 | if (perf_boost > 0.0) |