SH-3406 WIP convert fast timers to lltrace system

gcc 4.1 fixes
master
Richard Linden 2013-01-11 15:45:20 -08:00
parent 85df1df3c3
commit 512d7381ec
3 changed files with 8 additions and 14 deletions

View File

@ -76,8 +76,8 @@ struct LLUnit
typedef STORAGE_TYPE storage_t;
// default initialization
LLUnit()
: mValue(storage_t())
LLUnit(storage_t value = storage_t())
: mValue(value)
{}
// unit initialization and conversion
@ -85,12 +85,6 @@ struct LLUnit
LLUnit(LLUnit<OTHER_UNIT, OTHER_STORAGE> other)
: mValue(convert(other))
{}
// value initialization
template<typename CONVERTABLE_TYPE>
LLUnit(CONVERTABLE_TYPE value)
: mValue(value)
{}
// value assignment
self_t& operator = (storage_t value)

View File

@ -394,7 +394,7 @@ void update_statistics()
static LLFrameTimer texture_stats_timer;
if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq)
{
gTotalTextureData = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value();
gTotalTextureData = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT));
texture_stats_timer.reset();
}
}

View File

@ -533,7 +533,7 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
sTotalTextureMemory >= sMaxTotalTextureMem)
{
//when texture memory overflows, lower down the threshold to release the textures more aggressively.
sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, LLUnit<LLUnits::Bytes, S32>(gMaxVideoRam));
sMaxDesiredTextureMem = (S32)llmin(sMaxDesiredTextureMem * 0.75f, LLUnit<LLUnits::Bytes, S32>(gMaxVideoRam));
// If we are using more texture memory than we should,
// scale up the desired discard level
@ -549,8 +549,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
sEvaluationTimer.reset();
}
else if (sDesiredDiscardBias > 0.0f &&
sBoundTextureMemory < sMaxBoundTextureMem * texmem_lower_bound_scale &&
sTotalTextureMemory < sMaxTotalTextureMem * texmem_lower_bound_scale)
sBoundTextureMemory < (S32)(sMaxBoundTextureMem * texmem_lower_bound_scale) &&
sTotalTextureMemory < (S32)(sMaxTotalTextureMem * texmem_lower_bound_scale))
{
// If we are using less texture memory than we should,
// scale down the desired discard level
@ -568,8 +568,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
sCameraMovingBias = llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1);
sCameraMovingDiscardBias = (S8)(sCameraMovingBias);
LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < 0.75f * sMaxBoundTextureMem * texmem_middle_bound_scale) &&
(sTotalTextureMemory < 0.75f * sMaxTotalTextureMem * texmem_middle_bound_scale) ;
LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < (S32)(0.75f * sMaxBoundTextureMem * texmem_middle_bound_scale)) &&
(sTotalTextureMemory < (S32)(0.75f * sMaxTotalTextureMem * texmem_middle_bound_scale));
}
//end of static functions