From 054e8fbde325c03bc8f9a7c10aa8bb9319d501ba Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 26 Aug 2010 16:52:32 -0400 Subject: buildfix: fixing linux build to handle new SSE2 architecture code reviewed by davep and falcon --- indra/cmake/00-Common.cmake | 6 ++---- indra/llmath/lloctree.h | 2 +- indra/llmath/llvector4a.h | 3 ++- indra/llmath/tests/llquaternion_test.cpp | 2 +- indra/llmath/tests/v3dmath_test.cpp | 2 +- indra/llmath/tests/v3math_test.cpp | 4 ++-- indra/llmath/tests/v4math_test.cpp | 2 +- indra/newview/llfloatermodelpreview.cpp | 8 ++++---- 8 files changed, 14 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 8262462ced..20573c9495 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -144,6 +144,8 @@ if (LINUX) -fno-strict-aliasing -fsigned-char -g + -msse2 + -mfpmath=sse -pthread ) @@ -163,10 +165,6 @@ if (LINUX) link_directories(/usr/lib/mysql4/mysql) endif (EXISTS /usr/lib/mysql4/mysql) - add_definitions( - -msse2 - -mfpmath=sse - ) endif (SERVER) if (VIEWER) diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 432e9fbcd8..73910ef98d 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -206,7 +206,7 @@ public: { const LLVector4a& pos = data->getPositionGroup(); - LLVector4a gt = pos.greaterThan(center); + LLVector4Logical gt = pos.greaterThan(center); LLVector4a up; up = _mm_and_ps(size, gt); diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index 76a3e999ce..a80e9b49dd 100644 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -153,7 +153,6 @@ public: // Prefer this method for read-only access to a single element. Prefer the templated version if the elem is known at compile time. template LL_FORCE_INLINE LLSimdScalar getScalarAt() const; - template <> LL_FORCE_INLINE LLSimdScalar getScalarAt<0>() const; // Set to an x, y, z and optional w provided inline void set(F32 x, F32 y, F32 z, F32 w = 0.f); @@ -322,6 +321,8 @@ private: LLQuad mQ; }; +template <> LL_FORCE_INLINE LLSimdScalar LLVector4a::getScalarAt<0>() const; + inline void update_min_max(LLVector4a& min, LLVector4a& max, const LLVector4a& p) { min.setMin(min, p); diff --git a/indra/llmath/tests/llquaternion_test.cpp b/indra/llmath/tests/llquaternion_test.cpp index 2d27d1eb32..451b0ecc60 100644 --- a/indra/llmath/tests/llquaternion_test.cpp +++ b/indra/llmath/tests/llquaternion_test.cpp @@ -35,12 +35,12 @@ #include "linden_common.h" #include "../test/lltut.h" -#include "../llquaternion.h" #include "../v4math.h" #include "../v3math.h" #include "../v3dmath.h" #include "../m4math.h" #include "../m3math.h" +#include "../llquaternion.h" namespace tut { diff --git a/indra/llmath/tests/v3dmath_test.cpp b/indra/llmath/tests/v3dmath_test.cpp index 894b6200f5..734b8f8b80 100644 --- a/indra/llmath/tests/v3dmath_test.cpp +++ b/indra/llmath/tests/v3dmath_test.cpp @@ -36,11 +36,11 @@ #include "llsd.h" #include "../test/lltut.h" -#include "../llquaternion.h" #include "../m3math.h" #include "../v4math.h" #include "../v3dmath.h" #include "../v3dmath.h" +#include "../llquaternion.h" namespace tut { diff --git a/indra/llmath/tests/v3math_test.cpp b/indra/llmath/tests/v3math_test.cpp index d5c8dd2f9c..e6354c2b86 100644 --- a/indra/llmath/tests/v3math_test.cpp +++ b/indra/llmath/tests/v3math_test.cpp @@ -36,12 +36,12 @@ #include "../test/lltut.h" #include "llsd.h" -#include "../llquaternion.h" -#include "../llquantize.h" #include "../v3dmath.h" #include "../m3math.h" #include "../v4math.h" #include "../v3math.h" +#include "../llquaternion.h" +#include "../llquantize.h" namespace tut diff --git a/indra/llmath/tests/v4math_test.cpp b/indra/llmath/tests/v4math_test.cpp index e919c90efa..61fc108488 100644 --- a/indra/llmath/tests/v4math_test.cpp +++ b/indra/llmath/tests/v4math_test.cpp @@ -36,9 +36,9 @@ #include "../test/lltut.h" #include "llsd.h" -#include "../llquaternion.h" #include "../m4math.h" #include "../v4math.h" +#include "../llquaternion.h" namespace tut { diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 5dd983d818..91dfb9fc1c 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -2656,8 +2656,8 @@ void LLModelPreview::updateStatusMessages() const F32 ratio = 0.5f; const S32 required_verts = 128; - F32 scaler = powf(0.5f, lod_high-lod); - S32 max_verts = verts[lod_high][i]*scaler; + F32 scaler = powf(ratio, lod_high-lod); + S32 max_verts = (S32)(verts[lod_high][i]*scaler); if (max_verts > required_verts) { //some model in this slot might have more than 128 vertices @@ -2691,8 +2691,8 @@ void LLModelPreview::updateStatusMessages() { const F32 ratio = 0.5f; - F32 scaler = powf(0.5f, lod_high-lod); - S32 max_verts = verts[lod_high][i]*scaler; + F32 scaler = powf(ratio, lod_high-lod); + S32 max_verts = (S32)(verts[lod_high][i]*scaler); if (verts[lod][i] > max_verts) { -- cgit v1.2.3 From 0d305552003d8378f692cddf87caebb7c47d8ab3 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 26 Aug 2010 16:57:24 -0400 Subject: buildfix removing unnecessary line in llvector4a.h upon further review, falcon determined this fix was unnecessary. --- indra/llmath/llvector4a.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra') diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index a80e9b49dd..1e0b3bc854 100644 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -321,8 +321,6 @@ private: LLQuad mQ; }; -template <> LL_FORCE_INLINE LLSimdScalar LLVector4a::getScalarAt<0>() const; - inline void update_min_max(LLVector4a& min, LLVector4a& max, const LLVector4a& p) { min.setMin(min, p); -- cgit v1.2.3 From 1eeeada0f7c20f190032daa651f884a4a1525df1 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 26 Aug 2010 18:09:17 -0400 Subject: buildfix - replaced NULL with FALSE gcc doesn't like passing NULL where you mean FALSE. This unsticks the linux build. de-minimis change, no review. --- indra/newview/llfloatermodelpreview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 91dfb9fc1c..a283be7aa7 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1703,7 +1703,7 @@ LLImportMaterial LLModelLoader::profileToMaterial(domProfile_COMMON* material) std::string filename = cdom::uriToNativePath(init->getValue().str()); mat.mDiffuseMap = LLViewerTextureManager::getFetchedTextureFromUrl("file://" + filename, TRUE, LLViewerTexture::BOOST_PREVIEW); - mat.mDiffuseMap->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, this->mPreview, NULL, NULL); + mat.mDiffuseMap->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, this->mPreview, NULL, FALSE); mat.mDiffuseMap->forceToSaveRawImage(); mat.mDiffuseMapFilename = filename; -- cgit v1.2.3