-Screwed around with SSE2.

-Added ReleaseSSE2 as a build target.
-LL_VECTORIZE is silly and breaks things...
-Small little tweaks.

I have not tested if the cmake alterations work under linux and darwin. Hollar if broken.
This commit is contained in:
unknown
2010-10-02 02:13:17 -05:00
parent 3e8a7172db
commit b2bd45eed8
22 changed files with 207 additions and 103 deletions

View File

@@ -467,39 +467,32 @@ static void settings_modify()
gDebugGL = gSavedSettings.getBOOL("RenderDebugGL");
gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline");
gAuditTexture = gSavedSettings.getBOOL("AuditTexture");
#if LL_VECTORIZE
if (gSysCPU.hasAltivec())
if (gSysCPU.hasAltivec()) //for mac. No intrinsics used. No real risk of breaking compat.
{
gSavedSettings.setBOOL("VectorizeEnable", TRUE );
gSavedSettings.setU32("VectorizeProcessor", 0 );
}
else
if (gSysCPU.hasSSE2())
//Slightly confusing, but with linux llviewerjointmesh_sse(2) are compiled with relevent sse flags set.
//However, on windows or mac said files are only compiled with sse(2) if the entire project is.
else if (gSysCPU.hasSSE2() && LLViewerJointMesh::supportsSSE2())
{
gSavedSettings.setBOOL("VectorizeEnable", TRUE );
gSavedSettings.setU32("VectorizeProcessor", 2 );
}
else
if (gSysCPU.hasSSE())
else if (gSysCPU.hasSSE() && LLViewerJointMesh::supportsSSE())
{
gSavedSettings.setBOOL("VectorizeEnable", TRUE );
gSavedSettings.setU32("VectorizeProcessor", 1 );
}
else
else // This build target doesn't support SSE, don't test/run.
{
// Don't bother testing or running if CPU doesn't support it. JC
gSavedSettings.setBOOL("VectorizePerfTest", FALSE );
gSavedSettings.setBOOL("VectorizeEnable", FALSE );
gSavedSettings.setU32("VectorizeProcessor", 0 );
gSavedSettings.setBOOL("VectorizeSkin", FALSE);
}
#else
// This build target doesn't support SSE, don't test/run.
gSavedSettings.setBOOL("VectorizePerfTest", FALSE );
gSavedSettings.setBOOL("VectorizeEnable", FALSE );
gSavedSettings.setU32("VectorizeProcessor", 0 );
gSavedSettings.setBOOL("VectorizeSkin", FALSE);
#endif
}
void LLAppViewer::initGridChoice()

View File

@@ -219,6 +219,18 @@ LLFloaterAbout::LLFloaterAbout()
support.append( (const char*) glGetString(GL_VERSION) );
support.append("\n");
std::string sse_ver = "None";
#if _M_IX86_FP > 0 //Windows
sse_ver = llformat("SSE%i", _M_IX86_FP );
#elif defined(__SSE2__) //GCC
sse_ver = "SSE2";
#elif defined(__SSE__) //GCC
sse_ver = "SSE";
#endif
support.append("SSE Version: ");
support.append(sse_ver);
support.append("\n");
support.append("\n");
support.append("libcurl Version: ");

View File

