diff options
Diffstat (limited to 'indra/newview/llscenemonitor.cpp')
-rw-r--r-- | indra/newview/llscenemonitor.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index 2f48be12fb..29dd140158 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -89,6 +89,7 @@ void LLSceneMonitor::reset() mMonitorRecording.reset(); mSceneLoadRecording.reset(); + mRecordingTimer.reset(); unfreezeScene(); @@ -259,7 +260,6 @@ void LLSceneMonitor::capture() static U32 last_capture_frame = 0; static LLCachedControl<bool> monitor_enabled(gSavedSettings, "SceneLoadingMonitorEnabled"); static LLCachedControl<F32> scene_load_sample_time(gSavedSettings, "SceneLoadingMonitorSampleTime"); - static LLFrameTimer timer; static bool force_capture = true; bool enabled = monitor_enabled || mDebugViewerVisible; @@ -288,7 +288,7 @@ void LLSceneMonitor::capture() force_capture = true; } - if((timer.getElapsedTimeF32() > scene_load_sample_time() + if((mRecordingTimer.getElapsedTimeF32() > scene_load_sample_time() || force_capture) && mEnabled && LLGLSLShader::sNoFixedFunction @@ -299,8 +299,6 @@ void LLSceneMonitor::capture() mSceneLoadRecording.resume(); mMonitorRecording.resume(); - timer.reset(); - last_capture_frame = gFrameCount; LLRenderTarget& cur_target = getCaptureTarget(); @@ -467,10 +465,9 @@ void LLSceneMonitor::fetchQueryResult() // also throttle timing here, to avoid going below sample time due to phasing with frame capture static LLCachedControl<F32> scene_load_sample_time(gSavedSettings, "SceneLoadingMonitorSampleTime"); - static LLFrameTimer timer; - F32 elapsed_time = timer.getElapsedTimeF32(); - if(mDiffState == WAIT_ON_RESULT && elapsed_time > scene_load_sample_time) + if(mDiffState == WAIT_ON_RESULT + && !LLAppViewer::instance()->quitRequested()) { mDiffState = WAITING_FOR_NEXT_DIFF; @@ -483,22 +480,27 @@ void LLSceneMonitor::fetchQueryResult() mDiffResult = sqrtf(count * 0.5f / (mDiff->getWidth() * mDiff->getHeight() * mDiffPixelRatio * mDiffPixelRatio)); //0.5 -> (front face + back face) - LL_DEBUGS("SceneMonitor") << "Frame difference: " << std::setprecision(4) << mDiffResult << LL_ENDL; + LL_DEBUGS("SceneMonitor") << "Frame difference: " << mDiffResult << LL_ENDL; record(sFramePixelDiff, mDiffResult); static LLCachedControl<F32> diff_threshold(gSavedSettings,"SceneLoadingPixelDiffThreshold"); - if(mDiffResult > diff_threshold()) - { - mSceneLoadRecording.extend(); - llassert(mSceneLoadRecording.getResults().getLastRecording().getDuration() > scene_load_sample_time); - } - else + F32 elapsed_time = mRecordingTimer.getElapsedTimeF32(); + + if (elapsed_time > scene_load_sample_time) { - mSceneLoadRecording.nextPeriod(); + if(mDiffResult > diff_threshold()) + { + mSceneLoadRecording.extend(); + llinfos << mSceneLoadRecording.getResults().getLastRecording().getDuration() << llendl; + llassert_always(mSceneLoadRecording.getResults().getLastRecording().getDuration() > scene_load_sample_time); + } + else + { + mSceneLoadRecording.nextPeriod(); + } + mRecordingTimer.reset(); } } - - timer.reset(); } } |