From 5d4fb5de048ed3e19105b6c8f038de87eb75f2fb Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 27 May 2015 12:06:45 +0200 Subject: [PATCH 1/5] Make sure NDTARGET_ARCH gets always set in CMakeCache.txt. --- indra/cmake/Variables.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index e6602ad765..007d4588e0 100755 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -9,6 +9,8 @@ # LINUX - Linux # WINDOWS - Windows +set(NDTARGET_ARCH "x86" CACHE STRING "Build 64 or 32 bit viewer. Defaults to 32 bit.") + if( ${NDTARGET_ARCH} STREQUAL "x64" ) set( ND_BUILD64BIT_ARCH ON ) elseif( ${NDTARGET_ARCH} STREQUAL "universal" ) From 586798c8345c02e1fcc9167f5bc213f955e1308d Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 27 May 2015 12:07:29 +0200 Subject: [PATCH 2/5] Cache type for NDTARGET_ARCH --- scripts/configure_firestorm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/configure_firestorm.sh b/scripts/configure_firestorm.sh index 39909fba52..559cbca68e 100755 --- a/scripts/configure_firestorm.sh +++ b/scripts/configure_firestorm.sh @@ -435,7 +435,7 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then fi cmake -G "$TARGET" ../indra $CHANNEL $FMODEX $KDU $LEAPMOTION $OPENSIM $AVX_OPTIMIZATION $PACKAGE $UNATTENDED -DLL_TESTS:BOOL=OFF -DWORD_SIZE:STRING=$WORD_SIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE \ - -DNDTARGET_ARCH="${TARGET_ARCH}" -DROOT_PROJECT_NAME:STRING=Firestorm $LL_ARGS_PASSTHRU | tee $LOG + -DNDTARGET_ARCH:STRING="${TARGET_ARCH}" -DROOT_PROJECT_NAME:STRING=Firestorm $LL_ARGS_PASSTHRU | tee $LOG if [ $PLATFORM == "win32" ] ; then ../indra/tools/vstool/VSTool.exe --solution Firestorm.sln --startup firestorm-bin --workingdir firestorm-bin "..\\..\\indra\\newview" --config $BTYPE From 0bc5bc28132a6b7409f3db23ec46b4a11987b2f4 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 27 May 2015 12:08:02 +0200 Subject: [PATCH 3/5] Install log handler for collada warnings and errors. --- indra/newview/llfloatermodelpreview.cpp | 35 ++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 13779608f4..2671630c8f 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -118,6 +118,38 @@ // #include "nd/ndboolswitch.h" // To toggle LLRender::sGLCoreProfile +// Logging for error and warning messages from colladadom +#include "dae/daeErrorHandler.h" + +class FSdaeErrorHandler: public daeErrorHandler +{ +public: + virtual void handleError( daeString msg ) + { + LL_WARNS( "ColladaDom" ) << msg << LL_ENDL; + } + virtual void handleWarning( daeString msg ) + { + LL_WARNS( "ColladaDom" ) << msg << LL_ENDL; + } +}; + +FSdaeErrorHandler gDaeErrorHandler; +class FSDaeSetErrorHandler +{ +public: + FSDaeSetErrorHandler() + { + daeErrorHandler::setErrorHandler( &gDaeErrorHandler ); + } + ~FSDaeSetErrorHandler() + { + daeErrorHandler::setErrorHandler( NULL ); + } +}; + +// + // Proper matrix array length for fitted mesh #define JOINT_COUNT 52 @@ -417,7 +449,6 @@ mCalculateBtn(NULL) mLastMouseY = 0; mStatusLock = new LLMutex(NULL); mModelPreview = NULL; - mLODMode[LLModel::LOD_HIGH] = 0; for (U32 i = 0; i < LLModel::LOD_HIGH; i++) { @@ -1543,6 +1574,8 @@ bool LLModelLoader::doLoadModel() //first, look for a .slm file of the same name that was modified later //than the .dae + FSDaeSetErrorHandler oErrorHandlerSerror; // Set up colladadom error handler. + if (mTrySLM) { std::string filename = mFilename; From a522e61fd566b39a091c5a380eb0152ef170ca50 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 27 May 2015 13:27:39 +0200 Subject: [PATCH 4/5] Replace loop with SSE2 calls. --- indra/newview/llvovolume.cpp | 44 +++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 82c2b320c2..b828460283 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4303,22 +4303,44 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons LLMatrix4a final_mat; final_mat.clear(); - S32 idx[4]; + // Avoid the 8 floorf by using SSE2. + // Using _mm_cvttps_epi32 (truncate) under the assumption that the index can never be negative. + + // S32 idx[4]; + // + // LLVector4 wght; + // + // F32 scale = 0.f; + // for (U32 k = 0; k < 4; k++) + // { + // F32 w = weight[j][k]; + // + // idx[k] = (S32) floorf(w); + // wght[k] = w - floorf(w); + // scale += wght[k]; + // } + // + // wght *= 1.f/scale; - LLVector4 wght; + LL_ALIGN_16( S32 idx[4] ); + LL_ALIGN_16( F32 wght[4] ); - F32 scale = 0.f; - for (U32 k = 0; k < 4; k++) - { - F32 w = weight[j][k]; + __m128i _mIdx = _mm_cvttps_epi32( weight[j] ); + __m128 _mWeight = _mm_sub_ps( weight[j], _mm_cvtepi32_ps( _mIdx ) ); - idx[k] = (S32) floorf(w); - wght[k] = w - floorf(w); - scale += wght[k]; - } + _mm_store_si128( (__m128i*)idx, _mIdx ); - wght *= 1.f/scale; + __m128 _mScale = _mm_add_ps( _mWeight, _mm_movehl_ps( _mWeight, _mWeight )); + _mScale = _mm_add_ss( _mScale, _mm_shuffle_ps( _mScale, _mScale, 1) ); + _mScale = _mm_shuffle_ps( _mScale, _mScale, 0 ); + _mWeight = _mm_div_ps( _mWeight, _mScale ); + + _mm_store_ps( wght, _mWeight ); + + // + + for (U32 k = 0; k < 4; k++) { F32 w = wght[k]; From de14868012ca11304737d4083298413be48f0e8e Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 29 May 2015 09:42:52 +0200 Subject: [PATCH 5/5] Small cleanup --- indra/newview/llagentcamera.cpp | 9 ++-- indra/newview/llinventoryfunctions.cpp | 7 ++- indra/newview/llvoavatar.cpp | 64 +++++++++++++++++--------- 3 files changed, 50 insertions(+), 30 deletions(-) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index c89ec265bd..216aa4c1ec 100755 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2141,7 +2141,8 @@ void LLAgentCamera::changeCameraToMouselook(BOOL animate) updateLastCamera(); mCameraMode = CAMERA_MODE_MOUSELOOK; - AOEngine::getInstance()->inMouselook(TRUE); // ## Zi: Animation Overrider + // Animation Overrider + AOEngine::getInstance()->inMouselook(TRUE); const U32 old_flags = gAgent.getControlFlags(); gAgent.setControlFlags(AGENT_CONTROL_MOUSELOOK); if (old_flags != gAgent.getControlFlags()) @@ -2208,7 +2209,8 @@ void LLAgentCamera::changeCameraToFollow(BOOL animate) updateLastCamera(); mCameraMode = CAMERA_MODE_FOLLOW; - AOEngine::getInstance()->inMouselook(FALSE); // ## Zi: Animation Overrider + // Animation Overrider + AOEngine::getInstance()->inMouselook(FALSE); // bang-in the current focus, position, and up vector of the follow cam mFollowCam.reset(mCameraPositionAgent, LLViewerCamera::getInstance()->getPointOfInterest(), LLVector3::z_axis); @@ -2287,7 +2289,8 @@ void LLAgentCamera::changeCameraToThirdPerson(BOOL animate) } updateLastCamera(); mCameraMode = CAMERA_MODE_THIRD_PERSON; - AOEngine::getInstance()->inMouselook(FALSE); // ## Zi: Animation Overrider + // Animation Overrider + AOEngine::getInstance()->inMouselook(FALSE); gAgent.clearControlFlags(AGENT_CONTROL_MOUSELOOK); } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 32a1ecbd24..dbcde49897 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -91,10 +91,9 @@ #include -#include "aoengine.h" // ## Zi: Animation Overrider -//-TT Client LSL Bridge -#include "fslslbridge.h" -//-TT +// Firestorm includes +#include "aoengine.h" +#include "fslslbridge.h" BOOL LLInventoryState::sWearNewClothing = FALSE; LLUUID LLInventoryState::sWearNewClothingTransactionID; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 64f254ef90..ef6d0eef53 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -122,8 +122,8 @@ extern F32 SPEED_ADJUST_MAX_SEC; extern F32 ANIM_SPEED_MAX; extern F32 ANIM_SPEED_MIN; extern U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG; -const F32 MAX_HOVER_Z = 2.0; -const F32 MIN_HOVER_Z = -2.0; +const F32 MAX_HOVER_Z = 2.0f; +const F32 MIN_HOVER_Z = -2.0f; // #define OUTPUT_BREAST_DATA @@ -2619,7 +2619,8 @@ void LLVOAvatar::idleUpdateLoadingEffect() mFirstFullyVisible = FALSE; LLAppearanceMgr::instance().onFirstFullyVisible(); - AOEngine::instance().onLoginComplete(); // ## Zi: Animation Overrider + // Animation Overrider + AOEngine::instance().onLoginComplete(); } if (isFullyLoaded() && mFirstFullyVisible && !isSelf()) { @@ -3459,12 +3460,15 @@ void LLVOAvatar::idleUpdateBelowWater() F32 water_height; water_height = getRegion()->getWaterHeight(); - BOOL wasBelowWater = mBelowWater; // ## Zi: Animation Overrider + // Animation Overrider + BOOL wasBelowWater = mBelowWater; mBelowWater = avatar_height < water_height; - // ## Zi: Animation Overrider - if (isSelf() && wasBelowWater!=mBelowWater) + // Animation Overrider + if (isSelf() && wasBelowWater != mBelowWater) + { AOEngine::instance().checkBelowWater(mBelowWater); - // ## Zi: Animation Overrider + } + // Animation Overrider } void LLVOAvatar::slamPosition() @@ -5497,19 +5501,26 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) { LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; - // ## Zi: Animation Overrider + // Animation Overrider + //LLUUID remap_id = remapMotionID(id); LLUUID remap_id; - if(isSelf()) + if (isSelf()) { - remap_id=AOEngine::getInstance()->override(id,TRUE); - if(remap_id.isNull()) - remap_id=remapMotionID(id); + remap_id = AOEngine::getInstance()->override(id, TRUE); + if (remap_id.isNull()) + { + remap_id = remapMotionID(id); + } else - gAgent.sendAnimationRequest(remap_id,ANIM_REQUEST_START); + { + gAgent.sendAnimationRequest(remap_id, ANIM_REQUEST_START); + } } else - remap_id=remapMotionID(id); - // ## Zi: Animation Overrider + { + remap_id = remapMotionID(id); + } + // Animation Overrider if (remap_id != id) { @@ -5531,19 +5542,26 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) { LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; - // ## Zi: Animation Overrider + // Animation Overrider + //LLUUID remap_id = remapMotionID(id); LLUUID remap_id; - if(isSelf()) + if (isSelf()) { - remap_id=AOEngine::getInstance()->override(id,FALSE); - if(remap_id.isNull()) - remap_id=remapMotionID(id); + remap_id = AOEngine::getInstance()->override(id, FALSE); + if (remap_id.isNull()) + { + remap_id = remapMotionID(id); + } else - gAgent.sendAnimationRequest(remap_id,ANIM_REQUEST_STOP); + { + gAgent.sendAnimationRequest(remap_id, ANIM_REQUEST_STOP); + } } else - remap_id=remapMotionID(id); - // ## Zi: Animation Overrider + { + remap_id = remapMotionID(id); + } + // Animation Overrider if (remap_id != id) {