@@ -677,6 +677,8 @@ void LLViewerParcelMgr::renderParcel(LLParcel* parcel )
// coordinates correctly.
void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 height, U8 direction, LLViewerRegion* regionp)
{
if(!regionp) //This has been null before. Oh no!
return;
// HACK: At edge of last region of world, we need to make sure the region
// resolves correctly so we can get a height value.
const F32 BORDER = REGION_WIDTH_METERS - 0.1f;
@@ -692,11 +694,8 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei
if (clamped_y2 > BORDER) clamped_y2 = BORDER;
F32 z;
F32 z1;
F32 z2;
z1 = regionp->getLand().resolveHeightRegion( LLVector3( clamped_x1, clamped_y1, 0.f ) );
z2 = regionp->getLand().resolveHeightRegion( LLVector3( clamped_x2, clamped_y2, 0.f ) );
F32 z1 = regionp->getLand().resolveHeightRegion( LLVector3( clamped_x1, clamped_y1, 0.f ) );;
F32 z2 = regionp->getLand().resolveHeightRegion( LLVector3( clamped_x2, clamped_y2, 0.f ) );;
// Convert x1 and x2 from region-local to agent coords.
LLVector3 origin = regionp->getOriginAgent();

View File

@@ -865,12 +865,18 @@ void LLViewerJointMesh::updateVectorize()
{
case 2:
sUpdateGeometryFunc = &updateGeometrySSE2;
if(!supportsSSE2())
LL_INFOS("AppInit") << "VectorizeProcessor set to unsupported implementation! (SSE2)" << LL_ENDL ;
break;
case 1:
sUpdateGeometryFunc = &updateGeometrySSE;
if(!supportsSSE())
LL_INFOS("AppInit") << "VectorizeProcessor set to unsupported implementation! (SSE)" << LL_ENDL ;
break;
default:
sUpdateGeometryFunc = &updateGeometryVectorized;
if(!gSysCPU.hasAltivec())
LL_INFOS("AppInit") << "VectorizeProcessor set to unsupported implementation! (Altivec)" << LL_ENDL ;
break;
}
}

View File

@@ -152,6 +152,8 @@ public:
static void updateVectorize(); // Update globals when settings variables change
static bool supportsSSE();
static bool supportsSSE2();
private:
// Avatar vertex skinning is a significant performance issue on computers
// with avatar vertex programs turned off (for example, most Macs). We

View File

@@ -109,6 +109,10 @@ void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh)
buffer->setBuffer(0);
}
bool LLViewerJointMesh::supportsSSE()
{
return true;
}
#else
@@ -116,5 +120,10 @@ void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh)
{
LLViewerJointMesh::updateGeometryVectorized(face, mesh);
}
bool LLViewerJointMesh::supportsSSE()
{
return false;
}
#endif

View File

@@ -59,7 +59,7 @@
#include "v3math.h"
#if LL_VECTORIZE
#if LL_VECTORIZE && (_M_IX86_FP > 1 || defined(__SSE2__) ) //These intrinsics are only valid with sse2 or higher.
inline void matrix_translate(LLV4Matrix4& m, const LLMatrix4* w, const LLVector3& j)
@@ -116,6 +116,10 @@ void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh)
//setBuffer(0) called in LLVOAvatar::renderSkinned
}
bool LLViewerJointMesh::supportsSSE2()
{
return true;
}
#else
@@ -123,5 +127,9 @@ void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh)
{
LLViewerJointMesh::updateGeometryVectorized(face, mesh);
}
bool LLViewerJointMesh::supportsSSE2()
{
return false;
}
#endif

View File

@@ -176,7 +176,7 @@ class WindowsManifest(ViewerManifest):
super(WindowsManifest, self).construct()
# the final exe is complicated because we're not sure where it's coming from,
# nor do we have a fixed name for the executable
self.path(self.find_existing_file('debug/Ascent.exe', 'release/Ascent.exe', 'relwithdebinfo/Ascent.exe'), dst=self.final_exe())
self.path(self.find_existing_file('debug/Ascent.exe', 'release/Ascent.exe', 'releaseSSE2/Ascent.exe', 'relwithdebinfo/Ascent.exe'), dst=self.final_exe())
# Plugin host application
self.path(os.path.join(os.pardir,
@@ -270,11 +270,13 @@ class WindowsManifest(ViewerManifest):
self.path(src=self.find_existing_file( # tag:"crash-logger" here as a cue to the exporter
"../win_crash_logger/debug/windows-crash-logger.exe",
"../win_crash_logger/release/windows-crash-logger.exe",
"../win_crash_logger/releaseSSE2/windows-crash-logger.exe",
"../win_crash_logger/relwithdebinfo/windows-crash-logger.exe"),
dst="win_crash_logger.exe")
self.path(src=self.find_existing_file(
"../win_updater/debug/windows-updater.exe",
"../win_updater/release/windows-updater.exe",
"../win_updater/releaseSSE2/windows-updater.exe",
"../win_updater/relwithdebinfo/windows-updater.exe"),
dst="updater.exe")