SH-4377 FIX: Interesting: Windows viewer crashes when SceneLoadingMonitorEnabled is enabled
parent
b1297dce44
commit
e2212f8633
|
|
@ -145,7 +145,7 @@ void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppen
|
|||
|
||||
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
|
||||
// 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
|
|||
mNumSamples += other.mNumSamples;
|
||||
mTotalSamplingTime += other.mTotalSamplingTime;
|
||||
mMean = (mMean * weight) + (other.mMean * (1.0 - weight));
|
||||
llassert(mMean < 0 || mMean >= 0);
|
||||
}
|
||||
if (append_type == SEQUENTIAL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -318,7 +318,6 @@ namespace LLTrace
|
|||
mMin = value;
|
||||
mMax = value;
|
||||
mMean = value;
|
||||
llassert(mMean < 0 || mMean >= 0);
|
||||
mLastSampleTimeStamp = time_stamp;
|
||||
}
|
||||
else
|
||||
|
|
@ -336,15 +335,13 @@ namespace LLTrace
|
|||
|
||||
void sync(F64SecondsImplicit time_stamp)
|
||||
{
|
||||
if (mHasValue)
|
||||
if (mHasValue && time_stamp != mLastSampleTimeStamp)
|
||||
{
|
||||
F64SecondsImplicit delta_time = time_stamp - mLastSampleTimeStamp;
|
||||
mSum += mLastValue * delta_time;
|
||||
mTotalSamplingTime += delta_time;
|
||||
F64 old_mean = mMean;
|
||||
llassert(mMean < 0 || mMean >= 0);
|
||||
mMean += (delta_time / mTotalSamplingTime) * (mLastValue - old_mean);
|
||||
llassert(mMean < 0 || mMean >= 0);
|
||||
mSumOfSquares += delta_time * (mLastValue - old_mean) * (mLastValue - mMean);
|
||||
}
|
||||
mLastSampleTimeStamp = time_stamp;
|
||||
|
|
|
|||
|
|
@ -283,6 +283,7 @@ void LLSceneMonitor::capture()
|
|||
else
|
||||
{
|
||||
mEnabled = enabled;
|
||||
reset();
|
||||
freezeScene();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue