diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-09-16 17:25:48 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-09-16 17:25:48 -0400 |
commit | f4b65638879c10c832b3bb8448f82001106ffd11 (patch) | |
tree | 14dc47b0eaa34a58fd771667c1b2609d4a2f2b39 /indra/newview/llviewerdisplay.cpp | |
parent | 7e21a98931005fc0d44d23840c7e1815372613a7 (diff) |
Add LLFloaterAbout info (esp. GPU info) to Frame Profile stats dump
With the About info added, `getProfileStatsContext()` need not redundantly add
`"channel"`, `"version"` or `"region"`.
Slightly improve the efficiency of `LlsdToJson()` and `LlsdFromJson()` by
preallocating the known size of the source array or map. (Unfortunately the C++
`LLSD` class offers us no way to preallocate a map.)
In `LLAppViewer::getViewerInfo()`, avoid immediate successive calls to
`gAgent.getRegion()`.
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r-- | indra/newview/llviewerdisplay.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index aad11d9372..f722d0bd1d 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -58,6 +58,7 @@ #include "llpostprocess.h" #include "llrender.h" #include "llscenemonitor.h" +#include "llsdjson.h" #include "llselectmgr.h" #include "llsky.h" #include "llspatialpartition.h" @@ -1061,12 +1062,12 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot) void getProfileStatsContext(boost::json::object& stats) { - auto contextit = stats.emplace("context", boost::json::object_kind).first; + // populate the context with info from LLFloaterAbout + auto contextit = stats.emplace("context", + LlsdToJson(LLAppViewer::instance()->getViewerInfo())).first; auto& context = contextit->value().as_object(); - auto& versionInfo = LLVersionInfo::instance(); - context.emplace("channel", versionInfo.getChannel()); - context.emplace("version", versionInfo.getVersion()); + // then add a few more things unsigned char unique_id[MAC_ADDRESS_BYTES]{}; LLMachineID::getUniqueID(unique_id, sizeof(unique_id)); context.emplace("machine", stringize(LL::hexdump(unique_id, sizeof(unique_id)))); @@ -1074,7 +1075,6 @@ void getProfileStatsContext(boost::json::object& stats) LLViewerRegion* region = gAgent.getRegion(); if (region) { - context.emplace("region", region->getName()); context.emplace("regionid", stringize(region->getRegionID())); } LLParcel* parcel = LLViewerParcelMgr::instance().getAgentParcel(); |