BUILDFIX: #include and dependency cleanup
parent
eb8d552df7
commit
e40065f82c
|
|
@ -27,6 +27,8 @@
|
|||
#ifndef LL_LLCOMMONUTILS_H
|
||||
#define LL_LLCOMMONUTILS_H
|
||||
|
||||
#include "lluuid.h"
|
||||
|
||||
namespace LLCommonUtils
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ void LLSmoothInterpolation::updateInterpolants()
|
|||
//-----------------------------------------------------------------------------
|
||||
// getInterpolant()
|
||||
//-----------------------------------------------------------------------------
|
||||
F32 LLSmoothInterpolation::getInterpolant(LLUnit<F32, LLUnits::Seconds> time_constant, bool use_cache)
|
||||
F32 LLSmoothInterpolation::getInterpolant(LLUnitImplicit<F32, LLUnits::Seconds> time_constant, bool use_cache)
|
||||
{
|
||||
if (time_constant == 0.f)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ public:
|
|||
static void updateInterpolants();
|
||||
|
||||
// ACCESSORS
|
||||
static F32 getInterpolant(LLUnit<F32, LLUnits::Seconds> time_constant, bool use_cache = true);
|
||||
static F32 getInterpolant(LLUnitImplicit<F32, LLUnits::Seconds> time_constant, bool use_cache = true);
|
||||
|
||||
template<typename T>
|
||||
static T lerp(T a, T b, LLUnit<F32, LLUnits::Seconds> time_constant, bool use_cache = true)
|
||||
static T lerp(T a, T b, LLUnitImplicit<F32, LLUnits::Seconds> time_constant, bool use_cache = true)
|
||||
{
|
||||
F32 interpolant = getInterpolant(time_constant, use_cache);
|
||||
return ((a * (1.f - interpolant))
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ LLDate::LLDate(const LLDate& date) :
|
|||
mSecondsSinceEpoch(date.mSecondsSinceEpoch)
|
||||
{}
|
||||
|
||||
LLDate::LLDate(LLUnit<F64, LLUnits::Seconds> seconds_since_epoch) :
|
||||
LLDate::LLDate(LLUnitImplicit<F64, LLUnits::Seconds> seconds_since_epoch) :
|
||||
mSecondsSinceEpoch(seconds_since_epoch.value())
|
||||
{}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public:
|
|||
*
|
||||
* @param seconds_since_epoch The number of seconds since UTC epoch.
|
||||
*/
|
||||
LLDate(LLUnit<F64, LLUnits::Seconds> seconds_since_epoch);
|
||||
LLDate(LLUnitImplicit<F64, LLUnits::Seconds> seconds_since_epoch);
|
||||
|
||||
/**
|
||||
* @brief Construct a date from a string representation
|
||||
|
|
|
|||
|
|
@ -111,9 +111,9 @@ static timer_tree_dfs_iterator_t end_timer_tree()
|
|||
struct SortTimerByName
|
||||
{
|
||||
bool operator()(const TimeBlock* i1, const TimeBlock* i2)
|
||||
{
|
||||
{
|
||||
return i1->getName() < i2->getName();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TimeBlock& TimeBlock::getRootTimeBlock()
|
||||
|
|
@ -227,17 +227,17 @@ void TimeBlock::incrementalUpdateTimerTree()
|
|||
|
||||
if (accumulator->mMoveUpTree)
|
||||
{
|
||||
// since ancestors have already been visited, re-parenting won't affect tree traversal
|
||||
// since ancestors have already been visited, re-parenting won't affect tree traversal
|
||||
//step up tree, bringing our descendants with us
|
||||
LL_DEBUGS("FastTimers") << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() <<
|
||||
" to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL;
|
||||
timerp->setParent(timerp->getParent()->getParent());
|
||||
accumulator->mParent = timerp->getParent();
|
||||
accumulator->mMoveUpTree = false;
|
||||
accumulator->mParent = timerp->getParent();
|
||||
accumulator->mMoveUpTree = false;
|
||||
|
||||
// don't bubble up any ancestors until descendants are done bubbling up
|
||||
// as ancestors may call this timer only on certain paths, so we want to resolve
|
||||
// child-most block locations before their parents
|
||||
// as ancestors may call this timer only on certain paths, so we want to resolve
|
||||
// child-most block locations before their parents
|
||||
it.skipAncestors();
|
||||
}
|
||||
}
|
||||
|
|
@ -357,7 +357,7 @@ void TimeBlock::logStats()
|
|||
// doesn't work correctly on the first frame
|
||||
total_time += frame_recording.getLastRecording().getSum(timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sd["Total"]["Time"] = (LLSD::Real) total_time.value();
|
||||
sd["Total"]["Calls"] = (LLSD::Integer) 1;
|
||||
|
|
@ -366,7 +366,7 @@ void TimeBlock::logStats()
|
|||
LLMutexLock lock(sLogLock);
|
||||
sLogQueue.push(sd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -413,7 +413,7 @@ void TimeBlock::writeLog(std::ostream& os)
|
|||
LLSDSerialize::toXML(sd, os);
|
||||
LLMutexLock lock(sLogLock);
|
||||
sLogQueue.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -470,7 +470,7 @@ LLUnit<F64, LLUnits::Seconds> BlockTimer::getElapsedTime()
|
|||
{
|
||||
U64 total_time = TimeBlock::getCPUClockCount64() - mStartTime;
|
||||
|
||||
return (F64)total_time / (F64)TimeBlock::countsPerSecond();
|
||||
return LLUnits::Seconds::fromValue((F64)total_time / (F64)TimeBlock::countsPerSecond());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "llerror.h"
|
||||
#include "llstl.h"
|
||||
#include "llpredicate.h"
|
||||
#include "llsd.h"
|
||||
|
||||
namespace LLTypeTags
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef LL_LLSDUTIL_H
|
||||
#define LL_LLSDUTIL_H
|
||||
|
||||
class LLSD;
|
||||
#include "llsd.h"
|
||||
|
||||
// U32
|
||||
LL_COMMON_API LLSD ll_sd_from_U32(const U32);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "llstring.h"
|
||||
#include "llerror.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llsd.h"
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include "llwin32headerslean.h"
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@
|
|||
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <locale>
|
||||
//#include <locale>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
#include "llsd.h"
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "llformat.h"
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
|
|
@ -50,6 +51,7 @@
|
|||
#endif
|
||||
|
||||
const char LL_UNKNOWN_CHAR = '?';
|
||||
class LLSD;
|
||||
|
||||
#if LL_DARWIN || LL_LINUX || LL_SOLARIS
|
||||
// Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already)
|
||||
|
|
|
|||
|
|
@ -1396,13 +1396,13 @@ public:
|
|||
<< " seconds ";
|
||||
}
|
||||
|
||||
S32 precision = LL_CONT.precision();
|
||||
S32 precision = LL_CONT.precision();
|
||||
|
||||
LL_CONT << std::fixed << std::setprecision(1) << framerate << '\n'
|
||||
<< LLMemoryInfo();
|
||||
|
||||
LL_CONT.precision(precision);
|
||||
LL_CONT << LL_ENDL;
|
||||
LL_CONT.precision(precision);
|
||||
LL_CONT << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "lltimer.h"
|
||||
#include "llrefcount.h"
|
||||
#include "llthreadlocalstorage.h"
|
||||
#include <limits>
|
||||
|
||||
namespace LLTrace
|
||||
{
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void Recording::handleReset()
|
|||
{
|
||||
mBuffers.write()->reset();
|
||||
|
||||
mElapsedSeconds = 0.0;
|
||||
mElapsedSeconds = LLUnits::Seconds::fromValue(0.0);
|
||||
mSamplingTimer.reset();
|
||||
}
|
||||
|
||||
|
|
@ -131,14 +131,14 @@ void Recording::appendRecording( Recording& other )
|
|||
LLUnit<F64, LLUnits::Seconds> Recording::getSum(const TraceType<TimeBlockAccumulator>& stat)
|
||||
{
|
||||
const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
|
||||
return (F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter)
|
||||
/ (F64)LLTrace::TimeBlock::countsPerSecond();
|
||||
return LLUnits::Seconds::fromValue((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter)
|
||||
/ (F64)LLTrace::TimeBlock::countsPerSecond());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Seconds> Recording::getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat)
|
||||
{
|
||||
const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
|
||||
return (F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond();
|
||||
return LLUnits::Seconds::fromValue((F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -151,16 +151,16 @@ LLUnit<F64, LLUnits::Seconds> Recording::getPerSec(const TraceType<TimeBlockAccu
|
|||
{
|
||||
const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
|
||||
|
||||
return (F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter)
|
||||
/ ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value());
|
||||
return LLUnits::Seconds::fromValue((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter)
|
||||
/ ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value()));
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Seconds> Recording::getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat)
|
||||
{
|
||||
const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
|
||||
|
||||
return (F64)(accumulator.mSelfTimeCounter)
|
||||
/ ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value());
|
||||
return LLUnits::Seconds::fromValue((F64)(accumulator.mSelfTimeCounter)
|
||||
/ ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value()));
|
||||
}
|
||||
|
||||
F32 Recording::getPerSec(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat)
|
||||
|
|
@ -170,52 +170,52 @@ F32 Recording::getPerSec(const TraceType<TimeBlockAccumulator::CallCountFacet>&
|
|||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getMin(const TraceType<MemStatAccumulator>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mSize.getMin();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMin());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getMean(const TraceType<MemStatAccumulator>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mSize.getMean();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMean());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getMax(const TraceType<MemStatAccumulator>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mSize.getMax();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMax());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getStandardDeviation(const TraceType<MemStatAccumulator>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getLastValue(const TraceType<MemStatAccumulator>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getMin(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getMean(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getMax(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getStandardDeviation(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation());
|
||||
}
|
||||
|
||||
LLUnit<F64, LLUnits::Bytes> Recording::getLastValue(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
|
||||
{
|
||||
return mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue();
|
||||
return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue());
|
||||
}
|
||||
|
||||
U32 Recording::getSum(const TraceType<MemStatAccumulator::AllocationCountFacet>& stat)
|
||||
|
|
@ -603,7 +603,7 @@ F64 PeriodicRecording::getPeriodMean( const TraceType<SampleAccumulator>& stat,
|
|||
size_t total_periods = mRecordingPeriods.size();
|
||||
num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods);
|
||||
|
||||
LLUnit<F64, LLUnits::Seconds> total_duration = 0.f;
|
||||
LLUnit<F64, LLUnits::Seconds> total_duration(0.f);
|
||||
|
||||
F64 mean = 0;
|
||||
if (num_periods <= 0) { return mean; }
|
||||
|
|
|
|||
|
|
@ -141,8 +141,17 @@ protected:
|
|||
template<typename STORAGE_TYPE, typename UNIT_TYPE>
|
||||
std::ostream& operator <<(std::ostream& s, const LLUnit<STORAGE_TYPE, UNIT_TYPE>& unit)
|
||||
{
|
||||
s << unit.value() << UNIT_TYPE::getUnitLabel();
|
||||
return s;
|
||||
s << unit.value() << UNIT_TYPE::getUnitLabel();
|
||||
return s;
|
||||
}
|
||||
|
||||
template<typename STORAGE_TYPE, typename UNIT_TYPE>
|
||||
std::istream& operator >>(std::istream& s, LLUnit<STORAGE_TYPE, UNIT_TYPE>& unit)
|
||||
{
|
||||
STORAGE_TYPE val;
|
||||
s >> val;
|
||||
unit = val;
|
||||
return s;
|
||||
}
|
||||
|
||||
template<typename STORAGE_TYPE, typename UNIT_TYPE>
|
||||
|
|
@ -172,8 +181,17 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNIT_TYPE>
|
|||
template<typename STORAGE_TYPE, typename UNIT_TYPE>
|
||||
std::ostream& operator <<(std::ostream& s, const LLUnitImplicit<STORAGE_TYPE, UNIT_TYPE>& unit)
|
||||
{
|
||||
s << unit.value() << UNIT_TYPE::getUnitLabel();
|
||||
return s;
|
||||
s << unit.value() << UNIT_TYPE::getUnitLabel();
|
||||
return s;
|
||||
}
|
||||
|
||||
template<typename STORAGE_TYPE, typename UNIT_TYPE>
|
||||
std::istream& operator >>(std::istream& s, LLUnitImplicit<STORAGE_TYPE, UNIT_TYPE>& unit)
|
||||
{
|
||||
STORAGE_TYPE val;
|
||||
s >> val;
|
||||
unit = val;
|
||||
return s;
|
||||
}
|
||||
|
||||
template<typename S, typename T>
|
||||
|
|
@ -201,7 +219,7 @@ LL_FORCE_INLINE void ll_convert_units(LLUnit<S1, T1> in, LLUnit<S2, T2>& out, ..
|
|||
|
||||
{
|
||||
// T1 and T2 fully reduced and equal...just copy
|
||||
out = (S2)in.value();
|
||||
out = LLUnit<S2, T2>((S2)in.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -447,33 +465,33 @@ template<typename VALUE_TYPE>
|
|||
struct LLUnitLinearOps
|
||||
{
|
||||
typedef LLUnitLinearOps<VALUE_TYPE> self_t;
|
||||
LLUnitLinearOps(VALUE_TYPE val) : mValue (val) {}
|
||||
LLUnitLinearOps(VALUE_TYPE val) : mResult (val) {}
|
||||
|
||||
operator VALUE_TYPE() const { return mValue; }
|
||||
VALUE_TYPE mValue;
|
||||
operator VALUE_TYPE() const { return mResult; }
|
||||
VALUE_TYPE mResult;
|
||||
|
||||
template<typename T>
|
||||
self_t operator * (T other)
|
||||
{
|
||||
return mValue * other;
|
||||
return mResult * other;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
self_t operator / (T other)
|
||||
{
|
||||
return mValue / other;
|
||||
return mResult / other;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
self_t operator + (T other)
|
||||
{
|
||||
return mValue + other;
|
||||
return mResult + other;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
self_t operator - (T other)
|
||||
{
|
||||
return mValue - other;
|
||||
return mResult - other;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -482,32 +500,32 @@ struct LLUnitInverseLinearOps
|
|||
{
|
||||
typedef LLUnitInverseLinearOps<VALUE_TYPE> self_t;
|
||||
|
||||
LLUnitInverseLinearOps(VALUE_TYPE val) : mValue (val) {}
|
||||
operator VALUE_TYPE() const { return mValue; }
|
||||
VALUE_TYPE mValue;
|
||||
LLUnitInverseLinearOps(VALUE_TYPE val) : mResult (val) {}
|
||||
operator VALUE_TYPE() const { return mResult; }
|
||||
VALUE_TYPE mResult;
|
||||
|
||||
template<typename T>
|
||||
self_t operator * (T other)
|
||||
{
|
||||
return mValue / other;
|
||||
return mResult / other;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
self_t operator / (T other)
|
||||
{
|
||||
return mValue * other;
|
||||
return mResult * other;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
self_t operator + (T other)
|
||||
{
|
||||
return mValue - other;
|
||||
return mResult - other;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
self_t operator - (T other)
|
||||
{
|
||||
return mValue + other;
|
||||
return mResult + other;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -521,35 +539,31 @@ struct base_unit_name
|
|||
template<typename STORAGE_T, typename UNIT_T> \
|
||||
static LLUnit<STORAGE_T, base_unit_name> fromValue(LLUnit<STORAGE_T, UNIT_T> value) \
|
||||
{ return LLUnit<STORAGE_T, base_unit_name>(value); } \
|
||||
}; \
|
||||
template<typename T> std::ostream& operator<<(std::ostream& s, const LLUnit<T, base_unit_name>& val) \
|
||||
{ s << val.value() << base_unit_name::getUnitLabel; return s; }
|
||||
}
|
||||
|
||||
|
||||
#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 T> std::ostream& operator<<(std::ostream& s, const LLUnit<T, unit_name>& val) \
|
||||
{ s << val.value() << unit_name::getUnitLabel; return s; } \
|
||||
\
|
||||
template<typename S1, typename S2> \
|
||||
void ll_convert_units(LLUnit<S1, unit_name> in, LLUnit<S2, base_unit_name>& out) \
|
||||
{ \
|
||||
out = (S2)(LLUnitLinearOps<S1>(in.value()) conversion_operation).mValue; \
|
||||
} \
|
||||
\
|
||||
template<typename S1, typename S2> \
|
||||
void ll_convert_units(LLUnit<S1, base_unit_name> in, LLUnit<S2, unit_name>& out) \
|
||||
{ \
|
||||
out = (S2)(LLUnitInverseLinearOps<S1>(in.value()) conversion_operation).mValue; \
|
||||
#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)); \
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include "stdtypes.h"
|
||||
#include "llpreprocessor.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "lltimer.h"
|
||||
#include "llmath.h"
|
||||
#include "llmemory.h"
|
||||
#include "llsd.h"
|
||||
|
||||
typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)();
|
||||
typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*);
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ private:
|
|||
|
||||
bool checkNaN(const F32& a) const { return !llisnan(a); }
|
||||
|
||||
//FIX* non ambigious function fix making SIN() work for calc -Cryogenic Blitz
|
||||
//FIX* non ambiguous function fix making SIN() work for calc -Cryogenic Blitz
|
||||
F32 _sin(const F32& a) const { return sin(DEG_TO_RAD * a); }
|
||||
F32 _cos(const F32& a) const { return cos(DEG_TO_RAD * a); }
|
||||
F32 _tan(const F32& a) const { return tan(DEG_TO_RAD * a); }
|
||||
|
|
@ -176,11 +176,8 @@ private:
|
|||
F32 _fabs(const F32& a) const { return fabs(a); }
|
||||
F32 _floor(const F32& a) const { return (F32)llfloor(a); }
|
||||
F32 _ceil(const F32& a) const { return llceil(a); }
|
||||
|
||||
F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); }
|
||||
|
||||
|
||||
|
||||
LLCalc::calc_map_t* mConstants;
|
||||
LLCalc::calc_map_t* mVariables;
|
||||
// LLCalc::calc_map_t* mUserVariables;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#define MATERIAL_ID_SIZE 16
|
||||
|
||||
#include <string>
|
||||
#include "llsd.h"
|
||||
|
||||
class LLMaterialID
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ U32 wpo2(U32 i);
|
|||
|
||||
U32 LLImageGL::sUniqueCount = 0;
|
||||
U32 LLImageGL::sBindCount = 0;
|
||||
LLUnit<S32, LLUnits::Bytes> LLImageGL::sGlobalTextureMemory = 0;
|
||||
LLUnit<S32, LLUnits::Bytes> LLImageGL::sBoundTextureMemory = 0;
|
||||
LLUnit<S32, LLUnits::Bytes> LLImageGL::sCurBoundTextureMemory = 0;
|
||||
LLUnit<S32, LLUnits::Bytes> LLImageGL::sGlobalTextureMemory(0);
|
||||
LLUnit<S32, LLUnits::Bytes> LLImageGL::sBoundTextureMemory(0);
|
||||
LLUnit<S32, LLUnits::Bytes> LLImageGL::sCurBoundTextureMemory(0);
|
||||
S32 LLImageGL::sCount = 0;
|
||||
LLImageGL::dead_texturelist_t LLImageGL::sDeadTextureList[LLTexUnit::TT_NONE];
|
||||
U32 LLImageGL::sCurTexName = 1;
|
||||
|
|
@ -249,7 +249,7 @@ void LLImageGL::updateStats(F32 current_time)
|
|||
LLFastTimer t(FTM_IMAGE_UPDATE_STATS);
|
||||
sLastFrameTime = current_time;
|
||||
sBoundTextureMemory = sCurBoundTextureMemory;
|
||||
sCurBoundTextureMemory = 0;
|
||||
sCurBoundTextureMemory = LLUnits::Bytes::fromValue(0);
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
// to avoid including the heavyweight llnotifications.h
|
||||
|
||||
#include "llnotificationptr.h"
|
||||
#include "lluuid.h"
|
||||
|
||||
#include <boost/function.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#define LL_TRANS_H
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include "llpointer.h"
|
||||
#include "llstring.h"
|
||||
|
|
|
|||
|
|
@ -42,12 +42,11 @@
|
|||
#include "llstring.h"
|
||||
#include "llstringtable.h"
|
||||
#include "llfile.h"
|
||||
|
||||
#include "lluuid.h"
|
||||
|
||||
class LLVector3;
|
||||
class LLVector3d;
|
||||
class LLQuaternion;
|
||||
class LLUUID;
|
||||
class LLColor4;
|
||||
class LLColor4U;
|
||||
|
||||
|
|
|
|||
|
|
@ -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,7 +465,6 @@ 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;
|
||||
|
||||
if(mDiffState == WAIT_ON_RESULT
|
||||
&& !LLAppViewer::instance()->quitRequested())
|
||||
|
|
@ -483,11 +480,11 @@ 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");
|
||||
F32 elapsed_time = timer.getElapsedTimeF32();
|
||||
F32 elapsed_time = mRecordingTimer.getElapsedTimeF32();
|
||||
|
||||
if (elapsed_time > scene_load_sample_time)
|
||||
{
|
||||
|
|
@ -501,10 +498,9 @@ void LLSceneMonitor::fetchQueryResult()
|
|||
{
|
||||
mSceneLoadRecording.nextPeriod();
|
||||
}
|
||||
mRecordingTimer.reset();
|
||||
}
|
||||
}
|
||||
|
||||
timer.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ private:
|
|||
void generateDitheringTexture(S32 width, S32 height);
|
||||
|
||||
private:
|
||||
bool mEnabled;
|
||||
bool mDebugViewerVisible;
|
||||
bool mEnabled,
|
||||
mDebugViewerVisible;
|
||||
|
||||
enum EDiffState
|
||||
{
|
||||
|
|
@ -82,27 +82,27 @@ private:
|
|||
EXECUTE_DIFF,
|
||||
WAIT_ON_RESULT,
|
||||
VIEWER_QUITTING
|
||||
} mDiffState;
|
||||
} mDiffState;
|
||||
|
||||
LLRenderTarget* mFrames[2];
|
||||
LLRenderTarget* mDiff;
|
||||
LLRenderTarget* mFrames[2];
|
||||
LLRenderTarget* mDiff;
|
||||
|
||||
GLuint mQueryObject; //used for glQuery
|
||||
F32 mDiffResult; //aggregate results of mDiff.
|
||||
F32 mDiffTolerance; //pixels are filtered out when R+G+B < mDiffTolerance
|
||||
GLuint mQueryObject; //used for glQuery
|
||||
F32 mDiffResult, //aggregate results of mDiff.
|
||||
mDiffTolerance, //pixels are filtered out when R+G+B < mDiffTolerance
|
||||
mDiffPixelRatio; //ratio of pixels used for comparison against the original mDiff size along one dimension
|
||||
|
||||
F32 mDiffPixelRatio; //ratio of pixels used for comparison against the original mDiff size along one dimension
|
||||
LLPointer<LLViewerTexture> mDitheringTexture;
|
||||
S32 mDitherMatrixWidth;
|
||||
F32 mDitherScale,
|
||||
mDitherScaleS,
|
||||
mDitherScaleT;
|
||||
|
||||
LLPointer<LLViewerTexture> mDitheringTexture;
|
||||
S32 mDitherMatrixWidth;
|
||||
F32 mDitherScale;
|
||||
F32 mDitherScaleS;
|
||||
F32 mDitherScaleT;
|
||||
std::vector<LLAnimPauseRequest> mAvatarPauseHandles;
|
||||
|
||||
std::vector<LLAnimPauseRequest> mAvatarPauseHandles;
|
||||
|
||||
LLTrace::ExtendablePeriodicRecording mSceneLoadRecording;
|
||||
LLTrace::Recording mMonitorRecording;
|
||||
LLFrameTimer mRecordingTimer;
|
||||
LLTrace::ExtendablePeriodicRecording mSceneLoadRecording;
|
||||
LLTrace::Recording mMonitorRecording;
|
||||
};
|
||||
|
||||
class LLSceneMonitorView : public LLFloater
|
||||
|
|
|
|||
Loading…
Reference in New Issue