diff options
| -rw-r--r-- | indra/llcommon/lltraceaccumulators.h | 40 | ||||
| -rw-r--r-- | indra/llcommon/lltracerecording.h | 15 | ||||
| -rw-r--r-- | indra/llcommon/llunit.h | 100 | ||||
| -rwxr-xr-x | indra/llmath/llmath.h | 6 | ||||
| -rwxr-xr-x | indra/llui/llstatbar.cpp | 181 | ||||
| -rwxr-xr-x | indra/newview/llface.cpp | 10 | ||||
| -rwxr-xr-x | indra/newview/llfasttimerview.cpp | 2 | 
7 files changed, 194 insertions, 160 deletions
| diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index efc8b43f6a..b1aa078f9a 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -223,7 +223,7 @@ namespace LLTrace  			mMin((std::numeric_limits<F64>::max)()),  			mMax((std::numeric_limits<F64>::min)()),  			mMean(0), -			mVarianceSum(0), +			mSumOfSquares(0),  			mNumSamples(0),  			mLastValue(0)  		{} @@ -243,7 +243,7 @@ namespace LLTrace  			}  			F64 old_mean = mMean;  			mMean += (value - old_mean) / (F64)mNumSamples; -			mVarianceSum += (value - old_mean) * (value - mMean); +			mSumOfSquares += (value - old_mean) * (value - mMean);  			mLastValue = value;  		} @@ -263,20 +263,20 @@ namespace LLTrace  					n_2 = (F64)other.mNumSamples;  				F64 m_1 = mMean,  					m_2 = other.mMean; -				F64 v_1 = mVarianceSum / mNumSamples, -					v_2 = other.mVarianceSum / other.mNumSamples; +				F64 v_1 = mSumOfSquares / mNumSamples, +					v_2 = other.mSumOfSquares / other.mNumSamples;  				if (n_1 == 0)  				{ -					mVarianceSum = other.mVarianceSum; +					mSumOfSquares = other.mSumOfSquares;  				}  				else if (n_2 == 0)  				{  					// don't touch variance -					// mVarianceSum = mVarianceSum; +					// mSumOfSquares = mSumOfSquares;  				}  				else  				{ -					mVarianceSum = (F64)mNumSamples +					mSumOfSquares = (F64)mNumSamples  						* ((((n_1 - 1.f) * v_1)  						+ ((n_2 - 1.f) * v_2)  						+ (((n_1 * n_2) / (n_1 + n_2)) @@ -298,7 +298,7 @@ namespace LLTrace  			mMin = std::numeric_limits<F64>::max();  			mMax = std::numeric_limits<F64>::min();  			mMean = 0; -			mVarianceSum = 0; +			mSumOfSquares = 0;  			mLastValue = other ? other->mLastValue : 0;  		} @@ -309,7 +309,7 @@ namespace LLTrace  		F64	getMax() const { return mMax; }  		F64	getLastValue() const { return mLastValue; }  		F64	getMean() const { return mMean; } -		F64 getStandardDeviation() const { return sqrtf(mVarianceSum / mNumSamples); } +		F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mNumSamples); }  		U32 getSampleCount() const { return mNumSamples; }  	private: @@ -319,7 +319,7 @@ namespace LLTrace  			mLastValue;  		F64	mMean, -			mVarianceSum; +			mSumOfSquares;  		U32	mNumSamples;  	}; @@ -336,7 +336,7 @@ namespace LLTrace  			mMin((std::numeric_limits<F64>::max)()),  			mMax((std::numeric_limits<F64>::min)()),  			mMean(0), -			mVarianceSum(0), +			mSumOfSquares(0),  			mLastSampleTimeStamp(LLTimer::getTotalSeconds()),  			mTotalSamplingTime(0),  			mNumSamples(0), @@ -361,7 +361,7 @@ namespace LLTrace  				F64 old_mean = mMean;  				mMean += (delta_time / mTotalSamplingTime) * (mLastValue - old_mean); -				mVarianceSum += delta_time * (mLastValue - old_mean) * (mLastValue - mMean); +				mSumOfSquares += delta_time * (mLastValue - old_mean) * (mLastValue - mMean);  			}  			mLastValue = value; @@ -385,20 +385,20 @@ namespace LLTrace  					n_2 = other.mTotalSamplingTime;  				F64 m_1 = mMean,  					m_2 = other.mMean; -				F64 v_1 = mVarianceSum / mTotalSamplingTime, -					v_2 = other.mVarianceSum / other.mTotalSamplingTime; +				F64 v_1 = mSumOfSquares / mTotalSamplingTime, +					v_2 = other.mSumOfSquares / other.mTotalSamplingTime;  				if (n_1 == 0)  				{ -					mVarianceSum = other.mVarianceSum; +					mSumOfSquares = other.mSumOfSquares;  				}  				else if (n_2 == 0)  				{  					// variance is unchanged -					// mVarianceSum = mVarianceSum; +					// mSumOfSquares = mSumOfSquares;  				}  				else  				{ -					mVarianceSum =	mTotalSamplingTime +					mSumOfSquares =	mTotalSamplingTime  						* ((((n_1 - 1.f) * v_1)  						+ ((n_2 - 1.f) * v_2)  						+ (((n_1 * n_2) / (n_1 + n_2)) @@ -427,7 +427,7 @@ namespace LLTrace  			mMin = std::numeric_limits<F64>::max();  			mMax = std::numeric_limits<F64>::min();  			mMean = other ? other->mLastValue : 0; -			mVarianceSum = 0; +			mSumOfSquares = 0;  			mLastSampleTimeStamp = LLTimer::getTotalSeconds();  			mTotalSamplingTime = 0;  			mLastValue = other ? other->mLastValue : 0; @@ -451,7 +451,7 @@ namespace LLTrace  		F64	getMax() const { return mMax; }  		F64	getLastValue() const { return mLastValue; }  		F64	getMean() const { return mMean; } -		F64 getStandardDeviation() const { return sqrtf(mVarianceSum / mTotalSamplingTime); } +		F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mTotalSamplingTime); }  		U32 getSampleCount() const { return mNumSamples; }  	private: @@ -463,7 +463,7 @@ namespace LLTrace  		bool mHasValue;  		F64	mMean, -			mVarianceSum; +			mSumOfSquares;  		LLUnitImplicit<F64, LLUnits::Seconds>	mLastSampleTimeStamp,  			mTotalSamplingTime; diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 31616a52cc..f5e4ea603c 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -333,6 +333,21 @@ namespace LLTrace  		const Recording& getPrevRecording(U32 offset) const;  		Recording snapshotCurRecording() const; +		template <typename T> +		size_t getSampleCount(const TraceType<T>& stat, size_t num_periods = U32_MAX) +        { +			size_t total_periods = mNumPeriods; +			num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); + +            size_t num_samples = 0; +			for (S32 i = 1; i <= num_periods; i++) +			{ +				S32 index = (mCurPeriod + total_periods - i) % total_periods; +				num_samples += mRecordingPeriods[index].getSampleCount(stat); +			} +			return num_samples; +        } +          		//  		// PERIODIC MIN  		// diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index f81e746c77..d6d8d9da6a 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -542,28 +542,28 @@ struct base_unit_name  } -#define LL_DECLARE_DERIVED_UNIT(unit_name, unit_label, base_unit_name, conversion_operation)	    \ -struct unit_name                                                                                    \ -{                                                                                                   \ -	typedef base_unit_name base_unit_t;                                                             \ -	static const char* getUnitLabel() { return unit_label; }									    \ -	template<typename T>                                                                            \ -	static LLUnit<T, unit_name> fromValue(T value) { return LLUnit<T, unit_name>(value); }		    \ -	template<typename STORAGE_T, typename UNIT_T>                                                   \ -	static LLUnit<STORAGE_T, unit_name> fromValue(LLUnit<STORAGE_T, UNIT_T> value)				    \ -	{ return LLUnit<STORAGE_T, unit_name>(value); }												    \ -};                                                                                                  \ -	                                                                                                \ -template<typename S1, typename S2>                                                                  \ -void ll_convert_units(LLUnit<S1, unit_name> in, LLUnit<S2, base_unit_name>& out)                    \ -{                                                                                                   \ -	out = LLUnit<S2, base_unit_name>((S2)(LLUnitLinearOps<S1>(in.value()) conversion_operation));   \ -}                                                                                                   \ -                                                                                                    \ -template<typename S1, typename S2>                                                                  \ -void ll_convert_units(LLUnit<S1, base_unit_name> in, LLUnit<S2, unit_name>& out)                    \ -{                                                                                                   \ -	out = LLUnit<S2, unit_name>((S2)(LLUnitInverseLinearOps<S1>(in.value()) conversion_operation)); \ +#define LL_DECLARE_DERIVED_UNIT(base_unit_name, conversion_operation, unit_name, unit_label)	        \ +struct unit_name                                                                                        \ +{                                                                                                       \ +	typedef base_unit_name base_unit_t;                                                                 \ +	static const char* getUnitLabel() { return unit_label; }									        \ +	template<typename T>                                                                                \ +	static LLUnit<T, unit_name> fromValue(T value) { return LLUnit<T, unit_name>(value); }		        \ +	template<typename STORAGE_T, typename UNIT_T>                                                       \ +	static LLUnit<STORAGE_T, unit_name> fromValue(LLUnit<STORAGE_T, UNIT_T> value)				        \ +	{ return LLUnit<STORAGE_T, unit_name>(value); }												        \ +};                                                                                                      \ +	                                                                                                    \ +template<typename S1, typename S2>                                                                      \ +void ll_convert_units(LLUnit<S1, unit_name> in, LLUnit<S2, base_unit_name>& out)                        \ +{                                                                                                       \ +	out = LLUnit<S2, base_unit_name>((S2)(LLUnitLinearOps<S1>(in.value()) conversion_operation));		\ +}                                                                                                       \ +                                                                                                        \ +template<typename S1, typename S2>                                                                      \ +void ll_convert_units(LLUnit<S1, base_unit_name> in, LLUnit<S2, unit_name>& out)                        \ +{                                                                                                       \ +	out = LLUnit<S2, unit_name>((S2)(LLUnitInverseLinearOps<S1>(in.value()) conversion_operation));     \  }                                                                                                 // @@ -573,46 +573,46 @@ void ll_convert_units(LLUnit<S1, base_unit_name> in, LLUnit<S2, unit_name>& out)  namespace LLUnits  {  LL_DECLARE_BASE_UNIT(Bytes, "B"); -LL_DECLARE_DERIVED_UNIT(Kilobytes, "KB", Bytes, * 1000); -LL_DECLARE_DERIVED_UNIT(Megabytes, "MB", Kilobytes, * 1000); -LL_DECLARE_DERIVED_UNIT(Gigabytes, "GB", Megabytes, * 1000); -LL_DECLARE_DERIVED_UNIT(Kibibytes, "KiB", Bytes, * 1024); -LL_DECLARE_DERIVED_UNIT(Mibibytes, "MiB", Kibibytes, * 1024); -LL_DECLARE_DERIVED_UNIT(Gibibytes, "GiB", Mibibytes, * 1024); - -LL_DECLARE_DERIVED_UNIT(Bits, "b", Bytes, / 8); -LL_DECLARE_DERIVED_UNIT(Kilobits, "Kb", Bytes, * 1000 / 8); -LL_DECLARE_DERIVED_UNIT(Megabits, "Mb", Kilobits, * 1000 / 8); -LL_DECLARE_DERIVED_UNIT(Gigabits, "Gb", Megabits, * 1000 / 8); -LL_DECLARE_DERIVED_UNIT(Kibibits, "Kib", Bytes, * 1024 / 8); -LL_DECLARE_DERIVED_UNIT(Mibibits, "Mib", Kibibits, * 1024 / 8); -LL_DECLARE_DERIVED_UNIT(Gibibits, "Gib", Mibibits, * 1024 / 8); +LL_DECLARE_DERIVED_UNIT(Bytes, * 1000,			Kilobytes, "KB"); +LL_DECLARE_DERIVED_UNIT(Kilobytes, * 1000,		Megabytes, "MB"); +LL_DECLARE_DERIVED_UNIT(Megabytes, * 1000,		Gigabytes, "GB"); +LL_DECLARE_DERIVED_UNIT(Bytes, * 1024,			Kibibytes, "KiB"); +LL_DECLARE_DERIVED_UNIT(Kibibytes, * 1024,		Mibibytes, "MiB"); +LL_DECLARE_DERIVED_UNIT(Mibibytes, * 1024,		Gibibytes, "GiB"); + +LL_DECLARE_DERIVED_UNIT(Bytes, / 8,				Bits, "b"); +LL_DECLARE_DERIVED_UNIT(Bits, * 1000,			Kilobits, "Kb"); +LL_DECLARE_DERIVED_UNIT(Kilobits, * 1000,		Megabits, "Mb"); +LL_DECLARE_DERIVED_UNIT(Megabits, * 1000,		Gigabits, "Gb"); +LL_DECLARE_DERIVED_UNIT(Bits, * 1024,			Kibibits, "Kib"); +LL_DECLARE_DERIVED_UNIT(Kibibits, * 1024,		Mibibits, "Mib");   +LL_DECLARE_DERIVED_UNIT(Mibibits, * 1024,		Gibibits, "Gib");  LL_DECLARE_BASE_UNIT(Seconds, "s"); -LL_DECLARE_DERIVED_UNIT(Minutes, "min", Seconds, * 60); -LL_DECLARE_DERIVED_UNIT(Hours, "h", Seconds, * 60 * 60); -LL_DECLARE_DERIVED_UNIT(Milliseconds, "ms", Seconds, / 1000); -LL_DECLARE_DERIVED_UNIT(Microseconds, "\x09\x3cs", Milliseconds, / 1000); -LL_DECLARE_DERIVED_UNIT(Nanoseconds, "ns", Microseconds, / 1000); +LL_DECLARE_DERIVED_UNIT(Seconds, * 60,			Minutes, "min"); +LL_DECLARE_DERIVED_UNIT(Minutes, * 60,			Hours, "h"); +LL_DECLARE_DERIVED_UNIT(Seconds, / 1000,		Milliseconds, "ms"); +LL_DECLARE_DERIVED_UNIT(Milliseconds, / 1000,	Microseconds, "\x09\x3cs"); +LL_DECLARE_DERIVED_UNIT(Microseconds, / 1000,	Nanoseconds, "ns");  LL_DECLARE_BASE_UNIT(Meters, "m"); -LL_DECLARE_DERIVED_UNIT(Kilometers, "km", Meters, * 1000); -LL_DECLARE_DERIVED_UNIT(Centimeters, "cm", Meters, / 100); -LL_DECLARE_DERIVED_UNIT(Millimeters, "mm", Meters, / 1000); +LL_DECLARE_DERIVED_UNIT(Meters, * 1000,			Kilometers, "km"); +LL_DECLARE_DERIVED_UNIT(Meters, / 100,			Centimeters, "cm"); +LL_DECLARE_DERIVED_UNIT(Meters, / 1000,			Millimeters, "mm");  LL_DECLARE_BASE_UNIT(Hertz, "Hz"); -LL_DECLARE_DERIVED_UNIT(Kilohertz, "KHz", Hertz, * 1000); -LL_DECLARE_DERIVED_UNIT(Megahertz, "MHz", Kilohertz, * 1000); -LL_DECLARE_DERIVED_UNIT(Gigahertz, "GHz", Megahertz, * 1000); +LL_DECLARE_DERIVED_UNIT(Hertz, * 1000,			Kilohertz, "KHz"); +LL_DECLARE_DERIVED_UNIT(Kilohertz, * 1000,		Megahertz, "MHz"); +LL_DECLARE_DERIVED_UNIT(Megahertz, * 1000,		Gigahertz, "GHz");  LL_DECLARE_BASE_UNIT(Radians, "rad"); -LL_DECLARE_DERIVED_UNIT(Degrees, "deg", Radians, * 0.01745329251994); +LL_DECLARE_DERIVED_UNIT(Radians, / 57.29578f,	Degrees, "deg");  LL_DECLARE_BASE_UNIT(Percent, "%"); -LL_DECLARE_DERIVED_UNIT(Ratio, "x", Percent, / 100); +LL_DECLARE_DERIVED_UNIT(Percent, * 100,			Ratio, "x");  LL_DECLARE_BASE_UNIT(Triangles, "tris"); -LL_DECLARE_DERIVED_UNIT(Kilotriangles, "ktris", Triangles, * 1000); +LL_DECLARE_DERIVED_UNIT(Triangles, * 1000,		Kilotriangles, "ktris");  } // namespace LLUnits diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index cad2461e9c..eeb5cd3ee6 100755 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -113,6 +113,12 @@ inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f <  // WARNING: Infinity is comparable with F32_MAX and negative   // infinity is comparable with F32_MIN +// handles negative and positive zeros +inline bool is_zero(F32 x) +{ +	return (*(U32*)(&x) & 0x7fffffff) == 0; +} +  inline bool is_approx_equal(F32 x, F32 y)  {  	const S32 COMPARE_MANTISSA_UP_TO_BIT = 0x02; diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 3cd60a3f73..d9f4a36f8d 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -150,6 +150,7 @@ LLStatBar::LLStatBar(const Params& p)  	mMinBar(llmin(p.bar_min, p.bar_max)),  	mMaxBar(llmax(p.bar_max, p.bar_min)),  	mCurMaxBar(p.bar_max), +    mCurMinBar(0),  	mDecimalDigits(p.decimal_digits),  	mNumFrames(p.num_frames),  	mMaxHeight(p.max_height), @@ -225,6 +226,9 @@ void LLStatBar::draw()  		max     = 0,  		mean    = 0; +     +    S32 num_samples = 0; +      	LLLocalClipRect _(getLocalRect());  	LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); @@ -236,6 +240,7 @@ void LLStatBar::draw()  		if (mPerSec)  		{  			unit_label += "/s"; +            num_samples = frame_recording.getSampleCount(*mCountFloatp, mNumFrames);  			current = last_frame_recording.getPerSec(*mCountFloatp);  			min     = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames);  			max     = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); @@ -243,6 +248,7 @@ void LLStatBar::draw()  		}  		else  		{ +            num_samples = frame_recording.getSampleCount(*mCountFloatp, mNumFrames);  			current = last_frame_recording.getSum(*mCountFloatp);  			min     = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames);  			max     = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); @@ -254,6 +260,7 @@ void LLStatBar::draw()  		LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording();  		unit_label = mUnitLabel.empty() ? mEventFloatp->getUnitLabel() : mUnitLabel; +        num_samples = frame_recording.getSampleCount(*mEventFloatp, mNumFrames);  		current = last_frame_recording.getMean(*mEventFloatp);  		min     = frame_recording.getPeriodMin(*mEventFloatp, mNumFrames);  		max     = frame_recording.getPeriodMax(*mEventFloatp, mNumFrames); @@ -264,6 +271,7 @@ void LLStatBar::draw()  		LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording();  		unit_label = mUnitLabel.empty() ? mSampleFloatp->getUnitLabel() : mUnitLabel; +        num_samples = frame_recording.getSampleCount(*mSampleFloatp, mNumFrames);  		current = last_frame_recording.getMean(*mSampleFloatp);  		min     = frame_recording.getPeriodMin(*mSampleFloatp, mNumFrames);  		max     = frame_recording.getPeriodMax(*mSampleFloatp, mNumFrames); @@ -329,7 +337,9 @@ void LLStatBar::draw()  	{  		decimal_digits = 0;  	} -	std::string value_str = llformat("%10.*f %s", decimal_digits, mean, unit_label.c_str()); +	std::string value_str = num_samples +                            ? llformat("%10.*f %s", decimal_digits, mean, unit_label.c_str()) +                            : "n/a";  	// Draw the current value.  	if (mOrientation == HORIZONTAL) @@ -345,7 +355,8 @@ void LLStatBar::draw()  			LLFontGL::RIGHT, LLFontGL::TOP);  	} -	if (mDisplayBar && (mCountFloatp || mEventFloatp || mSampleFloatp)) +	if (mDisplayBar +        && (mCountFloatp || mEventFloatp || mSampleFloatp))  	{  		// Draw the tick marks.  		LLGLSUIDefault gls_ui; @@ -431,7 +442,6 @@ void LLStatBar::draw()  		if (begin < 0)  		{  			begin = 0; -			llwarns << "Min:" << min << llendl;  		}  		S32 end = (S32) ((max - mCurMinBar) * value_scale); @@ -444,90 +454,93 @@ void LLStatBar::draw()  			gl_rect_2d(begin, bar_top, end, bar_bottom, LLColor4(1.f, 0.f, 0.f, 0.25f));  		} -		F32 span = (mOrientation == HORIZONTAL) +        if (num_samples) +        { +            F32 span = (mOrientation == HORIZONTAL)  					? (bar_right - bar_left)  					: (bar_top - bar_bottom); -		if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) -		{ -			const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; -			F32 value = 0; -			S32 i; -			gGL.color4f( 1.f, 0.f, 0.f, 1.f ); -			gGL.begin( LLRender::QUADS ); -			const S32 max_frame = llmin(mNumFrames, num_values); -			U32 num_samples = 0; -			for (i = 1; i <= max_frame; i++) -			{ -				F32 offset = ((F32)i / (F32)mNumFrames) * span; -				LLTrace::Recording& recording = frame_recording.getPrevRecording(i); - -				if (mCountFloatp) -				{ -					value       = mPerSec  -									? recording.getPerSec(*mCountFloatp)  -									: recording.getSum(*mCountFloatp); -					num_samples = recording.getSampleCount(*mCountFloatp); -				} -				else if (mEventFloatp) -				{ -					value       = recording.getMean(*mEventFloatp); -					num_samples = recording.getSampleCount(*mEventFloatp); -				} -				else if (mSampleFloatp) -				{ -					value       = recording.getMean(*mSampleFloatp); -					num_samples = recording.getSampleCount(*mSampleFloatp); -				} -				 -				if (!num_samples) continue; - -				F32 begin = (value  - mCurMinBar) * value_scale; -				if (mOrientation == HORIZONTAL) -				{ -					gGL.vertex2f((F32)bar_right - offset, begin + 1); -					gGL.vertex2f((F32)bar_right - offset, begin); -					gGL.vertex2f((F32)bar_right - offset - 1, begin); -					gGL.vertex2f((F32)bar_right - offset - 1, begin + 1); -				} -				else -				{ -					gGL.vertex2f(begin, (F32)bar_bottom + offset + 1); -					gGL.vertex2f(begin, (F32)bar_bottom + offset); -					gGL.vertex2f(begin + 1, (F32)bar_bottom + offset); -					gGL.vertex2f(begin + 1, (F32)bar_bottom + offset + 1 ); -				} -			} -			gGL.end(); -		} -		else -		{ -			S32 begin = (S32) ((current - mCurMinBar) * value_scale) - 1; -			S32 end = (S32) ((current - mCurMinBar) * value_scale) + 1; -			// draw current -			if (mOrientation == HORIZONTAL) -			{ -				gl_rect_2d(bar_left, end, bar_right, begin, LLColor4(1.f, 0.f, 0.f, 1.f)); -			} -			else -			{ -				gl_rect_2d(begin, bar_top, end, bar_bottom, LLColor4(1.f, 0.f, 0.f, 1.f)); -			} -		} - -		// draw mean bar -		{ -			const S32 begin = (S32) ((mean - mCurMinBar) * value_scale) - 1; -			const S32 end = (S32) ((mean - mCurMinBar) * value_scale) + 1; -			if (mOrientation == HORIZONTAL) -			{ -				gl_rect_2d(bar_left - 2, begin, bar_right + 2, end, LLColor4(0.f, 1.f, 0.f, 1.f)); -			} -			else -			{ -				gl_rect_2d(begin, bar_top + 2, end, bar_bottom - 2, LLColor4(0.f, 1.f, 0.f, 1.f)); -			} -		} +            if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) +            { +                const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; +                F32 value = 0; +                S32 i; +                gGL.color4f( 1.f, 0.f, 0.f, 1.f ); +                gGL.begin( LLRender::QUADS ); +                const S32 max_frame = llmin(mNumFrames, num_values); +                U32 num_samples = 0; +                for (i = 1; i <= max_frame; i++) +                { +                    F32 offset = ((F32)i / (F32)mNumFrames) * span; +                    LLTrace::Recording& recording = frame_recording.getPrevRecording(i); + +                    if (mCountFloatp) +                    { +                        value       = mPerSec  +                                        ? recording.getPerSec(*mCountFloatp)  +                                        : recording.getSum(*mCountFloatp); +                        num_samples = recording.getSampleCount(*mCountFloatp); +                    } +                    else if (mEventFloatp) +                    { +                        value       = recording.getMean(*mEventFloatp); +                        num_samples = recording.getSampleCount(*mEventFloatp); +                    } +                    else if (mSampleFloatp) +                    { +                        value       = recording.getMean(*mSampleFloatp); +                        num_samples = recording.getSampleCount(*mSampleFloatp); +                    } +                     +                    if (!num_samples) continue; + +                    F32 begin = (value  - mCurMinBar) * value_scale; +                    if (mOrientation == HORIZONTAL) +                    { +                        gGL.vertex2f((F32)bar_right - offset, begin + 1); +                        gGL.vertex2f((F32)bar_right - offset, begin); +                        gGL.vertex2f((F32)bar_right - offset - 1, begin); +                        gGL.vertex2f((F32)bar_right - offset - 1, begin + 1); +                    } +                    else +                    { +                        gGL.vertex2f(begin, (F32)bar_bottom + offset + 1); +                        gGL.vertex2f(begin, (F32)bar_bottom + offset); +                        gGL.vertex2f(begin + 1, (F32)bar_bottom + offset); +                        gGL.vertex2f(begin + 1, (F32)bar_bottom + offset + 1 ); +                    } +                } +                gGL.end(); +            } +            else +            { +                S32 begin = (S32) ((current - mCurMinBar) * value_scale) - 1; +                S32 end = (S32) ((current - mCurMinBar) * value_scale) + 1; +                // draw current +                if (mOrientation == HORIZONTAL) +                { +                    gl_rect_2d(bar_left, end, bar_right, begin, LLColor4(1.f, 0.f, 0.f, 1.f)); +                } +                else +                { +                    gl_rect_2d(begin, bar_top, end, bar_bottom, LLColor4(1.f, 0.f, 0.f, 1.f)); +                } +            } + +            // draw mean bar +            { +                const S32 begin = (S32) ((mean - mCurMinBar) * value_scale) - 1; +                const S32 end = (S32) ((mean - mCurMinBar) * value_scale) + 1; +                if (mOrientation == HORIZONTAL) +                { +                    gl_rect_2d(bar_left - 2, begin, bar_right + 2, end, LLColor4(0.f, 1.f, 0.f, 1.f)); +                } +                else +                { +                    gl_rect_2d(begin, bar_top + 2, end, bar_bottom - 2, LLColor4(0.f, 1.f, 0.f, 1.f)); +                } +            } +        }  	}  	LLView::draw(); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 94f06eb1d0..aadbbbacbb 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -819,14 +819,14 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,  		// Catch potential badness from normalization before it happens  		// -		llassert(mat_normal.mMatrix[0].isFinite3() && (mat_normal.mMatrix[0].dot3(mat_normal.mMatrix[0]).getF32() > F_APPROXIMATELY_ZERO)); -		llassert(mat_normal.mMatrix[1].isFinite3() && (mat_normal.mMatrix[1].dot3(mat_normal.mMatrix[1]).getF32() > F_APPROXIMATELY_ZERO)); -		llassert(mat_normal.mMatrix[2].isFinite3() && (mat_normal.mMatrix[2].dot3(mat_normal.mMatrix[2]).getF32() > F_APPROXIMATELY_ZERO)); -  		mat_normal.mMatrix[0].normalize3fast();  		mat_normal.mMatrix[1].normalize3fast();  		mat_normal.mMatrix[2].normalize3fast(); -		 + +		llassert(mat_normal.mMatrix[0].isFinite3()); +		llassert(mat_normal.mMatrix[1].isFinite3()); +		llassert(mat_normal.mMatrix[2].isFinite3()); +  		LLVector4a v[4];  		//get 4 corners of bounding box diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index d922659435..b61889ccfa 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -1338,7 +1338,7 @@ void LLFastTimerView::drawHelp( S32 y )  	y -= (texth + 2);  	y -= (texth + 2); -	LLFontGL::getFontMonospace()->renderUTF8(std::string("[Right-Click log selected] [ALT-Click toggle counts]"), +	LLFontGL::getFontMonospace()->renderUTF8(std::string("[Right-Click log selected]"),  		0, MARGIN, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);  } | 
