From 5445b4f97ab4e90a3812869ffe55c5067211f1ce Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Wed, 10 Oct 2012 15:37:43 +0200 Subject: [PATCH] Fix bandwidth estimation for texture fetch --- indra/newview/llviewerstats.cpp | 5 +++-- indra/newview/llviewertexturelist.cpp | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 98962a0fa..258d2a788 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -669,14 +669,15 @@ void update_statistics(U32 frame_count) gObjectBits = 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; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { LLViewerStats::getInstance()->mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f); LLViewerStats::getInstance()->mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets); + LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerTextureList::sTextureBits/1024.f/texture_stats_timer.getElapsedTimeF32()); gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8; LLViewerTextureList::sTextureBits = 0; LLViewerTextureList::sTexturePackets = 0; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index d685b951e..07db8e30f 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -628,7 +628,6 @@ void LLViewerTextureList::updateImages(F32 max_time) clearFetchingRequests(); return; } - LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec()); S32 global_raw_memory; {