summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerdisplay.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-19 11:46:08 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-19 11:46:08 -0400
commit8c40e6f0a9e211ec22331385dc66b5ff5233859c (patch)
tree791f4074d5f4f6e1c918b5d85629c251bc999e67 /indra/newview/llviewerdisplay.cpp
parentf0300cf8b3a96464a921b8df6cd690ac104fba46 (diff)
Reapply commit f4b6563 -- cherry-picking lost parts of it?!
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r--indra/newview/llviewerdisplay.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index ae0579f5f7..f722d0bd1d 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -139,6 +139,7 @@ void render_ui_3d();
void render_ui_2d();
void render_disconnected_background();
+void getProfileStatsContext(boost::json::object& stats);
std::string getProfileStatsFilename();
void display_startup()
@@ -1041,7 +1042,21 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
if (gShaderProfileFrame)
{
gShaderProfileFrame = false;
- LLGLSLShader::finishProfile(getProfileStatsFilename());
+ boost::json::value stats{ boost::json::object_kind };
+ getProfileStatsContext(stats.as_object());
+ LLGLSLShader::finishProfile(stats);
+
+ auto report_name = getProfileStatsFilename();
+ std::ofstream outf(report_name);
+ if (! outf)
+ {
+ LL_WARNS() << "Couldn't write to " << std::quoted(report_name) << LL_ENDL;
+ }
+ else
+ {
+ outf << stats;
+ LL_INFOS() << "(also dumped to " << std::quoted(report_name) << ")" << LL_ENDL;
+ }
}
}
@@ -1068,6 +1083,7 @@ void getProfileStatsContext(boost::json::object& stats)
context.emplace("parcel", parcel->getName());
context.emplace("parcelid", parcel->getLocalID());
}
+ context.emplace("time", LLDate::now().toHTTPDateString("%Y-%m-%dT%H:%M:%S"));
}
std::string getProfileStatsFilename()