Skip to content
Snippets Groups Projects
Commit e2212f86 authored by Richard Linden's avatar Richard Linden
Browse files

SH-4377 FIX: Interesting: Windows viewer crashes when SceneLoadingMonitorEnabled is enabled

parent b1297dce
No related branches found
No related tags found
No related merge requests found
...@@ -145,7 +145,7 @@ void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppen ...@@ -145,7 +145,7 @@ void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppen
F64 epsilon = 0.0000001; F64 epsilon = 0.0000001;
if (other.mTotalSamplingTime > epsilon) if (other.mTotalSamplingTime > epsilon && mTotalSamplingTime > epsilon)
{ {
// combine variance (and hence standard deviation) of 2 different sized sample groups using // combine variance (and hence standard deviation) of 2 different sized sample groups using
// the following formula: http://www.mrc-bsu.cam.ac.uk/cochrane/handbook/chapter_7/7_7_3_8_combining_groups.htm // the following formula: http://www.mrc-bsu.cam.ac.uk/cochrane/handbook/chapter_7/7_7_3_8_combining_groups.htm
...@@ -173,7 +173,6 @@ void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppen ...@@ -173,7 +173,6 @@ void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppen
mNumSamples += other.mNumSamples; mNumSamples += other.mNumSamples;
mTotalSamplingTime += other.mTotalSamplingTime; mTotalSamplingTime += other.mTotalSamplingTime;
mMean = (mMean * weight) + (other.mMean * (1.0 - weight)); mMean = (mMean * weight) + (other.mMean * (1.0 - weight));
llassert(mMean < 0 || mMean >= 0);
} }
if (append_type == SEQUENTIAL) if (append_type == SEQUENTIAL)
{ {
......
...@@ -318,7 +318,6 @@ namespace LLTrace ...@@ -318,7 +318,6 @@ namespace LLTrace
mMin = value; mMin = value;
mMax = value; mMax = value;
mMean = value; mMean = value;
llassert(mMean < 0 || mMean >= 0);
mLastSampleTimeStamp = time_stamp; mLastSampleTimeStamp = time_stamp;
} }
else else
...@@ -336,15 +335,13 @@ namespace LLTrace ...@@ -336,15 +335,13 @@ namespace LLTrace
void sync(F64SecondsImplicit time_stamp) void sync(F64SecondsImplicit time_stamp)
{ {
if (mHasValue) if (mHasValue && time_stamp != mLastSampleTimeStamp)
{ {
F64SecondsImplicit delta_time = time_stamp - mLastSampleTimeStamp; F64SecondsImplicit delta_time = time_stamp - mLastSampleTimeStamp;
mSum += mLastValue * delta_time; mSum += mLastValue * delta_time;
mTotalSamplingTime += delta_time; mTotalSamplingTime += delta_time;
F64 old_mean = mMean; F64 old_mean = mMean;
llassert(mMean < 0 || mMean >= 0);
mMean += (delta_time / mTotalSamplingTime) * (mLastValue - old_mean); mMean += (delta_time / mTotalSamplingTime) * (mLastValue - old_mean);
llassert(mMean < 0 || mMean >= 0);
mSumOfSquares += delta_time * (mLastValue - old_mean) * (mLastValue - mMean); mSumOfSquares += delta_time * (mLastValue - old_mean) * (mLastValue - mMean);
} }
mLastSampleTimeStamp = time_stamp; mLastSampleTimeStamp = time_stamp;
......
...@@ -283,6 +283,7 @@ void LLSceneMonitor::capture() ...@@ -283,6 +283,7 @@ void LLSceneMonitor::capture()
else else
{ {
mEnabled = enabled; mEnabled = enabled;
reset();
freezeScene(); freezeScene();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment