From 06bce2ddd0958cff3c2ee477a880e998dfc48be7 Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Thu, 15 Feb 2018 21:55:24 +0000 Subject: Add debug setting and code to allow nVidia nSight graphics debugging to capture SL frames. These changes are only enabled if RenderNsightDebugSupport is true and eliminate use of some OpenGL legacy functionality which is incompatible with nSight capture (mostly glReadPixels and other fixed-function pipe rendering calls). --- indra/newview/llfasttimerview.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'indra/newview/llfasttimerview.cpp') diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 9219dd0279..34d0972d72 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -435,18 +435,22 @@ void LLFastTimerView::onClose(bool app_quitting) void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch) { - //read result back into raw image - glReadPixels(0, 0, 1024, 512, GL_RGB, GL_UNSIGNED_BYTE, scratch->getData()); + // disable use of glReadPixels which messes up nVidia nSight graphics debugging + if (!LLRender::sNsightDebugSupport) + { + //read result back into raw image + glReadPixels(0, 0, 1024, 512, GL_RGB, GL_UNSIGNED_BYTE, scratch->getData()); - //write results to disk - LLPointer result = new LLImagePNG(); - result->encode(scratch, 0.f); + //write results to disk + LLPointer result = new LLImagePNG(); + result->encode(scratch, 0.f); - std::string ext = result->getExtension(); - std::string filename = llformat("%s_%s.%s", label.c_str(), suffix, ext.c_str()); + std::string ext = result->getExtension(); + std::string filename = llformat("%s_%s.%s", label.c_str(), suffix, ext.c_str()); - std::string out_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); - result->save(out_file); + std::string out_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); + result->save(out_file); + } } //static -- cgit v1.2.3 From d82844dd1868b617c82c5ff8b07cd7164b9e049c Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 23 Feb 2018 16:02:24 +0200 Subject: MAINT-8302 Re-enabled exportCharts --- indra/newview/llfasttimerview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llfasttimerview.cpp') diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 34d0972d72..f68e63cb96 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -908,8 +908,7 @@ void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target base[label]["Samples"].asInteger()); } - // This currently crashes, possibly due to a race condition in shutdown: - // exportCharts(baseline, target); + exportCharts(baseline, target); os.flush(); os.close(); -- cgit v1.2.3