diff options
Diffstat (limited to 'indra/newview')
47 files changed, 269 insertions, 278 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0a1a78c5b4..339a8f1ab0 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -324,7 +324,7 @@ BOOL gUseWireframe = FALSE; LLVFS* gStaticVFS = NULL; LLMemoryInfo gSysMemory; -U64 gMemoryAllocated = 0; // updated in display_stats() in llviewerdisplay.cpp +U64Bytes gMemoryAllocated(0); // updated in display_stats() in llviewerdisplay.cpp std::string gLastVersionChannel; @@ -3329,8 +3329,8 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["CPUInfo"]["CPUSSE"] = gSysCPU.hasSSE(); gDebugInfo["CPUInfo"]["CPUSSE2"] = gSysCPU.hasSSE2(); - gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB()); - gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated>>10); // MB -> KB + gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB().value()); + gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated.valueInUnits<LLUnits::Kibibytes>()); gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); // The user is not logged on yet, but record the current grid choice login url diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 60a1045f58..10452e64e2 100755 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -367,7 +367,7 @@ class LLVFS; extern LLVFS *gStaticVFS; extern LLMemoryInfo gSysMemory; -extern U64 gMemoryAllocated; +extern U64Bytes gMemoryAllocated; extern std::string gLastVersionChannel; diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index b16bb573e1..80f249612a 100755 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -87,7 +87,7 @@ int main( int argc, char **argv ) bool ok = viewer_app_ptr->init(); if(!ok) { - llwarns << "Application init failed." << llendl; + LL_WARNS() << "Application init failed." << LL_ENDL; return -1; } @@ -207,7 +207,7 @@ void viewerappapi_init(ViewerAppAPI *server) } else { - llwarns << "Unable to register service name: " << error->message << llendl; + LL_WARNS() << "Unable to register service name: " << error->message << LL_ENDL; } g_object_unref(serverproxy); @@ -226,7 +226,7 @@ gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **succ { bool success = false; - llinfos << "Was asked to go to slurl: " << slurl << llendl; + LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL; std::string url = slurl; LLMediaCtrl* web = NULL; @@ -292,14 +292,14 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) } else { - llinfos << "Call-out to other instance failed (perhaps not running): " << error->message << llendl; + LL_INFOS() << "Call-out to other instance failed (perhaps not running): " << error->message << LL_ENDL; } g_object_unref(G_OBJECT(remote_object)); } else { - llwarns << "Couldn't connect to session bus: " << error->message << llendl; + LL_WARNS() << "Couldn't connect to session bus: " << error->message << LL_ENDL; } if (error) @@ -343,7 +343,7 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze) if (pid == 0) { // child execv(cmd.c_str(), cmdargv); /* Flawfinder: Ignore */ - llwarns << "execv failure when trying to start " << cmd << llendl; + LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL; _exit(1); // avoid atexit() } else { if (pid > 0) @@ -352,7 +352,7 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze) int childExitStatus; waitpid(pid, &childExitStatus, 0); } else { - llwarns << "fork failure." << llendl; + LL_WARNS() << "fork failure." << LL_ENDL; } } } @@ -371,7 +371,7 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze) if (pid == 0) { // child execv(cmd.c_str(), (char* const*) cmdargv); /* Flawfinder: ignore */ - llwarns << "execv failure when trying to start " << cmd << llendl; + LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL; _exit(1); // avoid atexit() } else @@ -386,7 +386,7 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze) } else { - llwarns << "fork failure." << llendl; + LL_WARNS() << "fork failure." << LL_ENDL; } } // Sometimes signals don't seem to quit the viewer. Also, we may diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp index 32e7e0a83d..6ac30bd9b8 100755 --- a/indra/newview/llappviewerlinux_api_dbus.cpp +++ b/indra/newview/llappviewerlinux_api_dbus.cpp @@ -35,9 +35,9 @@ extern "C" { #include "apr_dso.h" } -#define DEBUGMSG(...) do { lldebugs << llformat(__VA_ARGS__) << llendl; } while(0) -#define INFOMSG(...) do { llinfos << llformat(__VA_ARGS__) << llendl; } while(0) -#define WARNMSG(...) do { llwarns << llformat(__VA_ARGS__) << llendl; } while(0) +#define DEBUGMSG(...) do { LL_DEBUGS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) +#define INFOMSG(...) do { LL_INFOS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) +#define WARNMSG(...) do { LL_WARNS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) #define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) RTN (*ll##DBUSSYM)(__VA_ARGS__) = NULL #include "llappviewerlinux_api_dbus_syms_raw.inc" diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 4d340cafa9..8d6d52185a 100755 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -72,9 +72,9 @@ int main( int argc, char **argv ) // Set the working dir to <bundle>/Contents/Resources if (chdir(gDirUtilp->getAppRODataDir().c_str()) == -1) { - llwarns << "Could not change directory to " + LL_WARNS() << "Could not change directory to " << gDirUtilp->getAppRODataDir() << ": " << strerror(errno) - << llendl; + << LL_ENDL; } LLAppViewerMacOSX* viewer_app_ptr = new LLAppViewerMacOSX(); @@ -88,7 +88,7 @@ int main( int argc, char **argv ) bool ok = viewer_app_ptr->init(); if(!ok) { - llwarns << "Application init failed." << llendl; + LL_WARNS() << "Application init failed." << LL_ENDL; return -1; } @@ -154,7 +154,7 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) llifstream ifs(filename, llifstream::binary); if (!ifs.is_open()) { - llwarns << "Unable to open file" << filename << llendl; + LL_WARNS() << "Unable to open file" << filename << LL_ENDL; return false; } @@ -561,13 +561,13 @@ void init_apple_menu(const char* product) if(AEInstallEventHandler('GURL', 'GURL', NewAEEventHandlerUPP(AEGURLHandler),0, false) != noErr) { // Couldn't install AppleEvent handler. This error shouldn't be fatal. - llinfos << "Couldn't install 'GURL' AppleEvent handler. Continuing..." << llendl; + LL_INFOS() << "Couldn't install 'GURL' AppleEvent handler. Continuing..." << LL_ENDL; } // Install a handler for 'quit' AppleEvents. This makes quitting the application from the dock work. if(AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(AEQuitHandler),0, false) != noErr) { // Couldn't install AppleEvent handler. This error shouldn't be fatal. - llinfos << "Couldn't install Quit AppleEvent handler. Continuing..." << llendl; + LL_INFOS() << "Couldn't install Quit AppleEvent handler. Continuing..." << LL_ENDL; } } diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 8dd148e304..9311056a27 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -39,7 +39,7 @@ const int CONVERSATION_LIFETIME = 30; // lifetime of LLConversation is 30 days b struct ConversationParams : public LLInitParam::Block<ConversationParams> { - Mandatory<LLUnit<U64, LLUnits::Seconds> > time; + Mandatory<U64Seconds > time; Mandatory<std::string> timestamp; Mandatory<SessionType> conversation_type; Mandatory<std::string> conversation_name, @@ -113,7 +113,7 @@ void LLConversation::onIMFloaterShown(const LLUUID& session_id) } // static -const std::string LLConversation::createTimestamp(const LLUnit<U64, LLUnits::Seconds>& utc_time) +const std::string LLConversation::createTimestamp(const U64Seconds& utc_time) { std::string timeStr; LLSD substitution; @@ -132,7 +132,7 @@ const std::string LLConversation::createTimestamp(const LLUnit<U64, LLUnits::Sec bool LLConversation::isOlderThan(U32 days) const { - LLUnit<U64, LLUnits::Seconds> now = time_corrected(); + U64Seconds now(time_corrected()); LLUnit<U32, LLUnits::Days> age = now - mTime; return age > days; @@ -535,7 +535,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) history_file_name); ConversationParams params; - params.time(time) + params.time(LLUnits::Seconds::fromValue(time)) .conversation_type((SessionType)stype) .has_offline_ims(has_offline_ims) .conversation_name(conv_name_buffer) diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 5d94cb6497..fd6ad9ad66 100755 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -55,7 +55,7 @@ public: const LLUUID& getSessionID() const { return mSessionID; } const LLUUID& getParticipantID() const { return mParticipantID; } const std::string& getTimestamp() const { return mTimestamp; } - const LLUnit<U64, LLUnits::Seconds>& + const U64Seconds& getTime() const { return mTime; } bool hasOfflineMessages() const { return mHasOfflineIMs; } @@ -76,7 +76,7 @@ public: /* * returns string representation(in form of: mm/dd/yyyy hh:mm) of time when conversation was started */ - static const std::string createTimestamp(const LLUnit<U64, LLUnits::Seconds>& utc_time); + static const std::string createTimestamp(const U64Seconds& utc_time); private: @@ -88,7 +88,7 @@ private: boost::signals2::connection mIMFloaterShowedConnection; - LLUnit<U64, LLUnits::Seconds> mTime; // last interaction time + U64Seconds mTime; // last interaction time SessionType mConversationType; std::string mConversationName; std::string mHistoryFileName; diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index bd5e0b8f88..93719ac7fb 100755 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -518,8 +518,8 @@ bool LLConversationLogListNameComparator::doCompare(const LLConversationLogListI bool LLConversationLogListDateComparator::doCompare(const LLConversationLogListItem* conversation1, const LLConversationLogListItem* conversation2) const { - LLUnit<U64, LLUnits::Seconds> date1 = conversation1->getConversation()->getTime(); - LLUnit<U64, LLUnits::Seconds> date2 = conversation2->getConversation()->getTime(); + U64Seconds date1 = conversation1->getConversation()->getTime(); + U64Seconds date2 = conversation2->getConversation()->getTime(); const LLUUID& id1 = conversation1->getConversation()->getParticipantID(); const LLUUID& id2 = conversation2->getConversation()->getParticipantID(); diff --git a/indra/newview/llface.inl b/indra/newview/llface.inl index 85c35a88f3..c37b77d2cd 100755 --- a/indra/newview/llface.inl +++ b/indra/newview/llface.inl @@ -77,7 +77,7 @@ inline S32 LLFace::getColors (LLStrider<LLColor4U> &colors) if (!mBackupMem) { printDebugInfo(); - llerrs << "No backup memory for face" << llendl; + LL_ERRS() << "No backup memory for face" << LL_ENDL; } colorp = (LLColor4U*)(mBackupMem + (4 * mIndicesCount) + (mGeomCount * mDrawPoolp->getStride())); colors = colorp; @@ -89,7 +89,7 @@ inline S32 LLFace::getColors (LLStrider<LLColor4U> &colors) if (!mDrawPoolp->getColorStrider(colors, mGeomIndex)) { printDebugInfo(); - llerrs << "No color pointer for a color strider!" << llendl; + LL_ERRS() << "No color pointer for a color strider!" << LL_ENDL; } mDrawPoolp->setDirtyColors(); return mGeomIndex; @@ -107,7 +107,7 @@ inline S32 LLFace::getTexCoords (LLStrider<LLVector2> &texCoords, S32 pass ) if (!mBackupMem) { printDebugInfo(); - llerrs << "No backup memory for face" << llendl; + LL_ERRS() << "No backup memory for face" << LL_ENDL; } texCoords = (LLVector2*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_TEX_COORDS0 + pass]); texCoords.setStride( mDrawPoolp->getStride()); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index bb9e474098..725a2f2daf 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -260,7 +260,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) TimerBarRow& row = mHoverBarIndex == 0 ? mAverageTimerRow : mTimerBarRows[mScrollIndex + mHoverBarIndex - 1]; TimerBar* hover_bar = NULL; - LLUnit<F32, LLUnits::Seconds> mouse_time_offset = ((F32)(x - mBarRect.mLeft) / (F32)mBarRect.getWidth()) * mTotalTimeDisplay; + F32Seconds mouse_time_offset = ((F32)(x - mBarRect.mLeft) / (F32)mBarRect.getWidth()) * mTotalTimeDisplay; for (int bar_index = 0, end_index = LLInstanceTracker<LLTrace::TimeBlock>::instanceCount(); bar_index < end_index; ++bar_index) @@ -317,11 +317,11 @@ static std::string get_tooltip(TimeBlock& timer, S32 history_index, PeriodicReco if (history_index == 0) { // by default, show average number of call - tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)LLUnit<F64, LLUnits::Milliseconds>(frame_recording.getPeriodMean (timer, RUNNING_AVERAGE_WIDTH)).value(), (S32)frame_recording.getPeriodMean(timer.callCount(), RUNNING_AVERAGE_WIDTH)); + tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)F64Milliseconds(frame_recording.getPeriodMean (timer, RUNNING_AVERAGE_WIDTH)).value(), (S32)frame_recording.getPeriodMean(timer.callCount(), RUNNING_AVERAGE_WIDTH)); } else { - tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)LLUnit<F64, LLUnits::Milliseconds>(frame_recording.getPrevRecording(history_index).getSum(timer)).value(), (S32)frame_recording.getPrevRecording(history_index).getSum(timer.callCount())); + tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)F64Milliseconds(frame_recording.getPrevRecording(history_index).getSum(timer)).value(), (S32)frame_recording.getPrevRecording(history_index).getSum(timer.callCount())); } return tooltip; } @@ -996,7 +996,7 @@ void LLFastTimerView::printLineStats() } first = false; - LLUnit<F32, LLUnits::Seconds> ticks; + F32Seconds ticks; if (mStatsIndex == 0) { ticks = mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH); @@ -1005,7 +1005,7 @@ void LLFastTimerView::printLineStats() { ticks = mRecording.getPrevRecording(mStatsIndex).getSum(*idp); } - LLUnit<F32, LLUnits::Milliseconds> ms = ticks; + F32Milliseconds ms = ticks; timer_stat += llformat("%.1f",ms.value()); @@ -1029,7 +1029,7 @@ void LLFastTimerView::drawLineGraph() LLLocalClipRect clip(mGraphRect); //normalize based on last frame's maximum - static LLUnit<F32, LLUnits::Seconds> max_time = 0.000001; + static F32Seconds max_time(0.000001); static U32 max_calls = 0; static F32 alpha_interp = 0.f; @@ -1060,7 +1060,7 @@ void LLFastTimerView::drawLineGraph() } } - LLUnit<F32, LLUnits::Seconds> cur_max = 0; + F32Seconds cur_max(0); U32 cur_max_calls = 0; for(timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != end_timer_tree(); @@ -1101,7 +1101,7 @@ void LLFastTimerView::drawLineGraph() j--) { LLTrace::Recording& recording = mRecording.getPrevRecording(j); - LLUnit<F32, LLUnits::Seconds> time = llmax(recording.getSum(*idp), LLUnits::Seconds::fromValue(0.000001)); + F32Seconds time = llmax(recording.getSum(*idp), F64Seconds(0.000001)); U32 calls = recording.getSum(idp->callCount()); if (is_hover_timer) @@ -1146,7 +1146,7 @@ void LLFastTimerView::drawLineGraph() max_time = lerp(max_time.value(), cur_max.value(), LLSmoothInterpolation::getInterpolant(0.1f)); if (llabs((max_time - cur_max).value()) <= 1) { - max_time = llmax(LLUnits::Microseconds::fromValue(1.f), LLUnits::Microseconds::fromValue(cur_max)); + max_time = llmax(F32Microseconds(1.f), F32Microseconds(cur_max)); } max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f))); @@ -1179,7 +1179,7 @@ void LLFastTimerView::drawLineGraph() switch(mDisplayType) { case DISPLAY_TIME: - axis_label = llformat("%4.2f ms", LLUnit<F32, LLUnits::Milliseconds>(max_time).value()); + axis_label = llformat("%4.2f ms", F32Milliseconds(max_time).value()); break; case DISPLAY_CALLS: axis_label = llformat("%d calls", (int)max_calls); @@ -1230,7 +1230,7 @@ void LLFastTimerView::drawLegend() llassert(idp->getIndex() < sTimerColors.size()); gl_rect_2d(bar_rect, sTimerColors[idp->getIndex()]); - LLUnit<F32, LLUnits::Milliseconds> ms = 0; + F32Milliseconds ms(0); S32 calls = 0; if (mHoverBarIndex > 0 && mHoverID) { @@ -1240,7 +1240,7 @@ void LLFastTimerView::drawLegend() } else { - ms = LLUnit<F64, LLUnits::Seconds>(mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH)); + ms = F64Seconds(mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH)); calls = (S32)mRecording.getPeriodMean(idp->callCount(), RUNNING_AVERAGE_WIDTH); } @@ -1346,7 +1346,7 @@ void LLFastTimerView::drawTicks() { // Draw MS ticks { - LLUnit<U32, LLUnits::Milliseconds> ms = mTotalTimeDisplay; + U32Milliseconds ms = mTotalTimeDisplay; std::string tick_label; S32 x; S32 barw = mBarRect.getWidth(); @@ -1423,7 +1423,7 @@ void LLFastTimerView::updateTotalTime() mTotalTimeDisplay = mRecording.getPeriodMax(FTM_FRAME, 20); break; default: - mTotalTimeDisplay = LLUnits::Milliseconds::fromValue(100); + mTotalTimeDisplay = F64Milliseconds(100); break; } @@ -1511,14 +1511,14 @@ void LLFastTimerView::drawBars() static LLFastTimer::DeclareTimer FTM_UPDATE_TIMER_BAR_WIDTHS("Update timer bar widths"); -LLUnit<F32, LLUnits::Seconds> LLFastTimerView::updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index) +F32Seconds LLFastTimerView::updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index) { LLFastTimer _(FTM_UPDATE_TIMER_BAR_WIDTHS); - const LLUnit<F32, LLUnits::Seconds> self_time = history_index == -1 + const F32Seconds self_time = history_index == -1 ? mRecording.getPeriodMean(time_block->selfTime(), RUNNING_AVERAGE_WIDTH) : mRecording.getPrevRecording(history_index).getSum(time_block->selfTime()); - LLUnit<F32, LLUnits::Seconds> full_time = self_time; + F32Seconds full_time = self_time; // reserve a spot for this bar to be rendered before its children // even though we don't know its size yet @@ -1544,7 +1544,7 @@ S32 LLFastTimerView::updateTimerBarOffsets(LLTrace::TimeBlock* time_block, Timer LLFastTimer _(FTM_UPDATE_TIMER_BAR_FRACTIONS); TimerBar& timer_bar = row.mBars[timer_bar_index]; - const LLUnit<F32, LLUnits::Seconds> bar_time = timer_bar.mTotalTime - timer_bar.mSelfTime; + const F32Seconds bar_time = timer_bar.mTotalTime - timer_bar.mSelfTime; timer_bar.mChildrenStart = timer_bar.mSelfStart + timer_bar.mSelfTime / 2; timer_bar.mChildrenEnd = timer_bar.mChildrenStart + timer_bar.mTotalTime - timer_bar.mSelfTime; diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 9d88bb2d3f..d184aae03d 100755 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -87,7 +87,7 @@ private: mFirstChild(false), mLastChild(false) {} - LLUnit<F32, LLUnits::Seconds> mTotalTime, + F32Seconds mTotalTime, mSelfTime, mChildrenStart, mChildrenEnd, @@ -113,7 +113,7 @@ private: TimerBar* mBars; }; - LLUnit<F32, LLUnits::Seconds> updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index); + F32Seconds updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index); S32 updateTimerBarOffsets(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 timer_bar_index = 0); S32 drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, S32 image_height, bool hovered = false, bool visible = true, S32 bar_index = 0); void setPauseState(bool pause_state); @@ -128,7 +128,7 @@ private: DISPLAY_HZ } mDisplayType; bool mPauseHistory; - LLUnit<F64, LLUnits::Seconds> mAllTimeMax, + F64Seconds mAllTimeMax, mTotalTimeDisplay; S32 mScrollIndex, mHoverBarIndex, diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 84f0d115ae..ad94949863 100755 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -259,7 +259,7 @@ LLSD LLFloaterAbout::getInfo() // CPU info["CPU"] = gSysCPU.getCPUString(); - info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB() / 1024); + info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits<LLUnits::Mibibytes>()); // Moved hack adjustment to Windows memory size into llsys.cpp info["OS_VERSION"] = LLAppViewer::instance()->getOSInfo().getOSString(); info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR)); diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 116bd241c4..adb490d524 100755 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -89,10 +89,10 @@ void LLFloaterHardwareSettings::refresh() void LLFloaterHardwareSettings::refreshEnabledState() { - S32 min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); - S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(); - getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem); - getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem); + S32Mibibytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); + S32Mibibytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(); + getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); + getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 59272d721f..34ccab0302 100755 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -159,7 +159,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& session_label, mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionUUID); break; default: - llwarns << "Unknown session type" << llendl; + LL_WARNS() << "Unknown session type" << LL_ENDL; xml_filename = "floater_instant_message.xml"; break; } @@ -396,8 +396,8 @@ public: void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) { - llwarns << "Error inviting all agents to session [status:" - << statusNum << "]: " << content << llendl; + LL_WARNS() << "Error inviting all agents to session [status:" + << statusNum << "]: " << content << LL_ENDL; //throw something back to the viewer here? } @@ -417,7 +417,7 @@ BOOL LLFloaterIMPanel::inviteToSession(const std::vector<LLUUID>& ids) if( isInviteAllowed() && (count > 0) ) { - llinfos << "LLFloaterIMPanel::inviteToSession() - inviting participants" << llendl; + LL_INFOS() << "LLFloaterIMPanel::inviteToSession() - inviting participants" << LL_ENDL; std::string url = region->getCapability("ChatSessionRequest"); @@ -439,9 +439,9 @@ BOOL LLFloaterIMPanel::inviteToSession(const std::vector<LLUUID>& ids) } else { - llinfos << "LLFloaterIMPanel::inviteToSession -" + LL_INFOS() << "LLFloaterIMPanel::inviteToSession -" << " no need to invite agents for " - << mDialog << llendl; + << mDialog << LL_ENDL; // successful add, because everyone that needed to get added // was added. } @@ -778,7 +778,7 @@ void LLFloaterIMPanel::sendMsg() && (mDialog == IM_NOTHING_SPECIAL) && mOtherParticipantUUID.isNull()) { - llinfos << "Cannot send IM to everyone unless you're a god." << llendl; + LL_INFOS() << "Cannot send IM to everyone unless you're a god." << LL_ENDL; return; } diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp index 14382e82d7..e6cb068613 100755 --- a/indra/newview/llinspect.cpp +++ b/indra/newview/llinspect.cpp @@ -59,7 +59,7 @@ void LLInspect::draw() } else if (mCloseTimer.getStarted()) { - F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_TIME, 1.f, 0.f); + F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_TIME(), 1.f, 0.f); LLViewDrawContext context(alpha); LLFloater::draw(); if (mCloseTimer.getElapsedTimeF32() > FADE_TIME) diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index f0c7a220a4..ecee801e8e 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -525,7 +525,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name) PeriodicRecording& scene_load_recording = mSceneLoadRecording.getResults(); const U32 frame_count = scene_load_recording.getNumRecordedPeriods(); - LLUnit<F64, LLUnits::Seconds> frame_time; + F64Seconds frame_time; os << "Stat"; for (S32 frame = 1; frame <= frame_count; frame++) diff --git a/indra/newview/llsrv.cpp b/indra/newview/llsrv.cpp index 567c2a0158..8b9aead165 100755 --- a/indra/newview/llsrv.cpp +++ b/indra/newview/llsrv.cpp @@ -35,7 +35,7 @@ struct Responder : public LLAres::UriRewriteResponder void rewriteResult(const std::vector<std::string> &uris) { for (size_t i = 0; i < uris.size(); i++) { - llinfos << "[" << i << "] " << uris[i] << llendl; + LL_INFOS() << "[" << i << "] " << uris[i] << LL_ENDL; } mUris = uris; } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3335ff6631..fdd289c823 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1429,7 +1429,7 @@ bool idle_startup() LL_DEBUGS("AppInit") << "Initializing camera..." << LL_ENDL; gFrameTime = totalTime(); - LLUnit<F32, LLUnits::Seconds> last_time = gFrameTimeSeconds; + F32Seconds last_time = gFrameTimeSeconds; gFrameTimeSeconds = (gFrameTime - gStartTime); gFrameIntervalSeconds = gFrameTimeSeconds - last_time; @@ -1507,7 +1507,7 @@ bool idle_startup() gFirstSim, gSavedSettings.getS32("UseCircuitCodeMaxRetries"), FALSE, - gSavedSettings.getF32("UseCircuitCodeTimeout"), + (F32Seconds)gSavedSettings.getF32("UseCircuitCodeTimeout"), use_circuit_callback, NULL); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 17703fcc21..07ff1de702 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -66,7 +66,7 @@ bool LLTextureFetchDebugger::sDebuggerEnabled = false; LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > LLTextureFetch::sCacheHitRate("texture_cache_hits"); -LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); +LLTrace::EventStatHandle<F64Milliseconds > LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); ////////////////////////////////////////////////////////////////////////////// @@ -1888,12 +1888,11 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe if (log_to_viewer_log || log_to_sim) { - U64 timeNow = LLTimer::getTotalTime(); mFetcher->mTextureInfo.setRequestStartTime(mID, mMetricsStartTime.value()); mFetcher->mTextureInfo.setRequestType(mID, LLTextureInfoDetails::REQUEST_TYPE_HTTP); mFetcher->mTextureInfo.setRequestSize(mID, mRequestedSize); mFetcher->mTextureInfo.setRequestOffset(mID, mRequestedOffset); - mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, timeNow); + mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, LLTimer::getTotalTime()); } bool success = true; @@ -2394,7 +2393,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mFetcherLocked(FALSE) { mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); - mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), LLUnits::Bytes::fromValue(gSavedSettings.getU32("TextureLoggingThreshold"))); + mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), U32Bytes(gSavedSettings.getU32("TextureLoggingThreshold"))); LLTextureFetchDebugger::sDebuggerEnabled = gSavedSettings.getBOOL("TextureFetchDebuggerEnabled"); if(LLTextureFetchDebugger::isEnabled()) @@ -2762,7 +2761,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, discard_level = worker->mDecodedDiscard; raw = worker->mRawImage; aux = worker->mAuxImage; - LLUnit<F32, LLUnits::Seconds> cache_read_time = worker->mCacheReadTime; + F32Seconds cache_read_time(worker->mCacheReadTime); if (cache_read_time != 0.f) { record(sCacheReadLatency, cache_read_time); @@ -3373,7 +3372,7 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1 if (log_to_viewer_log || log_to_sim) { - LLUnit<U64, LLUnits::Microseconds> timeNow = LLTimer::getTotalTime(); + U64Microseconds timeNow = LLTimer::getTotalTime(); mTextureInfo.setRequestSize(id, worker->mFileSize); mTextureInfo.setRequestCompleteTimeAndLog(id, timeNow); } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 38272b40dc..78b13cdd80 100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -107,10 +107,10 @@ public: bool receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data); // Threads: T* (but not safe) - void setTextureBandwidth(LLUnit<F32, LLUnits::Kibibits> bandwidth) { mTextureBandwidth = bandwidth; } + void setTextureBandwidth(F32Kibibits bandwidth) { mTextureBandwidth = bandwidth; } // Threads: T* (but not safe) - LLUnit<F32, LLUnits::Kibibits> getTextureBandwidth() { return mTextureBandwidth; } + F32Kibibits getTextureBandwidth() { return mTextureBandwidth; } // Threads: T* BOOL isFromLocalCache(const LLUUID& id); @@ -310,7 +310,7 @@ private: LLMutex mNetworkQueueMutex; //to protect mNetworkQueue, mHTTPTextureQueue and mCancelQueue. static LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > sCacheHitRate; - static LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > sCacheReadLatency; + static LLTrace::EventStatHandle<F64Milliseconds > sCacheReadLatency; LLTextureCache* mTextureCache; LLImageDecodeThread* mImageDecodeThread; @@ -325,12 +325,12 @@ private: queue_t mHTTPTextureQueue; // Mfnq typedef std::map<LLHost,std::set<LLUUID> > cancel_queue_t; cancel_queue_t mCancelQueue; // Mfnq - LLUnit<F32, LLUnits::Kibibits> mTextureBandwidth; // <none> - LLUnit<F32, LLUnits::Kibibits> mMaxBandwidth; // Mfnq + F32Kibibits mTextureBandwidth; // <none> + F32Kibibits mMaxBandwidth; // Mfnq LLTextureInfo mTextureInfo; // XXX possible delete - LLUnit<U32, LLUnits::Bits> mHTTPTextureBits; // Mfnq + U32Bits mHTTPTextureBits; // Mfnq // XXX possible delete //debug use diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp index cd6e7ff464..6906f82c1c 100755 --- a/indra/newview/lltextureinfo.cpp +++ b/indra/newview/lltextureinfo.cpp @@ -33,8 +33,8 @@ static LLTrace::CountStatHandle<S32> sTextureDownloadsStarted("texture_downloads_started", "number of texture downloads initiated"); static LLTrace::CountStatHandle<S32> sTextureDownloadsCompleted("texture_downloads_completed", "number of texture downloads completed"); -static LLTrace::CountStatHandle<LLUnit<S32, LLUnits::Bytes> > sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded"); -static LLTrace::CountStatHandle<LLUnit<U32, LLUnits::Milliseconds> > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures"); +static LLTrace::CountStatHandle<S32Bytes > sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded"); +static LLTrace::CountStatHandle<U32Milliseconds > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures"); LLTextureInfo::LLTextureInfo() : mLogTextureDownloadsToViewerLog(false), @@ -46,11 +46,11 @@ LLTextureInfo::LLTextureInfo() : mRecording.start(); } -void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, LLUnit<U32, LLUnits::Bytes> textureLogThreshold) +void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold) { mLogTextureDownloadsToViewerLog = writeToViewerLog; mLogTextureDownloadsToSimulator = sendToSim; - mTextureLogThreshold = LLUnit<U32, LLUnits::Bytes>(textureLogThreshold); + mTextureLogThreshold = U32Bytes(textureLogThreshold); } LLTextureInfo::~LLTextureInfo() @@ -126,7 +126,7 @@ void LLTextureInfo::setRequestType(const LLUUID& id, LLTextureInfoDetails::LLReq mTextures[id]->mType = type; } -void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, LLUnit<U64, LLUnits::Microseconds> completeTime) +void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microseconds completeTime) { if (!has(id)) { @@ -160,7 +160,7 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, LLUnit<U64, L << " end=" << details.mCompleteTime << " size=" << details.mSize << " offset=" << details.mOffset - << " length=" << LLUnit<U32, LLUnits::Milliseconds>(details.mCompleteTime - details.mStartTime) + << " length=" << U32Milliseconds(details.mCompleteTime - details.mStartTime) << " protocol=" << protocol << LL_ENDL; } @@ -193,7 +193,7 @@ LLSD LLTextureInfo::getAverages() { LLSD averagedTextureData; S32 averageDownloadRate; - LLUnit<U32, LLUnits::Milliseconds> download_time = mRecording.getSum(sTexureDownloadTime); + U32Milliseconds download_time = mRecording.getSum(sTexureDownloadTime); if(download_time == 0) { averageDownloadRate = 0; @@ -219,11 +219,11 @@ void LLTextureInfo::resetTextureStatistics() mCurrentStatsBundleStartTime = LLTimer::getTotalTime(); } -LLUnit<U32, LLUnits::Microseconds> LLTextureInfo::getRequestStartTime(const LLUUID& id) +U32Microseconds LLTextureInfo::getRequestStartTime(const LLUUID& id) { if (!has(id)) { - return 0; + return U32Microseconds(0); } else { @@ -232,11 +232,11 @@ LLUnit<U32, LLUnits::Microseconds> LLTextureInfo::getRequestStartTime(const LLUU } } -LLUnit<U32, LLUnits::Bytes> LLTextureInfo::getRequestSize(const LLUUID& id) +U32Bytes LLTextureInfo::getRequestSize(const LLUUID& id) { if (!has(id)) { - return 0; + return U32Bytes(0); } else { @@ -271,11 +271,11 @@ LLTextureInfoDetails::LLRequestType LLTextureInfo::getRequestType(const LLUUID& } } -LLUnit<U32, LLUnits::Microseconds> LLTextureInfo::getRequestCompleteTime(const LLUUID& id) +U32Microseconds LLTextureInfo::getRequestCompleteTime(const LLUUID& id) { if (!has(id)) { - return 0; + return U32Microseconds(0); } else { diff --git a/indra/newview/lltextureinfo.h b/indra/newview/lltextureinfo.h index a861a12668..176f2cbb74 100755 --- a/indra/newview/lltextureinfo.h +++ b/indra/newview/lltextureinfo.h @@ -38,18 +38,18 @@ public: LLTextureInfo(); ~LLTextureInfo(); - void setUpLogging(bool writeToViewerLog, bool sendToSim, LLUnit<U32, LLUnits::Bytes> textureLogThreshold); + void setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold); bool has(const LLUUID& id); void setRequestStartTime(const LLUUID& id, U64 startTime); void setRequestSize(const LLUUID& id, U32 size); void setRequestOffset(const LLUUID& id, U32 offset); void setRequestType(const LLUUID& id, LLTextureInfoDetails::LLRequestType type); - void setRequestCompleteTimeAndLog(const LLUUID& id, LLUnit<U64, LLUnits::Microseconds> completeTime); - LLUnit<U32, LLUnits::Microseconds>getRequestStartTime(const LLUUID& id); - LLUnit<U32, LLUnits::Bytes> getRequestSize(const LLUUID& id); + void setRequestCompleteTimeAndLog(const LLUUID& id, U64Microseconds completeTime); + U32Microseconds getRequestStartTime(const LLUUID& id); + U32Bytes getRequestSize(const LLUUID& id); U32 getRequestOffset(const LLUUID& id); LLTextureInfoDetails::LLRequestType getRequestType(const LLUUID& id); - LLUnit<U32, LLUnits::Microseconds> getRequestCompleteTime(const LLUUID& id); + U32Microseconds getRequestCompleteTime(const LLUUID& id); void resetTextureStatistics(); U32 getTextureInfoMapSize(); LLSD getAverages(); @@ -62,8 +62,8 @@ private: bool mLogTextureDownloadsToViewerLog, mLogTextureDownloadsToSimulator; std::string mTextureDownloadProtocol; - LLUnit<U32, LLUnits::Bytes> mTextureLogThreshold; - LLUnit<U64, LLUnits::Microseconds> mCurrentStatsBundleStartTime; + U32Bytes mTextureLogThreshold; + U64Microseconds mCurrentStatsBundleStartTime; LLTrace::Recording mRecording; }; diff --git a/indra/newview/lltextureinfodetails.h b/indra/newview/lltextureinfodetails.h index 28e957a7df..0ad95eb94e 100755 --- a/indra/newview/lltextureinfodetails.h +++ b/indra/newview/lltextureinfodetails.h @@ -39,10 +39,10 @@ struct LLTextureInfoDetails REQUEST_TYPE_UDP }; - LLUnit<U32, LLUnits::Microseconds> mStartTime, + U32Microseconds mStartTime, mCompleteTime; U32 mOffset; - LLUnit<U32, LLUnits::Bytes> mSize; + U32Bytes mSize; LLRequestType mType; LLTextureInfoDetails(); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 501914a52f..f39d41c2b8 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -507,17 +507,17 @@ private: void LLGLTexMemBar::draw() { - LLUnit<S32, LLUnits::Mibibytes> bound_mem = LLViewerTexture::sBoundTextureMemory; - LLUnit<S32, LLUnits::Mibibytes> max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; - LLUnit<S32, LLUnits::Mibibytes> total_mem = LLViewerTexture::sTotalTextureMemory; - LLUnit<S32, LLUnits::Mibibytes> max_total_mem = LLViewerTexture::sMaxTotalTextureMem; + S32Mibibytes bound_mem = LLViewerTexture::sBoundTextureMemory; + S32Mibibytes max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; + S32Mibibytes total_mem = LLViewerTexture::sTotalTextureMemory; + S32Mibibytes max_total_mem = LLViewerTexture::sMaxTotalTextureMem; F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; - F32 cache_usage = (F32)LLUnit<F32, LLUnits::Mibibytes>(LLAppViewer::getTextureCache()->getUsage()).value() ; - F32 cache_max_usage = (F32)LLUnit<F32, LLUnits::Mibibytes>(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; + F32 cache_usage = (F32)F32Mibibytes(LLAppViewer::getTextureCache()->getUsage()).value() ; + F32 cache_max_usage = (F32)F32Mibibytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; S32 line_height = LLFontGL::getFontMonospace()->getLineHeight(); S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); - LLUnit<F32, LLUnits::Bytes> total_texture_downloaded = gTotalTextureData; - LLUnit<F32, LLUnits::Bytes> total_object_downloaded = gTotalObjectData; + F32Bytes total_texture_downloaded = gTotalTextureData; + F32Bytes total_object_downloaded = gTotalObjectData; U32 total_http_requests = LLAppViewer::getTextureFetch()->getTotalNumHTTPRequests(); U32 total_active_cached_objects = LLWorld::getInstance()->getNumOfActiveCachedObjects(); U32 total_objects = gObjectList.getNumObjects(); @@ -586,8 +586,8 @@ void LLGLTexMemBar::draw() left = 550; - LLUnit<F32, LLUnits::Kibibits> bandwidth = LLAppViewer::getTextureFetch()->getTextureBandwidth(); - LLUnit<F32, LLUnits::Kibibits> max_bandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); + F32Kibibits bandwidth = LLAppViewer::getTextureFetch()->getTextureBandwidth(); + F32Kibibits max_bandwidth(gSavedSettings.getF32("ThrottleBandwidthKBPS")); color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color; color[VALPHA] = text_color[VALPHA]; text = llformat("BW:%.0f/%.0f",bandwidth.value(), max_bandwidth.value()); diff --git a/indra/newview/lltoolview.cpp b/indra/newview/lltoolview.cpp index 8c40ff3cb3..678e2c241a 100755 --- a/indra/newview/lltoolview.cpp +++ b/indra/newview/lltoolview.cpp @@ -179,7 +179,7 @@ LLToolContainer* LLToolView::findToolContainer( LLTool *tool ) return contain; } } - llerrs << "LLToolView::findToolContainer - tool not found" << llendl; + LL_ERRS() << "LLToolView::findToolContainer - tool not found" << LL_ENDL; return NULL; } diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index 579567bb14..e009863002 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -233,7 +233,7 @@ namespace LLViewerAssetStatsFF &sDequeuedAssetRequestsOther }; - static LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> > sResponseAssetRequestsTempTextureHTTP ("assetresponsetimestemptexturehttp", + static LLTrace::EventStatHandle<F64Seconds > sResponseAssetRequestsTempTextureHTTP ("assetresponsetimestemptexturehttp", "Time spent responding to temporary texture asset http requests"), sResponseAssetRequestsTempTextureUDP ("assetresponsetimestemptextureudp", "Time spent responding to temporary texture asset udp requests"), @@ -250,7 +250,7 @@ namespace LLViewerAssetStatsFF sResponsedAssetRequestsOther ("assetresponsetimesother", "Time spent responding to other asset requests"); - static LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> >* sResponse[EVACCount] = { + static LLTrace::EventStatHandle<F64Seconds >* sResponse[EVACCount] = { &sResponseAssetRequestsTempTextureHTTP, &sResponseAssetRequestsTempTextureUDP, &sResponseAssetRequestsNonTempTextureHTTP, @@ -487,10 +487,10 @@ void LLViewerAssetStats::getStats(AssetStats& stats, bool compact_output) grid_from_region_handle(it->first, &grid_x, &grid_y); r .grid_x(grid_x) .grid_y(grid_y) - .duration(LLUnit<F64, LLUnits::Microseconds>(rec.getDuration()).value()); + .duration(F64Microseconds(rec.getDuration()).value()); } - stats.duration(mCurRecording ? LLUnit<F64, LLUnits::Microseconds>(mCurRecording->getDuration()).value() : 0.0); + stats.duration(mCurRecording ? F64Microseconds(mCurRecording->getDuration()).value() : 0.0); } LLSD LLViewerAssetStats::asLLSD(bool compact_output) @@ -540,7 +540,7 @@ void record_response(LLViewerAssetType::EType at, bool with_http, bool is_temp, { const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp)); - record(*sResponse[int(eac)], LLUnit<F64, LLUnits::Microseconds>(duration)); + record(*sResponse[int(eac)], F64Microseconds(duration)); } void init() diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index a42060d4d8..aaa299bf4b 100755 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -82,7 +82,7 @@ public: * for compatibility with the pre-existing timestamp on the texture * fetcher class, LLTextureFetch. */ - typedef LLUnit<U64, LLUnits::Microseconds> duration_t; + typedef U64Microseconds duration_t; /** * Type for the region identifier used in stats. Currently uses diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 5523b541a9..d0491450dc 100755 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -287,7 +287,7 @@ static bool handleMaxPartCountChanged(const LLSD& newvalue) static bool handleVideoMemoryChanged(const LLSD& newvalue) { - gTextureList.updateMaxResidentTexMem(newvalue.asInteger()); + gTextureList.updateMaxResidentTexMem(S32Mibibytes(newvalue.asInteger())); return true; } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 965c6ffbc6..cb5078b988 100755 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -221,8 +221,8 @@ void display_stats() if (mem_log_freq > 0.f && gRecentMemoryTime.getElapsedTimeF32() >= mem_log_freq) { gMemoryAllocated = LLMemory::getCurrentRSS(); - U32 memory = (U32)(gMemoryAllocated / (1024*1024)); - LL_INFOS() << llformat("MEMORY: %d MB", memory) << LL_ENDL; + U32Mibibytes memory = gMemoryAllocated; + LL_INFOS() << llformat("MEMORY: %d MB", memory.value()) << LL_ENDL; LLMemory::logMemoryInfo(TRUE) ; gRecentMemoryTime.reset(); } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f12df23a36..6c435bf147 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4487,18 +4487,18 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) // *TODO: Remove this dependency, or figure out a better way to handle // this hack. -extern LLUnit<U32, LLUnits::Bits> gObjectData; +extern U32Bits gObjectData; void process_object_update(LLMessageSystem *mesgsys, void **user_data) { // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveCompressedSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveSize(); } // Update the object... @@ -4510,11 +4510,11 @@ void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveCompressedSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveSize(); } // Update the object... @@ -4526,11 +4526,11 @@ void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data) // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveCompressedSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveSize(); } // Update the object... @@ -4542,11 +4542,11 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_ { if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveCompressedSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveSize(); } gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_TERSE_IMPROVED); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3d75f86154..b054e519e0 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -119,8 +119,8 @@ BOOL LLViewerObject::sPulseEnabled(FALSE); BOOL LLViewerObject::sUseSharedDrawables(FALSE); // TRUE // sMaxUpdateInterpolationTime must be greater than sPhaseOutUpdateInterpolationTime -F64 LLViewerObject::sMaxUpdateInterpolationTime = 3.0; // For motion interpolation: after X seconds with no updates, don't predict object motion -F64 LLViewerObject::sPhaseOutUpdateInterpolationTime = 2.0; // For motion interpolation: after Y seconds with no updates, taper off motion prediction +F64Seconds LLViewerObject::sMaxUpdateInterpolationTime(3.0); // For motion interpolation: after X seconds with no updates, don't predict object motion +F64Seconds LLViewerObject::sPhaseOutUpdateInterpolationTime(2.0); // For motion interpolation: after Y seconds with no updates, taper off motion prediction std::map<std::string, U32> LLViewerObject::sObjectDataMap; @@ -2190,7 +2190,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mesgsys->getSender()); if (cdp) { - F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay()) * 0.001f + gFrameDTClamped); + F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay().valueInUnits<LLUnits::Seconds>()) + gFrameDTClamped); LLVector3 diff = getVelocity() * ping_delay; new_pos_parent += diff; } @@ -2491,7 +2491,7 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt) if (cdp) { // Find out how many seconds since last packet arrived on the circuit - F64 time_since_last_packet = LLMessageSystem::getMessageTimeSeconds() - cdp->getLastPacketInTime(); + F64Seconds time_since_last_packet = LLMessageSystem::getMessageTimeSeconds() - cdp->getLastPacketInTime(); if (!cdp->isAlive() || // Circuit is dead or blocked cdp->isBlocked() || // or doesn't seem to be getting any packets diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 5556a4c7d3..3943709049 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -780,7 +780,7 @@ protected: mutable LLVector3 mPositionRegion; mutable LLVector3 mPositionAgent; - static void setPhaseOutUpdateInterpolationTime(F32 value) { sPhaseOutUpdateInterpolationTime = (F64) value; } + static void setPhaseOutUpdateInterpolationTime(F32 value) { sPhaseOutUpdateInterpolationTime = (F64Seconds) value; } static void setMaxUpdateInterpolationTime(F32 value) { sMaxUpdateInterpolationTime = (F64) value; } static void setVelocityInterpolate(BOOL value) { sVelocityInterpolate = value; } @@ -789,8 +789,8 @@ protected: private: static S32 sNumObjects; - static F64 sPhaseOutUpdateInterpolationTime; // For motion interpolation - static F64 sMaxUpdateInterpolationTime; // For motion interpolation + static F64Seconds sPhaseOutUpdateInterpolationTime; // For motion interpolation + static F64Seconds sMaxUpdateInterpolationTime; // For motion interpolation static BOOL sVelocityInterpolate; static BOOL sPingInterpolate; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index e8f68527e9..4643430c6b 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -995,13 +995,13 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) // update global timer F32 last_time = gFrameTimeSeconds; - LLUnit<U64, LLUnits::Microseconds> time = totalTime(); // this will become the new gFrameTime when the update is done + U64Microseconds time = totalTime(); // this will become the new gFrameTime when the update is done // Time _can_ go backwards, for example if the user changes the system clock. // It doesn't cause any fatal problems (just some oddness with stats), so we shouldn't assert here. // llassert(time > gFrameTime); - LLUnit<F64, LLUnits::Seconds> time_diff = time - gFrameTime; + F64Seconds time_diff = time - gFrameTime; gFrameTime = time; - LLUnit<F64, LLUnits::Seconds> time_since_start = gFrameTime - gStartTime; + F64Seconds time_since_start = gFrameTime - gStartTime; gFrameTimeSeconds = time_since_start; gFrameIntervalSeconds = gFrameTimeSeconds - last_time; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 9d2a333b1b..e07c2aa8d0 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -401,7 +401,7 @@ public: LLWind mWind; LLViewerParcelOverlay *mParcelOverlay; - F32 mBitsReceived; + F32Bits mBitsReceived; F32 mPacketsReceived; LLMatrix4 mRenderMatrix; @@ -436,14 +436,14 @@ private: BOOL mIsEstateManager; U32 mPacketsIn; - U32 mBitsIn; - U32 mLastBitsIn; + U32Bits mBitsIn, + mLastBitsIn; U32 mLastPacketsIn; U32 mPacketsOut; U32 mLastPacketsOut; S32 mPacketsLost; S32 mLastPacketsLost; - U32 mPingDelay; + U32Milliseconds mPingDelay; F32 mDeltaTime; // Time since last measurement of lastPackets, Bits, etc U64 mRegionFlags; // includes damage flags diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 8cb519b098..bb2c13df33 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -95,7 +95,7 @@ LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kilotriangles> > LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Kilotriangles> > TRIANGLES_DRAWN_PER_FRAME("trianglesdrawnperframestat"); -LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibytes> > +LLTrace::CountStatHandle<F64Kibibytes > ACTIVE_MESSAGE_DATA_RECEIVED("activemessagedatareceived", "Message system data received on all active regions"), LAYERS_NETWORK_DATA_RECEIVED("layersdatareceived", "Network data received for layer data (terrain)"), OBJECT_NETWORK_DATA_RECEIVED("objectdatareceived", "Network data received for objects"), @@ -104,7 +104,7 @@ LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibytes> > MESSAGE_SYSTEM_DATA_IN("messagedatain", "Incoming message system network data"), MESSAGE_SYSTEM_DATA_OUT("messagedataout", "Outgoing message system network data"); -LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Seconds> > +LLTrace::CountStatHandle<F64Seconds > SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); @@ -152,15 +152,15 @@ LLTrace::SampleStatHandle<LLUnit<F32, LLUnits::Percent> > static LLTrace::SampleStatHandle<bool> CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); -LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Megabytes> > GL_TEX_MEM("gltexmemstat"), +LLTrace::SampleStatHandle<F64Megabytes > GL_TEX_MEM("gltexmemstat"), GL_BOUND_MEM("glboundmemstat"), RAW_MEM("rawmemstat"), FORMATTED_MEM("formattedmemstat"); -LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Kibibytes> > DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), +LLTrace::SampleStatHandle<F64Kibibytes > DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); -SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> > SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), +SimMeasurement<F64Milliseconds > SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), @@ -175,10 +175,10 @@ SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> > SIM_FRAME_TIME("simframemsec SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -SimMeasurement<LLUnit<F64, LLUnits::Kilobytes> > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES); -SimMeasurement<LLUnit<F64, LLUnits::Megabytes> > SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); +SimMeasurement<F64Kilobytes > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES); +SimMeasurement<F64Megabytes > SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); -LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Milliseconds> > FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), +LLTrace::SampleStatHandle<F64Milliseconds > FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), SIM_PING("simpingstat"); @@ -186,7 +186,7 @@ LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SNAP("age LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"); -LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), +LLTrace::EventStatHandle<F64Milliseconds > REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), FRAME_STACKTIME("framestacktime", "FRAME_SECS"), UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), @@ -194,7 +194,7 @@ LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > REGION_CROSSING_TI REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); -LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> > AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), +LLTrace::EventStatHandle<F64Seconds > AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), FPS_10_TIME("fps10time", "Seconds below 10 FPS"), @@ -219,7 +219,7 @@ void LLViewerStats::resetStats() LLViewerStats::instance().mRecording.reset(); } -void LLViewerStats::updateFrameStats(const LLUnit<F64, LLUnits::Seconds> time_diff) +void LLViewerStats::updateFrameStats(const F64Seconds time_diff) { if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) { @@ -258,15 +258,15 @@ void LLViewerStats::updateFrameStats(const LLUnit<F64, LLUnits::Seconds> time_di add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); // old stats that were never really used - sample(LLStatViewer::FRAMETIME_JITTER, LLUnit<F64, LLUnits::Milliseconds> (mLastTimeDiff - time_diff)); + sample(LLStatViewer::FRAMETIME_JITTER, F64Milliseconds (mLastTimeDiff - time_diff)); F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; - sample(LLStatViewer::FRAMETIME_SLEW, LLUnit<F64, LLUnits::Milliseconds> (average_frametime - time_diff)); + sample(LLStatViewer::FRAMETIME_SLEW, F64Milliseconds (average_frametime - time_diff)); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; - sample(LLStatViewer::DELTA_BANDWIDTH, LLUnit<F64, LLUnits::Bits>(delta_bandwidth)); - sample(LLStatViewer::MAX_BANDWIDTH, LLUnit<F64, LLUnits::Bits>(max_bandwidth)); + sample(LLStatViewer::DELTA_BANDWIDTH, F64Bits(delta_bandwidth)); + sample(LLStatViewer::MAX_BANDWIDTH, F64Bits(max_bandwidth)); } mLastTimeDiff = time_diff; @@ -299,13 +299,13 @@ F32 gAveLandCompression = 0.f, gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; -LLUnit<U32, LLUnits::Bytes> gTotalWorldData = 0, - gTotalObjectData = 0, - gTotalTextureData = 0; +U32Bytes gTotalWorldData, + gTotalObjectData, + gTotalTextureData; U32 gSimPingCount = 0; -LLUnit<U32, LLUnits::Bits> gObjectData = 0; -F32 gAvgSimPing = 0.f; -LLUnit<U32, LLUnits::Bytes> gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +U32Bits gObjectData; +F32Milliseconds gAvgSimPing(0.f); +U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)}; extern U32 gVisCompared; extern U32 gVisTested; @@ -345,8 +345,8 @@ void update_statistics() typedef LLInstanceTracker<LLTrace::TraceType<LLTrace::TimeBlockAccumulator>, std::string> trace_type_t; - LLUnit<F64, LLUnits::Seconds> idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); - LLUnit<F64, LLUnits::Seconds> network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); + F64Seconds idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); + F64Seconds network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame"))); record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); @@ -358,13 +358,13 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - sample(LLStatViewer::SIM_PING, LLUnit<F64, LLUnits::Milliseconds> (cdp->getPingDelay())); - gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); + sample(LLStatViewer::SIM_PING, F64Milliseconds (cdp->getPingDelay())); + gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay().value())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - sample(LLStatViewer::SIM_PING, LLUnits::Seconds::fromValue(10)); + sample(LLStatViewer::SIM_PING, U32Seconds(10)); } if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS)) @@ -374,10 +374,10 @@ void update_statistics() add(LLStatViewer::FPS, 1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, LLUnit<F64, LLUnits::Bits>(layer_bits)); + add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, F64Bits(layer_bits)); add(LLStatViewer::OBJECT_NETWORK_DATA_RECEIVED, gObjectData); sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending()); - add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, LLUnit<F64, LLUnits::Bits>(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); + add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, F64Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -494,14 +494,14 @@ void send_stats() gSimFrames = (F32) gFrameCount; agent["agents_in_view"] = LLVOAvatar::sNumVisibleAvatars; - agent["ping"] = gAvgSimPing; + agent["ping"] = gAvgSimPing.value(); agent["meters_traveled"] = gAgent.getDistanceTraveled(); agent["regions_visited"] = gAgent.getRegionsVisited(); agent["mem_use"] = LLMemory::getCurrentRSS() / 1024.0; LLSD &system = body["system"]; - system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB(); + system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB().value(); system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); system["cpu"] = gSysCPU.getCPUString(); unsigned char MACAddress[MAC_ADDRESS_BYTES]; @@ -553,9 +553,9 @@ void send_stats() LLSD &download = body["downloads"]; - download["world_kbytes"] = LLUnit<F64, LLUnits::Kibibytes>(gTotalWorldData).value(); - download["object_kbytes"] = LLUnit<F64, LLUnits::Kibibytes>(gTotalObjectData).value(); - download["texture_kbytes"] = LLUnit<F64, LLUnits::Kibibytes>(gTotalTextureData).value(); + download["world_kbytes"] = F64Kibibytes(gTotalWorldData).value(); + download["object_kbytes"] = F64Kibibytes(gTotalObjectData).value(); + download["texture_kbytes"] = F64Kibibytes(gTotalTextureData).value(); download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index b580606326..42c56e8835 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -142,7 +142,7 @@ extern LLTrace::CountStatHandle<> FPS, extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kilotriangles> > TRIANGLES_DRAWN; -extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibytes> > ACTIVE_MESSAGE_DATA_RECEIVED, +extern LLTrace::CountStatHandle<F64Kibibytes > ACTIVE_MESSAGE_DATA_RECEIVED, LAYERS_NETWORK_DATA_RECEIVED, OBJECT_NETWORK_DATA_RECEIVED, ASSET_UDP_DATA_RECEIVED, @@ -150,7 +150,7 @@ extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibytes> > ACTIVE_MESSAGE MESSAGE_SYSTEM_DATA_IN, MESSAGE_SYSTEM_DATA_OUT; -extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Seconds> > SIM_20_FPS_TIME, +extern LLTrace::CountStatHandle<F64Seconds > SIM_20_FPS_TIME, SIM_PHYSICS_20_FPS_TIME, LOSS_5_PERCENT_TIME; @@ -192,13 +192,13 @@ extern LLTrace::SampleStatHandle<> FPS_SAMPLE, extern LLTrace::SampleStatHandle<LLUnit<F32, LLUnits::Percent> > PACKETS_LOST_PERCENT; -extern LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Megabytes> > GL_TEX_MEM, +extern LLTrace::SampleStatHandle<F64Megabytes > GL_TEX_MEM, GL_BOUND_MEM, RAW_MEM, FORMATTED_MEM; -extern LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Kibibytes> > DELTA_BANDWIDTH, +extern LLTrace::SampleStatHandle<F64Kibibytes > DELTA_BANDWIDTH, MAX_BANDWIDTH; -extern SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> > SIM_FRAME_TIME, +extern SimMeasurement<F64Milliseconds > SIM_FRAME_TIME, SIM_NET_TIME, SIM_OTHER_TIME, SIM_PHYSICS_TIME, @@ -213,11 +213,11 @@ extern SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> > SIM_FRAME_TIME, SIM_SLEEP_TIME, SIM_PUMP_IO_TIME; -extern SimMeasurement<LLUnit<F64, LLUnits::Kilobytes> > SIM_UNACKED_BYTES; -extern SimMeasurement<LLUnit<F64, LLUnits::Megabytes> > SIM_PHYSICS_MEM; +extern SimMeasurement<F64Kilobytes > SIM_UNACKED_BYTES; +extern SimMeasurement<F64Megabytes > SIM_PHYSICS_MEM; -extern LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Milliseconds> > FRAMETIME_JITTER, +extern LLTrace::SampleStatHandle<F64Milliseconds > FRAMETIME_JITTER, FRAMETIME_SLEW, SIM_PING; @@ -225,7 +225,7 @@ extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SN extern LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY; -extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > REGION_CROSSING_TIME, +extern LLTrace::EventStatHandle<F64Milliseconds > REGION_CROSSING_TIME, FRAME_STACKTIME, UPDATE_STACKTIME, NETWORK_STACKTIME, @@ -233,7 +233,7 @@ extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > REGION_CROS REBUILD_STACKTIME, RENDER_STACKTIME; -extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> > AVATAR_EDIT_TIME, +extern LLTrace::EventStatHandle<F64Seconds > AVATAR_EDIT_TIME, TOOLBOX_TIME, MOUSELOOK_TIME, FPS_10_TIME, @@ -254,7 +254,7 @@ public: LLViewerStats(); ~LLViewerStats(); - void updateFrameStats(const LLUnit<F64, LLUnits::Seconds> time_diff); + void updateFrameStats(const F64Seconds time_diff); void addToMessage(LLSD &body); @@ -370,7 +370,7 @@ public: private: LLTrace::Recording mRecording; - LLUnit<F64, LLUnits::Seconds> mLastTimeDiff; // used for time stat updates + F64Seconds mLastTimeDiff; // used for time stat updates }; static const F32 SEND_STATS_PERIOD = 300.0f; @@ -380,7 +380,7 @@ void update_statistics(); void send_stats(); extern LLFrameTimer gTextureTimer; -extern LLUnit<U32, LLUnits::Bytes> gTotalTextureData; -extern LLUnit<U32, LLUnits::Bytes> gTotalObjectData; -extern LLUnit<U32, LLUnits::Bytes> gTotalTextureBytesPerBoostLevel[] ; +extern U32Bytes gTotalTextureData; +extern U32Bytes gTotalObjectData; +extern U32Bytes gTotalTextureBytesPerBoostLevel[] ; #endif // LL_LLVIEWERSTATS_H diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index eb8faacac2..4290d338c1 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -63,8 +63,8 @@ /////////////////////////////////////////////////////////////////////////////// // extern -const LLUnit<S32, LLUnits::Mibibytes> gMinVideoRam = 32; -const LLUnit<S32, LLUnits::Mibibytes> gMaxVideoRam = 512; +const S32Mibibytes gMinVideoRam(32); +const S32Mibibytes gMaxVideoRam(512); // statics @@ -86,11 +86,11 @@ S32 LLViewerTexture::sAuxCount = 0; LLFrameTimer LLViewerTexture::sEvaluationTimer; F32 LLViewerTexture::sDesiredDiscardBias = 0.f; F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; -LLUnit<S32, LLUnits::Bytes> LLViewerTexture::sBoundTextureMemory = 0; -LLUnit<S32, LLUnits::Bytes> LLViewerTexture::sTotalTextureMemory = 0; -LLUnit<S32, LLUnits::Mibibytes> LLViewerTexture::sMaxBoundTextureMem = 0; -LLUnit<S32, LLUnits::Mibibytes> LLViewerTexture::sMaxTotalTextureMem = 0; -LLUnit<S32, LLUnits::Bytes> LLViewerTexture::sMaxDesiredTextureMem = 0 ; +S32Bytes LLViewerTexture::sBoundTextureMemory; +S32Bytes LLViewerTexture::sTotalTextureMemory; +S32Mibibytes LLViewerTexture::sMaxBoundTextureMem; +S32Mibibytes LLViewerTexture::sMaxTotalTextureMem; +S32Bytes LLViewerTexture::sMaxDesiredTextureMem; S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ; F32 LLViewerTexture::sCameraMovingBias = 0.0f ; S32 LLViewerTexture::sMaxSculptRez = 128 ; //max sculpt image size @@ -530,17 +530,17 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity LLViewerMediaTexture::updateClass() ; } - sBoundTextureMemory = LLImageGL::sBoundTextureMemory;//in bytes - sTotalTextureMemory = LLImageGL::sGlobalTextureMemory;//in bytes - sMaxBoundTextureMem = gTextureList.getMaxResidentTexMem();//in MB - sMaxTotalTextureMem = gTextureList.getMaxTotalTextureMem() ;//in MB + sBoundTextureMemory = LLImageGL::sBoundTextureMemory; + sTotalTextureMemory = LLImageGL::sGlobalTextureMemory; + sMaxBoundTextureMem = gTextureList.getMaxResidentTexMem(); + sMaxTotalTextureMem = gTextureList.getMaxTotalTextureMem(); sMaxDesiredTextureMem = sMaxTotalTextureMem ; //in Bytes, by default and when total used texture memory is small. if (sBoundTextureMemory >= sMaxBoundTextureMem || sTotalTextureMemory >= sMaxTotalTextureMem) { //when texture memory overflows, lower down the threshold to release the textures more aggressively. - sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, LLUnit<S32, LLUnits::Bytes>(gMaxVideoRam)); + sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, S32Bytes(gMaxVideoRam)); // If we are using more texture memory than we should, // scale up the desired discard level diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b0eae7c071..9a00ccd8c6 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -38,8 +38,8 @@ #include <map> #include <list> -extern const LLUnit<S32, LLUnits::Mibibytes> gMinVideoRam; -extern const LLUnit<S32, LLUnits::Mibibytes> gMaxVideoRam; +extern const S32Mibibytes gMinVideoRam; +extern const S32Mibibytes gMaxVideoRam; class LLImageGL ; class LLImageRaw; @@ -205,11 +205,11 @@ public: static LLFrameTimer sEvaluationTimer; static F32 sDesiredDiscardBias; static F32 sDesiredDiscardScale; - static LLUnit<S32, LLUnits::Bytes> sBoundTextureMemory; - static LLUnit<S32, LLUnits::Bytes> sTotalTextureMemory; - static LLUnit<S32, LLUnits::Mibibytes> sMaxBoundTextureMem; - static LLUnit<S32, LLUnits::Mibibytes> sMaxTotalTextureMem; - static LLUnit<S32, LLUnits::Bytes> sMaxDesiredTextureMem ; + static S32Bytes sBoundTextureMemory; + static S32Bytes sTotalTextureMemory; + static S32Mibibytes sMaxBoundTextureMem; + static S32Mibibytes sMaxTotalTextureMem; + static S32Bytes sMaxDesiredTextureMem ; static S8 sCameraMovingDiscardBias; static F32 sCameraMovingBias; static S32 sMaxSculptRez ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 209334fb46..046dfd6eaf 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -90,7 +90,7 @@ void LLViewerTextureList::init() mMaxTotalTextureMemInMegaBytes = 0 ; // Update how much texture RAM we're allowed to use. - updateMaxResidentTexMem(0); // 0 = use current + updateMaxResidentTexMem(S32Mibibytes(0)); // 0 = use current doPreloadImages(); } @@ -671,8 +671,8 @@ void LLViewerTextureList::updateImages(F32 max_time) sample(NUM_RAW_IMAGES, LLImageRaw::sRawImageCount); sample(GL_TEX_MEM, LLImageGL::sGlobalTextureMemory); sample(GL_BOUND_MEM, LLImageGL::sBoundTextureMemory); - sample(RAW_MEM, LLUnit<F64, LLUnits::Bytes>(LLImageRaw::sGlobalRawMemory)); - sample(FORMATTED_MEM, LLUnit<F64, LLUnits::Bytes>(LLImageFormatted::sGlobalFormattedMemory)); + sample(RAW_MEM, F64Bytes(LLImageRaw::sGlobalRawMemory)); + sample(FORMATTED_MEM, F64Bytes(LLImageFormatted::sGlobalFormattedMemory)); } { @@ -1237,28 +1237,28 @@ const S32 MIN_VIDEO_RAM = 32; const S32 MAX_VIDEO_RAM = 512; // 512MB max for performance reasons. // Returns min setting for TextureMemory (in MB) -S32 LLViewerTextureList::getMinVideoRamSetting() +S32Mibibytes LLViewerTextureList::getMinVideoRamSetting() { - S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); + S32Mibibytes system_ram = gSysMemory.getPhysicalMemoryClamped(); //min texture mem sets to 64M if total physical mem is more than 1.5GB - return (system_ram > 1500) ? 64 : gMinVideoRam.value() ; + return (system_ram > S32Mibibytes(1500)) ? S32Mibibytes(64) : gMinVideoRam ; } //static // Returns max setting for TextureMemory (in MB) -S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) +S32Mibibytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) { - S32 max_texmem; + S32Mibibytes max_texmem; if (gGLManager.mVRAM != 0) { // Treat any card with < 32 MB (shudder) as having 32 MB // - it's going to be swapping constantly regardless - S32 max_vram = gGLManager.mVRAM; + S32Mibibytes max_vram(gGLManager.mVRAM); if(gGLManager.mIsATI) { //shrink the availabe vram for ATI cards because some of them do not handel texture swapping well. - max_vram = (S32)(max_vram * 0.75f); + max_vram = max_vram * 0.75f; } max_vram = llmax(max_vram, getMinVideoRamSetting()); @@ -1284,26 +1284,26 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) LL_WARNS() << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << LL_ENDL; } - S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); // In MB + S32Mibibytes system_ram = gSysMemory.getPhysicalMemoryClamped(); // In MB //LL_INFOS() << "*** DETECTED " << system_ram << " MB of system memory." << LL_ENDL; if (get_recommended) - max_texmem = llmin(max_texmem, (S32)(system_ram/2)); + max_texmem = llmin(max_texmem, system_ram/2); else - max_texmem = llmin(max_texmem, (S32)(system_ram)); + max_texmem = llmin(max_texmem, system_ram); - max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), gMaxVideoRam.value()); + max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), gMaxVideoRam); return max_texmem; } -const S32 VIDEO_CARD_FRAMEBUFFER_MEM = 12; // MB -const S32 MIN_MEM_FOR_NON_TEXTURE = 512 ; //MB -void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) +const S32Mibibytes VIDEO_CARD_FRAMEBUFFER_MEM(12); +const S32Mibibytes MIN_MEM_FOR_NON_TEXTURE(512); +void LLViewerTextureList::updateMaxResidentTexMem(S32Mibibytes mem) { // Initialize the image pipeline VRAM settings - S32 cur_mem = gSavedSettings.getS32("TextureMemory"); + S32Mibibytes cur_mem(gSavedSettings.getS32("TextureMemory")); F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); - S32 default_mem = getMaxVideoRamSetting(true); // recommended default + S32Mibibytes default_mem(getMaxVideoRamSetting(true)); // recommended default if (mem == 0) { mem = cur_mem > 0 ? cur_mem : default_mem; @@ -1314,35 +1314,35 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) } // limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise - mem = llmin(mem, (S32) (mem_multiplier * (F32) default_mem)); + mem = llmin(mem, S32Mibibytes(mem_multiplier * (F32Mibibytes)default_mem)); mem = llclamp(mem, getMinVideoRamSetting(), getMaxVideoRamSetting()); if (mem != cur_mem) { - gSavedSettings.setS32("TextureMemory", mem); + gSavedSettings.setS32("TextureMemory", mem.value()); return; //listener will re-enter this function } // TODO: set available resident texture mem based on use by other subsystems // currently max(12MB, VRAM/4) assumed... - S32 vb_mem = mem; - S32 fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4); + S32Mibibytes vb_mem = mem; + S32Mibibytes fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4); mMaxResidentTexMemInMegaBytes = (vb_mem - fb_mem) ; //in MB mMaxTotalTextureMemInMegaBytes = mMaxResidentTexMemInMegaBytes * 2; if (mMaxResidentTexMemInMegaBytes > 640) { - mMaxTotalTextureMemInMegaBytes -= (mMaxResidentTexMemInMegaBytes >> 2); + mMaxTotalTextureMemInMegaBytes -= (mMaxResidentTexMemInMegaBytes / 4); } //system mem - S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); // In MB + S32Mibibytes system_ram = gSysMemory.getPhysicalMemoryClamped(); //minimum memory reserved for non-texture use. //if system_raw >= 1GB, reserve at least 512MB for non-texture use; //otherwise reserve half of the system_ram for non-texture use. - S32 min_non_texture_mem = llmin(system_ram / 2, MIN_MEM_FOR_NON_TEXTURE) ; + S32Mibibytes min_non_texture_mem = llmin(system_ram / 2, MIN_MEM_FOR_NON_TEXTURE) ; if (mMaxTotalTextureMemInMegaBytes > system_ram - min_non_texture_mem) { @@ -1379,7 +1379,7 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d { received_size = msg->getReceiveSize() ; } - add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, LLUnit<F64, LLUnits::Bytes>(received_size)); + add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, F64Bytes(received_size)); add(LLStatViewer::TEXTURE_PACKETS, 1); U8 codec; @@ -1453,7 +1453,7 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d received_size = msg->getReceiveSize() ; } - add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, LLUnit<F64, LLUnits::Bytes>(received_size)); + add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, F64Bytes(received_size)); add(LLStatViewer::TEXTURE_PACKETS, 1); //llprintline("Start decode, image header..."); @@ -1520,18 +1520,19 @@ void LLViewerTextureList::processImageNotInDatabase(LLMessageSystem *msg,void ** /////////////////////////////////////////////////////////////////////////////// //static -const U32 SIXTEEN_MEG = 0x1000000; -S32 LLViewerTextureList::calcMaxTextureRAM() +const LLUnitImplicit<F32, LLUnits::Mibibytes> SIXTEEN_MEG(16); +S32Bytes LLViewerTextureList::calcMaxTextureRAM() { // Decide the maximum amount of RAM we should allow the user to allocate to texture cache LLMemoryInfo memory_info; - U32 available_memory = memory_info.getPhysicalMemoryClamped(); + LLUnitImplicit<F32, LLUnits::Mibibytes> available_memory = memory_info.getPhysicalMemoryClamped(); - clamp_rescale((F32)available_memory, - (F32)(SIXTEEN_MEG * 16), - (F32)U32_MAX, - (F32)(SIXTEEN_MEG * 4), - (F32)(U32_MAX >> 1)); + // as originally written, this code was a no-op. Not sure of the side effect of making it actually work + /*clamp_rescale(available_memory.value(), + (SIXTEEN_MEG * 16), + (F32Mibibytes)U32_MAX, + (SIXTEEN_MEG * 4), + (F32Mibibytes)(U32_MAX >> 1));*/ return available_memory; } diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 5b6e927e32..9817fea811 100755 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -71,7 +71,7 @@ public: static BOOL createUploadFile(const std::string& filename, const std::string& out_filename, const U8 codec); static LLPointer<LLImageJ2C> convertToUploadFile(LLPointer<LLImageRaw> raw_image); static void processImageNotInDatabase( LLMessageSystem *msg, void **user_data ); - static S32 calcMaxTextureRAM(); + static S32Bytes calcMaxTextureRAM(); static void receiveImageHeader(LLMessageSystem *msg, void **user_data); static void receiveImagePacket(LLMessageSystem *msg, void **user_data); @@ -101,11 +101,11 @@ public: void setUpdateStats(BOOL b) { mUpdateStats = b; } - S32 getMaxResidentTexMem() const { return mMaxResidentTexMemInMegaBytes; } - S32 getMaxTotalTextureMem() const { return mMaxTotalTextureMemInMegaBytes;} + S32Mibibytes getMaxResidentTexMem() const { return mMaxResidentTexMemInMegaBytes; } + S32Mibibytes getMaxTotalTextureMem() const { return mMaxTotalTextureMemInMegaBytes;} S32 getNumImages() { return mImageList.size(); } - void updateMaxResidentTexMem(S32 mem); + void updateMaxResidentTexMem(S32Mibibytes mem); void doPreloadImages(); void doPrefetchImages(); @@ -113,8 +113,8 @@ public: void clearFetchingRequests(); void setDebugFetching(LLViewerFetchedTexture* tex, S32 debug_level); - static S32 getMinVideoRamSetting(); - static S32 getMaxVideoRamSetting(bool get_recommended = false); + static S32Mibibytes getMinVideoRamSetting(); + static S32Mibibytes getMaxVideoRamSetting(bool get_recommended = false); private: void updateImagesDecodePriorities(); @@ -200,8 +200,8 @@ private: BOOL mInitialized ; BOOL mUpdateStats; - S32 mMaxResidentTexMemInMegaBytes; - S32 mMaxTotalTextureMemInMegaBytes; + S32Mibibytes mMaxResidentTexMemInMegaBytes; + S32Mibibytes mMaxTotalTextureMemInMegaBytes; LLFrameTimer mForceDecodeTimer; private: diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp index 916dec86aa..22de7e150b 100755 --- a/indra/newview/llviewerthrottle.cpp +++ b/indra/newview/llviewerthrottle.cpp @@ -48,8 +48,8 @@ const F32 MIN_FRACTIONAL = 0.2f; const F32 MIN_BANDWIDTH = 50.f; const F32 MAX_BANDWIDTH = 3000.f; const F32 STEP_FRACTIONAL = 0.1f; -const LLUnit<F32, LLUnits::Percent> TIGHTEN_THROTTLE_THRESHOLD = 3.0f; // packet loss % per s -const LLUnit<F32, LLUnits::Percent> EASE_THROTTLE_THRESHOLD = 0.5f; // packet loss % per s +const LLUnit<F32, LLUnits::Percent> TIGHTEN_THROTTLE_THRESHOLD(3.0f); // packet loss % per s +const LLUnit<F32, LLUnits::Percent> EASE_THROTTLE_THRESHOLD(0.5f); // packet loss % per s const F32 DYNAMIC_UPDATE_DURATION = 5.0f; // seconds LLViewerThrottle gViewerThrottle; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 12d58b7521..1e60b59932 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -738,7 +738,7 @@ public: { if(gTotalTextureBytesPerBoostLevel[i] > 0) { - addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit<F32, LLUnits::Mibibytes>(gTotalTextureBytesPerBoostLevel[i]).value())); + addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, F32Mibibytes(gTotalTextureBytesPerBoostLevel[i]).value())); ypos += y_inc; } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 12b9744b24..db6d2d6fe9 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -899,7 +899,7 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) if (mLastRegionHandle != 0) { ++mRegionCrossingCount; - LLUnit<F64, LLUnits::Seconds> delta = mRegionCrossingTimer.getElapsedTimeF32(); + F64Seconds delta(mRegionCrossingTimer.getElapsedTimeF32()); record(LLStatViewer::REGION_CROSSING_TIME, delta); // Diagnostics diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 5e8a771929..93351d21f5 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6547,7 +6547,7 @@ void LLVivoxVoiceClient::expireVoiceFonts() // Give a warning notification if any voice fonts are due to expire. if (will_expire) { - LLUnit<S32, LLUnits::Seconds> seconds = gSavedSettings.getS32("VoiceEffectExpiryWarningTime"); + S32Seconds seconds(gSavedSettings.getS32("VoiceEffectExpiryWarningTime")); args["INTERVAL"] = llformat("%d", LLUnit<S32, LLUnits::Days>(seconds).value()); LLNotificationsUtil::add("VoiceEffectsWillExpire", args); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 7e4e80240d..9d727dafbe 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -717,7 +717,7 @@ void LLWorld::renderPropertyLines() void LLWorld::updateNetStats() { - LLUnit<F64, LLUnits::Bits> bits = 0.f; + F64Bits bits; U32 packets = 0; for (region_list_t::iterator iter = mActiveRegionList.begin(); @@ -735,8 +735,8 @@ void LLWorld::updateNetStats() S32 packets_out = gMessageSystem->mPacketsOut - mLastPacketsOut; S32 packets_lost = gMessageSystem->mDroppedPackets - mLastPacketsLost; - LLUnit<F64, LLUnits::Bits> actual_in_bits = gMessageSystem->mPacketRing.getAndResetActualInBits(); - LLUnit<F64, LLUnits::Bits> actual_out_bits = gMessageSystem->mPacketRing.getAndResetActualOutBits(); + F64Bits actual_in_bits(gMessageSystem->mPacketRing.getAndResetActualInBits()); + F64Bits actual_out_bits(gMessageSystem->mPacketRing.getAndResetActualOutBits()); add(LLStatViewer::MESSAGE_SYSTEM_DATA_IN, actual_in_bits); add(LLStatViewer::MESSAGE_SYSTEM_DATA_OUT, actual_out_bits); diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index aaf191a98a..fc2369276c 100755 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -52,13 +52,11 @@ <stat_view name="advanced" label="Advanced" follows="left|top|right" - show_bar="true" show_label="true" setting="OpenDebugStatAdvanced"> <stat_view name="render" label="Render" follows="left|top|right" - show_bar="true" show_label="true" setting="OpenDebugStatRender"> <stat_bar name="ktrisframe" @@ -84,7 +82,6 @@ <stat_view name="texture" label="Texture" follows="left|top|right" - show_bar="true" show_label="true"> <stat_bar name="texture_cache_hits" label="Cache Hit Rate" @@ -122,7 +119,6 @@ <stat_view name="network" label="Network" follows="left|top|right" - show_bar="true" show_label="true" setting="OpenDebugStatNet"> <stat_bar name="packetsinstat" @@ -168,7 +164,6 @@ <stat_view name="sim" label="Simulator" follows="left|top|right" - show_bar="true" show_label="true" setting="OpenDebugStatSim"> <stat_bar name="simtimedilation" @@ -189,7 +184,6 @@ <stat_view name="physicsdetail" label="Physics Details" follows="left|top|right" - show_bar="true" show_label="true"> <stat_bar name="physicspinnedtasks" label="Pinned Objects" @@ -237,7 +231,6 @@ <stat_view name="simpathfinding" label="Pathfinding" follows="left|top|right" - show_bar="true" show_label="true"> <stat_bar name="simsimaistepmsec" label="AI Step Time" @@ -274,7 +267,6 @@ <stat_view name="simperf" label="Time" follows="left|top|right" - show_bar="true" show_label="true"> <stat_bar name="simframemsec" label="Total Frame Time" @@ -311,7 +303,6 @@ <stat_view name="timedetails" label="Time Details" follows="left|top|right" - show_bar="true" show_label="true"> <stat_bar name="simsimphysicsstepmsec" label="Physics Step" diff --git a/indra/newview/tests/lltexturestatsuploader_test.cpp b/indra/newview/tests/lltexturestatsuploader_test.cpp index cfb2c267cc..4438523022 100755 --- a/indra/newview/tests/lltexturestatsuploader_test.cpp +++ b/indra/newview/tests/lltexturestatsuploader_test.cpp @@ -111,7 +111,7 @@ namespace tut void texturestatsuploader_object_t::test<1>() { LLTextureStatsUploader tsu; - llinfos << &tsu << llendl; + LL_INFOS() << &tsu << LL_ENDL; ensure("have we crashed?", true); } |