Fix bandwidth estimation for texture fetch
This commit is contained in:
@@ -669,14 +669,15 @@ void update_statistics(U32 frame_count)
|
|||||||
gObjectBits = 0;
|
gObjectBits = 0;
|
||||||
// gDecodedBits = 0;
|
// gDecodedBits = 0;
|
||||||
|
|
||||||
// Only update texture stats ones per second so that they are less noisy
|
//Update bandwidth stats often because texture fetch relies on them.
|
||||||
{
|
{
|
||||||
static const F32 texture_stats_freq = 10.f;
|
static const F32 texture_stats_freq = 0.1f;
|
||||||
static LLFrameTimer texture_stats_timer;
|
static LLFrameTimer texture_stats_timer;
|
||||||
if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq)
|
if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq)
|
||||||
{
|
{
|
||||||
LLViewerStats::getInstance()->mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f);
|
LLViewerStats::getInstance()->mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f);
|
||||||
LLViewerStats::getInstance()->mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets);
|
LLViewerStats::getInstance()->mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets);
|
||||||
|
LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerTextureList::sTextureBits/1024.f/texture_stats_timer.getElapsedTimeF32());
|
||||||
gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8;
|
gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8;
|
||||||
LLViewerTextureList::sTextureBits = 0;
|
LLViewerTextureList::sTextureBits = 0;
|
||||||
LLViewerTextureList::sTexturePackets = 0;
|
LLViewerTextureList::sTexturePackets = 0;
|
||||||
|
|||||||
@@ -628,7 +628,6 @@ void LLViewerTextureList::updateImages(F32 max_time)
|
|||||||
clearFetchingRequests();
|
clearFetchingRequests();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec());
|
|
||||||
|
|
||||||
S32 global_raw_memory;
|
S32 global_raw_memory;
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user