aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvectorperfoptions.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llvectorperfoptions.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llvectorperfoptions.cpp')
-rw-r--r--linden/indra/newview/llvectorperfoptions.cpp99
1 files changed, 1 insertions, 98 deletions
diff --git a/linden/indra/newview/llvectorperfoptions.cpp b/linden/indra/newview/llvectorperfoptions.cpp
index b228ed5..bb2ef99 100644
--- a/linden/indra/newview/llvectorperfoptions.cpp
+++ b/linden/indra/newview/llvectorperfoptions.cpp
@@ -31,101 +31,4 @@
31 31
32#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
33 33
34#include "llvectorperfoptions.h" 34// Deprecated - moved into llviewerjointmesh
35#include "llviewerjointmesh.h"
36#include "llviewercontrol.h"
37
38// Initially, we test the performance of the vectorization code, then
39// turn it off if it ends up being slower. JC
40BOOL gVectorizePerfTest = TRUE;
41BOOL gVectorizeEnable = FALSE;
42U32 gVectorizeProcessor = 0;
43BOOL gVectorizeSkin = FALSE;
44
45void update_vector_performances(void)
46{
47 char *vp;
48
49 switch(gVectorizeProcessor)
50 {
51 case 2: vp = "SSE2"; break; // *TODO: replace the magic #s
52 case 1: vp = "SSE"; break;
53 default: vp = "COMPILER DEFAULT"; break;
54 }
55 llinfos << "Vectorization : " << ( gVectorizeEnable ? "ENABLED" : "DISABLED" ) << llendl ;
56 llinfos << "Vector Processor : " << vp << llendl ;
57 llinfos << "Vectorized Skinning : " << ( gVectorizeSkin ? "ENABLED" : "DISABLED" ) << llendl ;
58
59 if(gVectorizeEnable && gVectorizeSkin)
60 {
61 switch(gVectorizeProcessor)
62 {
63 case 2:
64 LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE2;
65 break;
66 case 1:
67 LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE;
68 break;
69 default:
70 LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryVectorized;
71 break;
72 }
73 }
74 else
75 {
76 LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryOriginal;
77 }
78}
79
80
81class LLVectorizationEnableListener: public LLSimpleListener
82{
83 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
84 {
85 gVectorizeEnable = event->getValue().asBoolean();
86 update_vector_performances();
87 return true;
88 }
89};
90static LLVectorizationEnableListener vectorization_enable_listener;
91
92class LLVectorizeSkinListener: public LLSimpleListener
93{
94 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
95 {
96 gVectorizeSkin = event->getValue().asBoolean();
97 update_vector_performances();
98 return true;
99 }
100};
101static LLVectorizeSkinListener vectorize_skin_listener;
102
103class LLVectorProcessorListener: public LLSimpleListener
104{
105 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
106 {
107 gVectorizeProcessor = event->getValue().asInteger();
108 update_vector_performances();
109 return true;
110 }
111};
112static LLVectorProcessorListener vector_processor_listener;
113
114void LLVectorPerformanceOptions::initClass()
115{
116 gVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest");
117 gVectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable");
118 gVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor");
119 gVectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin");
120 update_vector_performances();
121
122 // these are currently static in this file, so they can't move to settings_setup_listeners
123 gSavedSettings.getControl("VectorizeEnable")->addListener(&vectorization_enable_listener);
124 gSavedSettings.getControl("VectorizeProcessor")->addListener(&vector_processor_listener);
125 gSavedSettings.getControl("VectorizeSkin")->addListener(&vectorize_skin_listener);
126}
127
128void LLVectorPerformanceOptions::cleanupClass()
129{
130}
131