diff --git a/.github/workflows/build_viewer.yml b/.github/workflows/build_viewer.yml index f6baff2a46..45d6a297e7 100644 --- a/.github/workflows/build_viewer.yml +++ b/.github/workflows/build_viewer.yml @@ -31,7 +31,7 @@ jobs: build_matrix: strategy: matrix: - os: [macos-12,ubuntu-22.04,windows-2022] + os: [macos-14,ubuntu-22.04,windows-2022] grid: [sl,os] variant: [regular, avx] runs-on: ${{ matrix.os }} diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index 82daaf748b..38dab42d40 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -1074,6 +1074,14 @@ void LLDir::setSkinFolder(const std::string &skin_folder, const std::string& the // time it's called, reset mSearchSkinDirs. mSearchSkinDirs.clear(); + // If working directory is different from executable directory, add executable subdirs as searchable folders + if (LLStringUtil::compareInsensitive(mExecutableDir, mWorkingDir) != 0) + { + addSearchSkinDir(add(mExecutableDir, "skins")); + addSearchSkinDir(add(mExecutableDir, "skins", "default")); + } + // + // base skin which is used as fallback for all skinned files // e.g. c:\program files\secondlife\skins\default mDefaultSkinDir = getSkinBaseDir(); @@ -1109,14 +1117,6 @@ void LLDir::setSkinFolder(const std::string &skin_folder, const std::string& the addSearchSkinDir(mUserDefaultSkinDir); // then user-defined skins. addSearchSkinDir(mUserSkinDir); - - // If working directory is different from executable directory, add executable subdirs as searchable folders - if (mExecutableDir != mWorkingDir) - { - addSearchSkinDir(add(mExecutableDir, "skins")); - addSearchSkinDir(add(mExecutableDir, "skins", "default")); - } - // } void LLDir::addSearchSkinDir(const std::string& skindir) diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp index 1703e30dbe..da3519e3ab 100644 --- a/indra/llimage/llimagefilter.cpp +++ b/indra/llimage/llimagefilter.cpp @@ -88,7 +88,7 @@ void LLImageFilter::executeFilter(LLPointer raw_image) { mImage = raw_image; - LLImageDataLock lock(mImage); + LLImageDataSharedLock lock(mImage); // FIRE-34564 Bugsplat SHARED vs EXCLUSIVE lock conflict //std::cout << "Filter : size = " << mFilterData.size() << std::endl; for (S32 i = 0; i < mFilterData.size(); ++i) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d085e748e4..a86a343594 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2253,6 +2253,7 @@ if (WINDOWS) "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" "--tracy=${USE_TRACY}" + "--avx2=${USE_AVX2_OPTIMIZATION}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ "--channel=${VIEWER_CHANNEL}" @@ -2316,6 +2317,7 @@ if (WINDOWS) "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" "--tracy=${USE_TRACY}" + "--avx2=${USE_AVX2_OPTIMIZATION}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ "--channel=${VIEWER_CHANNEL}" @@ -2502,6 +2504,7 @@ if (LINUX) "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" "--tracy=${USE_TRACY}" + "--avx2=${USE_AVX2_OPTIMIZATION}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" @@ -2529,6 +2532,7 @@ if (LINUX) "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" "--tracy=${USE_TRACY}" + "--avx2=${USE_AVX2_OPTIMIZATION}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" @@ -2624,6 +2628,7 @@ if (DARWIN) "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" "--tracy=${USE_TRACY}" + "--avx2=${USE_AVX2_OPTIMIZATION}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ --bundleid=${MACOSX_BUNDLE_GUI_IDENTIFIER} @@ -2661,6 +2666,7 @@ if (DARWIN) "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" "--tracy=${USE_TRACY}" + "--avx2=${USE_AVX2_OPTIMIZATION}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" diff --git a/indra/newview/fs_viewer_manifest.py b/indra/newview/fs_viewer_manifest.py index d6666d0fef..8093f9d3f6 100644 --- a/indra/newview/fs_viewer_manifest.py +++ b/indra/newview/fs_viewer_manifest.py @@ -4,18 +4,25 @@ import tarfile class FSViewerManifest: def fs_installer_basename(self): + if self.fs_is_avx2(): + opt_string = "AVX2" + else: + opt_string = "LEGACY" substitution_strings = { 'version' : '.'.join(self.args['version']), 'version_short' : '.'.join(self.args['version'][:-1]), 'version_dashes' : '-'.join(self.args['version']), 'app_name':self.app_name(), + 'optimized': opt_string, 'app_name_oneword':self.app_name_oneword() } - return "Phoenix-%(app_name)s-%(version_dashes)s" % substitution_strings + return "Phoenix-%(app_name)s_%(optimized)s-%(version_dashes)s" % substitution_strings def fs_is_opensim(self): return self.args['viewer_flavor'] == 'oss' #Havok would be hvk + def fs_is_avx2(self): + return self.args['avx2'] == 'ON' def fs_splice_grid_substitution_strings( self, subst_strings ): ret = subst_strings diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 09a45e199d..4ccc60194f 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -191,6 +191,7 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, setBackgroundOpaque(true); mPasswordModified = false; + mShowPassword = false; sInstance = this; @@ -316,6 +317,10 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, username_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onSelectUser, this)); mPreviousUsername = username_combo->getValue().asString(); + childSetAction("password_show_btn", onShowHidePasswordClick, this); + childSetAction("password_hide_btn", onShowHidePasswordClick, this); + syncShowHidePasswordButton(); + mInitialized = true; } @@ -1058,6 +1063,37 @@ void FSPanelLogin::onClickForgotPassword(void*) } } +// static +void FSPanelLogin::onShowHidePasswordClick(void*) +{ + if (sInstance) + { // mShowPassword is not saved between sessions, it's just for short-term use + sInstance->mShowPassword = !sInstance->mShowPassword; + LL_INFOS("AppInit") << "Showing password text now " << (sInstance->mShowPassword ? "on" : "off") << LL_ENDL; + + sInstance->syncShowHidePasswordButton(); + } +} + + +void FSPanelLogin::syncShowHidePasswordButton() +{ // Show or hide the two 'eye' buttons for password visibility + LLButton* show_password_btn = sInstance->findChild("password_show_btn"); + if (show_password_btn) + { + show_password_btn->setVisible(!mShowPassword); + } + LLButton* hide_password_btn = sInstance->findChild("password_hide_btn"); + if (hide_password_btn) + { + hide_password_btn->setVisible(mShowPassword); + } + + // Update the edit field to replace password text with dots ... or not. Will redraw + sInstance->getChild("password_edit")->setDrawAsterixes(!mShowPassword); +} + + //static void FSPanelLogin::onClickHelp(void*) { diff --git a/indra/newview/fspanellogin.h b/indra/newview/fspanellogin.h index 9a817c0bcf..dc256dbd93 100644 --- a/indra/newview/fspanellogin.h +++ b/indra/newview/fspanellogin.h @@ -98,6 +98,7 @@ private: void onSelectServer(); void onLocationSLURL(); void onUsernameTextChanged(); + void syncShowHidePasswordButton(); // Update which button is shown based on mShowPassword static void onClickConnect(void*); static void onClickNewAccount(void*); @@ -110,6 +111,7 @@ private: static void onRemoveCallback(const LLSD& notification, const LLSD& response); static void onClickGridMgrHelp(void*); static void onClickGridBuilder(void*); + static void onShowHidePasswordClick(void*); static std::string credentialName(); private: @@ -121,6 +123,8 @@ private: void* mCallbackData; bool mPasswordModified; + bool mShowPassword; // Show password in normal text vs. hidden by dots + bool mShowFavorites; static FSPanelLogin* sInstance; diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index bb62d35b1d..1018b3d6db 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -32,7 +32,7 @@ SetCompressor /solid lzma # Compress whole installer as one block SetDatablockOptimize off # Only saves us 0.1%, not worth it XPStyle on # Add an XP manifest to the installer RequestExecutionLevel admin # For when we write to Program Files -Unicode true # Enable unicode support +Unicode true # Enable unicode support ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Project flags @@ -178,9 +178,88 @@ Var FRIENDLY_APP_NAME # FIRE-30446: Set FriendlyAppName for prot Function dirPre StrCmp $SKIP_DIALOGS "true" 0 +2 Abort - FunctionEnd +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Open link in a new browser window +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Function openLinkNewWindow + Push $3 + Exch + Push $2 + Exch + Push $1 + Exch + Push $0 + Exch + + ReadRegStr $0 HKCR "http\shell\open\command" "" +# Get browser path + DetailPrint $0 + StrCpy $2 '"' + StrCpy $1 $0 1 + StrCmp $1 $2 +2 # if path is not enclosed in " look for space as final char + StrCpy $2 ' ' + StrCpy $3 1 + loop: + StrCpy $1 $0 1 $3 + DetailPrint $1 + StrCmp $1 $2 found + StrCmp $1 "" found + IntOp $3 $3 + 1 + Goto loop + + found: + StrCpy $1 $0 $3 + StrCmp $2 " " +2 + StrCpy $1 '$1"' + + Pop $0 + Exec '$1 $0' + Pop $0 + Pop $1 + Pop $2 + Pop $3 +FunctionEnd + +!macro _OpenURL URL +Push "${URL}" +Call openLinkNewWindow +!macroend + +!define OpenURL '!insertmacro "_OpenURL"' + +; Add the AVX2 check functions +Function CheckCPUFlagsAVX2 + Push $1 + System::Call 'kernel32::IsProcessorFeaturePresent(i 40) i .r1' ; 40 is PF_AVX2_INSTRUCTIONS_AVAILABLE + IntCmp $1 1 OK_AVX2 + ; AVX2 not supported + MessageBox MB_OK $(MissingAVX2) + ${OpenURL} 'https://www.firestormviewer.org/early-access-beta-downloads-legacy-cpus' + Quit + + OK_AVX2: + Pop $1 + Return +FunctionEnd + +Function CheckCPUFlagsAVX2_Prompt + Push $1 + System::Call 'kernel32::IsProcessorFeaturePresent(i 40) i .r1' ; 40 is PF_AVX2_INSTRUCTIONS_AVAILABLE + IntCmp $1 1 OK_AVX2 + Pop $1 + Return + OK_AVX2: + MessageBox MB_YESNO $(AVX2Available) IDYES DownloadAVX2 IDNO ContinueInstall + DownloadAVX2: + ${OpenURL} 'https://www.firestormviewer.org/early-access-beta-downloads/' + Quit + ContinueInstall: + Pop $1 + Return +FunctionEnd + # Optional start menu entry ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Post-directory page callback @@ -224,6 +303,16 @@ ${If} $0 != "" ${EndIf} Call CheckCPUFlags # Make sure we have SSE2 support + +# Two checks here, if we are an AVX2 build we want to abort if no AVX2 support on this CPU. +# If we are not an AVX2 build but the CPU can support it then we want to prompt them to download the AVX2 version +# but also allow them to override. +${If} ${ISAVX2} == 1 + Call CheckCPUFlagsAVX2 +${Else} + Call CheckCPUFlagsAVX2_Prompt +${EndIf} + Call CheckWindowsVersion # Don't install On unsupported systems Push $0 ${GetParameters} $COMMANDLINE # Get our command line diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi index 164f165f50..a11e4d505a 100755 --- a/indra/newview/installers/windows/lang_de.nsi +++ b/indra/newview/installers/windows/lang_de.nsi @@ -57,6 +57,8 @@ LangString CheckAdministratorUnInstMB ${LANG_GERMAN} 'Sie besitzen ungenügende ; checkcpuflags LangString MissingSSE2 ${LANG_GERMAN} "Dieser PC besitzt möglicherweise keinen Prozessor mit SSE2-Unterstützung, die für die Ausführung von Firestorm ${VERSION_LONG} benötigt wird. Trotzdem installieren?" +LangString MissingAVX2 ${LANG_GERMAN} "Ihre CPU unterstützt keine AVX2-Anweisungen. Bitte laden Sie die Version für ältere CPUs von https://www.firestormviewer.org/early-access-beta-downloads-legacy-cpus/ herunter." +LangString AVX2Available ${LANG_GERMAN} "Ihre CPU unterstützt AVX2-Anweisungen. Sie können die für AVX2 optimierte Version für eine bessere Leistung unter https://www.firestormviewer.org/early-access-beta-downloads/ herunterladen. Möchten Sie sie jetzt herunterladen?" ; closesecondlife function (install) LangString CloseSecondLifeInstDP ${LANG_GERMAN} "Warten auf die Beendigung von Firestorm ..." diff --git a/indra/newview/installers/windows/lang_en-us.nsi b/indra/newview/installers/windows/lang_en-us.nsi index c301aa0e4e..69cde24d32 100644 Binary files a/indra/newview/installers/windows/lang_en-us.nsi and b/indra/newview/installers/windows/lang_en-us.nsi differ diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi index 37897d5981..cf36e45285 100755 Binary files a/indra/newview/installers/windows/lang_es.nsi and b/indra/newview/installers/windows/lang_es.nsi differ diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi index fc263d1eab..5312e31426 100755 Binary files a/indra/newview/installers/windows/lang_fr.nsi and b/indra/newview/installers/windows/lang_fr.nsi differ diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi index 34e3bdcebd..d7447ed46b 100755 Binary files a/indra/newview/installers/windows/lang_it.nsi and b/indra/newview/installers/windows/lang_it.nsi differ diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi index 8322d86f81..b0d8958984 100755 Binary files a/indra/newview/installers/windows/lang_ja.nsi and b/indra/newview/installers/windows/lang_ja.nsi differ diff --git a/indra/newview/installers/windows/lang_pl.nsi b/indra/newview/installers/windows/lang_pl.nsi index 2a8ea7ef1d..3356eed567 100644 Binary files a/indra/newview/installers/windows/lang_pl.nsi and b/indra/newview/installers/windows/lang_pl.nsi differ diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi index 3f75a5b580..c7bb70ad02 100755 Binary files a/indra/newview/installers/windows/lang_ru.nsi and b/indra/newview/installers/windows/lang_ru.nsi differ diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp index e6fbfbfb38..1dd136f61f 100644 --- a/indra/newview/llhudobject.cpp +++ b/indra/newview/llhudobject.cpp @@ -309,10 +309,20 @@ void LLHUDObject::renderAllForTimer() { sHUDObjects.erase(cur_it); } - else if (hud_objp->isVisible()) + // FIRE-33239 - particles do not sie when UI is disabled + // else if (hud_objp->isVisible()) + // { + // hud_objp->renderForTimer(); + // } + else { - hud_objp->renderForTimer(); + LLHUDEffect* effect = dynamic_cast(hud_objp); + if (effect || hud_objp->isVisible()) + { + hud_objp->renderForTimer(); + } } + // } } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 1f66d9f489..ef7c6d78bf 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1646,6 +1646,13 @@ void render_ui(F32 zoom_factor, int subfield) LLHUDObject::renderAll(); render_ui_2d(); } + // FIRE-33239 - particles do not sie when UI is disabled + if (!render_ui) + { + // Make sure particle effects disappear + LLHUDObject::renderAllForTimer(); + } + // gViewerWindow->setup2DRender(); gViewerWindow->updateDebugText(); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index eccbb5722c..dda38667ec 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -82,7 +82,7 @@ LLViewerPart::LLViewerPart() : mPartSourcep = NULL; mParent = NULL; mChild = NULL; - LLViewerPartSim::incParticleCount2( 1 ); // FIRE-34600 - bugsplat AVX2 particle count mismatch + ++LLViewerPartSim::sParticleCount2 ; } LLViewerPart::~LLViewerPart() @@ -107,7 +107,7 @@ LLViewerPart::~LLViewerPart() mPartSourcep = NULL; - LLViewerPartSim::decParticleCount2( 1 ); // FIRE-34600 - bugsplat AVX2 particle count mismatch + --LLViewerPartSim::sParticleCount2 ; } void LLViewerPart::init(LLPointer sourcep, LLViewerTexture *imagep, LLVPCallback cb) @@ -205,7 +205,7 @@ LLViewerPartGroup::~LLViewerPartGroup() } mParticles.clear(); - LLViewerPartSim::decParticleCount(count); // FIRE-34600 - bugsplat AVX2 particle count mismatch + LLViewerPartSim::sParticleCount -= count; // FIRE-34600 - bugsplat AVX2 particle count mismatch } void LLViewerPartGroup::cleanup() @@ -268,7 +268,7 @@ bool LLViewerPartGroup::addPart(LLViewerPart* part, F32 desired_size) mParticles.push_back(part); part->mSkipOffset=mSkippedTime; - LLViewerPartSim::incParticleCount(1); // FIRE-34600 - bugsplat AVX2 particle count mismatch + ++LLViewerPartSim::sParticleCount; // FIRE-34600 - bugsplat AVX2 particle count mismatch return true; } @@ -279,15 +279,14 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) LLVector3 gravity(0.f, 0.f, GRAVITY); - // FIRE-34600 off by one particle count triggering bugsplat (LL_ERR) - S32 end = (S32) mParticles.size(); LLViewerPartSim::checkParticleCount(static_cast(mParticles.size())); - std::atomic_signal_fence(std::memory_order_seq_cst); - // LLViewerCamera* camera = LLViewerCamera::getInstance(); LLViewerRegion *regionp = getRegion(); - //S32 end = (S32) mParticles.size();// FIRE-34600 off by one particle count triggering bugsplat (LL_ERR) + // FIRE-34600 - Bugsplat AVX2 particle count mismatch + // S32 end = (S32) mParticles.size(); + bool changed = false; + // for (S32 i = 0 ; i < (S32)mParticles.size();) { LLVector3 a(0.f, 0.f, 0.f); @@ -403,9 +402,15 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) // Kill dead particles (either flagged dead, or too old) if ((part->mLastUpdateTime > part->mMaxAge) || (LLViewerPart::LL_PART_DEAD_MASK == part->mFlags)) { - mParticles[i] = mParticles.back() ; - mParticles.pop_back() ; + // FIRE-34600 - Bugsplat AVX2 particle count mismatch + // mParticles[i] = mParticles.back() ; + // mParticles.pop_back() ; + // delete part ; + vector_replace_with_last(mParticles, mParticles.begin() + i); + --LLViewerPartSim::sParticleCount; delete part ; + changed = true; + // } else { @@ -413,9 +418,18 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) if (!posInGroup(part->mPosAgent, desired_size)) { // Transfer particles between groups - LLViewerPartSim::getInstance()->put(part) ; - mParticles[i] = mParticles.back() ; - mParticles.pop_back() ; + // FIRE-34600 - Bugsplat AVX2 particle count mismatch + // LLViewerPartSim::getInstance()->put(part) ; + // mParticles[i] = mParticles.back() ; + // mParticles.pop_back() ; + vector_replace_with_last(mParticles, mParticles.begin() + i); + LLViewerPartSim::getInstance()->put(part) ; + // Note: put() uses addpart when succesful, this increase sParticleCount by 1 + // even though it has stayed the same. If it is not succesful then we need to decrease by 1 + // so a decrement here works for both cases. + --LLViewerPartSim::sParticleCount; + changed = true; + // } else { @@ -424,16 +438,25 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) } } - S32 removed = end - (S32)mParticles.size(); - if (removed > 0) + // FIRE-34600 - Bugsplat AVX2 particle count mismatch + // S32 removed = end - (S32)mParticles.size(); + // if (removed > 0) + // { + // // we removed one or more particles, so flag this group for update + // if (mVOPartGroupp.notNull()) + // { + // gPipeline.markRebuild(mVOPartGroupp->mDrawable, LLDrawable::REBUILD_ALL); + // } + // LLViewerPartSim::decPartCount(removed); + // } + if (changed) { - // we removed one or more particles, so flag this group for update if (mVOPartGroupp.notNull()) { gPipeline.markRebuild(mVOPartGroupp->mDrawable, LLDrawable::REBUILD_ALL); } - LLViewerPartSim::decParticleCount(removed); // FIRE-34600 - bugsplat AVX2 particle count mismatch } + // // Kill the viewer object if this particle group is empty if (mParticles.empty()) @@ -480,21 +503,42 @@ void LLViewerPartSim::checkParticleCount(U32 size) { // FIRE-34600 - bugsplat AVX2 particle count mismatch // if(LLViewerPartSim::sParticleCount2 != LLViewerPartSim::sParticleCount) - S32 count = LLViewerPartSim::getParticleCount(); - S32 count2 = LLViewerPartSim::getParticleCount2(); - if( count != count2 ) - // + // { + // LL_ERRS() << "sParticleCount: " << LLViewerPartSim::sParticleCount << " ; sParticleCount2: " << LLViewerPartSim::sParticleCount2 << LL_ENDL ; + // } + // + // if(size > (U32)LLViewerPartSim::sParticleCount2) + // { + // LL_ERRS() << "current particle size: " << LLViewerPartSim::sParticleCount2 << " array size: " << size << LL_ENDL ; // FIRE-34600 - bugsplat AVX2 particle count mismatch + // } + if(LLViewerPartSim::sParticleCount2 != LLViewerPartSim::sParticleCount) { - LL_ERRS() << "sParticleCount: " << count << " ; sParticleCount2: " << count2 << LL_ENDL ; // FIRE-34600 - bugsplat AVX2 particle count mismatch + static int fail_count{0}; + if(fail_count > 10) + { + LL_ERRS() << "sParticleCount: " << LLViewerPartSim::sParticleCount << " ; sParticleCount2: " << LLViewerPartSim::sParticleCount2 << LL_ENDL ; + } + else + { + LL_WARNS() << "sParticleCount: " << LLViewerPartSim::sParticleCount << " ; sParticleCount2: " << LLViewerPartSim::sParticleCount2 << LL_ENDL ; + } + fail_count++; } - // FIRE-34600 - bugsplat AVX2 particle count mismatch - // if(size > (U32)LLViewerPartSim::sParticleCount2) - if( size > static_cast(count2) ) - // + if(size > (U32)LLViewerPartSim::sParticleCount2) { - LL_ERRS() << "current particle size: " << count2 << " array size: " << size << LL_ENDL ; // FIRE-34600 - bugsplat AVX2 particle count mismatch + static int size_mismatch_count{0}; + if(size_mismatch_count > 10) + { + LL_ERRS() << "current particle size: " << LLViewerPartSim::sParticleCount2 << " array size: " << size << LL_ENDL ; + } + else + { + LL_WARNS() << "current particle size: " << LLViewerPartSim::sParticleCount2 << " array size: " << size << LL_ENDL ; + } + size_mismatch_count++; } + // } LLViewerPartSim::LLViewerPartSim() @@ -539,18 +583,14 @@ void LLViewerPartSim::destroyClass() //static bool LLViewerPartSim::shouldAddPart() { - // FIRE-34600 - bugsplat AVX2 particle count mismatch - // if (sParticleCount < MAX_PART_COUNT) - auto count = LLViewerPartSim::getParticleCount(); - if ( count >= MAX_PART_COUNT) - // + if (sParticleCount >= MAX_PART_COUNT) { return false; } - if ( count > PART_THROTTLE_THRESHOLD*sMaxParticleCount) // FIRE-34600 - bugsplat AVX2 particle count mismatch + if ( sParticleCount > PART_THROTTLE_THRESHOLD*sMaxParticleCount) { - F32 frac = (F32)count/(F32)sMaxParticleCount; // FIRE-34600 - bugsplat AVX2 particle count mismatch + F32 frac = (F32)sParticleCount/(F32)sMaxParticleCount; frac -= PART_THROTTLE_THRESHOLD; frac *= PART_THROTTLE_RESCALE; if (ll_frand() < frac) @@ -572,7 +612,7 @@ bool LLViewerPartSim::shouldAddPart() void LLViewerPartSim::addPart(LLViewerPart* part) { - if (LLViewerPartSim::getParticleCount() < MAX_PART_COUNT) + if (LLViewerPartSim::sParticleCount < MAX_PART_COUNT) { put(part); } @@ -806,19 +846,14 @@ void LLViewerPartSim::updateSimulation() } if (LLDrawable::getCurrentFrame()%16==0) { - // FIRE-34600 - bugsplat AVX2 particle count mismatch - // if (sParticleCount > sMaxParticleCount * 0.875f - // && sParticleAdaptiveRate < 2.0f) - auto count = LLViewerPartSim::getParticleCount(); - if ( count > sMaxParticleCount * 0.875f - && sParticleAdaptiveRate < 2.0f) - // + if (sParticleCount > sMaxParticleCount * 0.875f + && sParticleAdaptiveRate < 2.0f) { sParticleAdaptiveRate *= PART_ADAPT_RATE_MULT; } else { - if ( count < sMaxParticleCount * 0.5f // FIRE-34600 - bugsplat AVX2 particle count mismatch + if ( sParticleCount < sMaxParticleCount * 0.5f && sParticleAdaptiveRate > 0.03125f) { sParticleAdaptiveRate *= PART_ADAPT_RATE_MULT_RECIP; @@ -835,25 +870,15 @@ void LLViewerPartSim::updatePartBurstRate() { if (!(LLDrawable::getCurrentFrame() & 0xf)) { - // FIRE-34600 - bugsplat AVX2 particle count mismatch - // if (sParticleCount >= MAX_PART_COUNT) //set rate to zero - auto count = LLViewerPartSim::getParticleCount(); - if (count >= MAX_PART_COUNT) //set rate to zero - // + if (sParticleCount >= MAX_PART_COUNT) //set rate to zero { sParticleBurstRate = 0.0f ; } - // FIRE-34600 - bugsplat AVX2 particle count mismatch - // else if(sParticleCount > 0) - else if (count > 0) - // + else if(sParticleCount > 0) { if(sParticleBurstRate > 0.0000001f) { - // FIRE-34600 - bugsplat AVX2 particle count mismatch - // F32 total_particles = sParticleCount / sParticleBurstRate ; //estimated - F32 total_particles = count / sParticleBurstRate ; //estimated - // + F32 total_particles = sParticleCount / sParticleBurstRate ; //estimated F32 new_rate = llclamp(0.9f * sMaxParticleCount / total_particles, 0.0f, 1.0f) ; F32 delta_rate_threshold = llmin(0.1f * llmax(new_rate, sParticleBurstRate), 0.1f) ; F32 delta_rate = llclamp(new_rate - sParticleBurstRate, -1.0f * delta_rate_threshold, delta_rate_threshold) ; diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h index 3e92a1988d..6c7eaf4e1f 100644 --- a/indra/newview/llviewerpartsim.h +++ b/indra/newview/llviewerpartsim.h @@ -155,25 +155,14 @@ public: static bool shouldAddPart(); // Just decides whether this particle should be added or not (for particle count capping) F32 maxRate() // Return maximum particle generation rate { - // FIRE-34600 - bugsplat AVX2 particle count mismatch - // if (sParticleCount >= MAX_PART_COUNT) - // { - // return 1.f; - // } - // if (sParticleCount > PART_THROTTLE_THRESHOLD*sMaxParticleCount) - // { - // return (((F32)sParticleCount/(F32)sMaxParticleCount)-PART_THROTTLE_THRESHOLD)*PART_THROTTLE_RESCALE; - // } - const auto count = getParticleCount(); - if ( count >= MAX_PART_COUNT) + if (sParticleCount >= MAX_PART_COUNT) { return 1.f; } - if ( count > PART_THROTTLE_THRESHOLD*sMaxParticleCount) + if (sParticleCount > PART_THROTTLE_THRESHOLD*sMaxParticleCount) { - return (((F32)count/(F32)sMaxParticleCount)-PART_THROTTLE_THRESHOLD)*PART_THROTTLE_RESCALE; + return (((F32)sParticleCount/(F32)sMaxParticleCount)-PART_THROTTLE_THRESHOLD)*PART_THROTTLE_RESCALE; } - // return 0.f; } F32 getRefRate() { return sParticleAdaptiveRate; } @@ -188,29 +177,15 @@ public: friend class LLViewerPartGroup; - // FIRE-34600 - bugsplat AVX2 particle count mismatch - // bool aboveParticleLimit() const { return sParticleCount > sMaxParticleCount; } - bool aboveParticleLimit() const { return getParticleCount() > sMaxParticleCount; } - // + bool aboveParticleLimit() const { return sParticleCount > sMaxParticleCount; } static void setMaxPartCount(const S32 max_parts) { sMaxParticleCount = max_parts; } static S32 getMaxPartCount() { return sMaxParticleCount; } // FIRE-34600 - bugsplat AVX2 particle count mismatch + // Deprecate these and use native operators for consistency // static void incPartCount(const S32 count) { sParticleCount += count; } // static void decPartCount(const S32 count) { sParticleCount -= count; } - static void incParticleCount(const S32 count, std::memory_order order = std::memory_order_seq_cst ) - { sParticleCount.fetch_add( count , std::memory_order_seq_cst ); } - static void decParticleCount(const S32 count, std::memory_order order = std::memory_order_seq_cst ) - { sParticleCount.fetch_sub( count , std::memory_order_seq_cst ); } - static void incParticleCount2(const S32 count, std::memory_order order = std::memory_order_seq_cst ) - { sParticleCount2.fetch_add( count , std::memory_order_seq_cst ); } - static void decParticleCount2(const S32 count, std::memory_order order = std::memory_order_seq_cst ) - { sParticleCount2.fetch_sub( count , std::memory_order_seq_cst ); } - static inline S32 getParticleCount(std::memory_order order = std::memory_order_seq_cst) { return sParticleCount.load(order); } - - static inline S32 getParticleCount2(std::memory_order order = std::memory_order_seq_cst) { return sParticleCount2.load(order); } // - U32 mID; protected: diff --git a/indra/newview/skins/default/xui/de/floater_phototools_camera.xml b/indra/newview/skins/default/xui/de/floater_phototools_camera.xml index 621fe231f4..25490cfcad 100644 --- a/indra/newview/skins/default/xui/de/floater_phototools_camera.xml +++ b/indra/newview/skins/default/xui/de/floater_phototools_camera.xml @@ -56,6 +56,8 @@ + + +