summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2021-04-29 17:38:15 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2021-04-29 17:38:15 +0300
commitc8977fd904df10f225915ac5527d279440356257 (patch)
tree1701da8b3680bf6a65cab2dbe9edf6d620ff74be /indra/newview
parent39503419163aff0cb1cd305de924f4edc68833b0 (diff)
SL-15177 Fix the way of counting for gTextureTimer
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llappviewer.cpp4
-rw-r--r--indra/newview/llfloatertexturefetchdebugger.cpp8
-rw-r--r--indra/newview/llfloatertexturefetchdebugger.h1
-rw-r--r--indra/newview/llviewerstats.cpp23
-rw-r--r--indra/newview/llviewerstats.h1
-rw-r--r--indra/newview/llviewertexture.h1
-rw-r--r--indra/newview/llviewertexturelist.cpp30
-rw-r--r--indra/newview/llviewertexturelist.h2
-rw-r--r--indra/newview/skins/default/xui/en/floater_scene_load_stats.xml9
-rw-r--r--indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml12
11 files changed, 93 insertions, 9 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 398dc65727..5502b3db55 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12608,6 +12608,17 @@
<key>Value</key>
<integer>32</integer>
</map>
+ <key>TextureListFetchingThreshold</key>
+ <map>
+ <key>Comment</key>
+ <string>If the ratio between fetched and all textures in the list is greater than this threshold, which we assume that almost all textures are fetched</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.97</real>
+ </map>
<key>TextureLoadFullRes</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 5a64f5e01c..1ffb3777cb 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4856,6 +4856,10 @@ void LLAppViewer::idle()
//
// Special case idle if still starting up
//
+ if (LLStartUp::getStartupState() >= STATE_WORLD_INIT)
+ {
+ update_texture_time();
+ }
if (LLStartUp::getStartupState() < STATE_STARTED)
{
// Skip rest if idle startup returns false (essentially, no world yet)
diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp
index 9a23d99802..cda4dc8bcc 100644
--- a/indra/newview/llfloatertexturefetchdebugger.cpp
+++ b/indra/newview/llfloatertexturefetchdebugger.cpp
@@ -38,6 +38,7 @@
#include "llappviewer.h"
#include "lltexturefetch.h"
#include "llviewercontrol.h"
+#include "llviewerassetstats.h" //gTextureTimer
LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key)
: LLFloater(key),
@@ -50,6 +51,7 @@ LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key)
mCommitCallbackRegistrar.add("TexFetchDebugger.Start", boost::bind(&LLFloaterTextureFetchDebugger::onClickStart, this));
mCommitCallbackRegistrar.add("TexFetchDebugger.Clear", boost::bind(&LLFloaterTextureFetchDebugger::onClickClear, this));
mCommitCallbackRegistrar.add("TexFetchDebugger.Close", boost::bind(&LLFloaterTextureFetchDebugger::onClickClose, this));
+ mCommitCallbackRegistrar.add("TexFetchDebugger.ResetFetchTime", boost::bind(&LLFloaterTextureFetchDebugger::onClickResetFetchTime, this));
mCommitCallbackRegistrar.add("TexFetchDebugger.CacheRead", boost::bind(&LLFloaterTextureFetchDebugger::onClickCacheRead, this));
mCommitCallbackRegistrar.add("TexFetchDebugger.CacheWrite", boost::bind(&LLFloaterTextureFetchDebugger::onClickCacheWrite, this));
@@ -228,6 +230,12 @@ void LLFloaterTextureFetchDebugger::onClickClose()
delete this;
}
+void LLFloaterTextureFetchDebugger::onClickResetFetchTime()
+{
+ gTextureTimer.start();
+ gTextureTimer.pause();
+}
+
void LLFloaterTextureFetchDebugger::onClickClear()
{
mButtonStateMap["start_btn"] = true;
diff --git a/indra/newview/llfloatertexturefetchdebugger.h b/indra/newview/llfloatertexturefetchdebugger.h
index 096ad88e07..637f3b03e5 100644
--- a/indra/newview/llfloatertexturefetchdebugger.h
+++ b/indra/newview/llfloatertexturefetchdebugger.h
@@ -44,6 +44,7 @@ public:
void onClickStart();
void onClickClear();
void onClickClose();
+ void onClickResetFetchTime();
void onClickCacheRead();
void onClickCacheWrite();
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 05f88b0a75..0380bb47fc 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -206,6 +206,7 @@ LLTrace::EventStatHandle<F64Seconds > AVATAR_EDIT_TIME("avataredittime", "Second
LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > OBJECT_CACHE_HIT_RATE("object_cache_hits");
+LLTrace::EventStatHandle<F64Seconds > TEXTURE_FETCH_TIME("texture_fetch_time");
}
LLViewerStats::LLViewerStats()
@@ -387,15 +388,6 @@ void update_statistics()
add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, F64Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET)));
gTransferManager.resetTransferBitsIn(LLTCT_ASSET);
- if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
- {
- gTextureTimer.pause();
- }
- else
- {
- gTextureTimer.unpause();
- }
-
sample(LLStatViewer::VISIBLE_AVATARS, LLVOAvatar::sNumVisibleAvatars);
LLWorld::getInstance()->updateNetStats();
LLWorld::getInstance()->requestCacheMisses();
@@ -417,6 +409,19 @@ void update_statistics()
}
}
+void update_texture_time()
+{
+ if (gTextureList.isPrioRequestsFetched())
+ {
+ gTextureTimer.pause();
+ }
+ else
+ {
+ gTextureTimer.unpause();
+ }
+
+ record(LLStatViewer::TEXTURE_FETCH_TIME, gTextureTimer.getElapsedTimeF32());
+}
/*
* The sim-side LLSD is in newsim/llagentinfo.cpp:forwardViewerStats.
*
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index 04870e0c26..64b4628daa 100644
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -295,6 +295,7 @@ static const F32 SEND_STATS_PERIOD = 300.0f;
// The following are from (older?) statistics code found in appviewer.
void update_statistics();
void send_viewer_stats(bool include_preferences);
+void update_texture_time();
extern LLFrameTimer gTextureTimer;
extern U32Bytes gTotalTextureData;
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index 69568cc825..7b4b3d940f 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -415,6 +415,7 @@ public:
BOOL isFullyLoaded() const;
BOOL hasFetcher() const { return mHasFetcher;}
+ bool isFetching() const { return mIsFetching;}
void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;}
void forceToDeleteRequest();
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 561319ca5d..82973d3278 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -205,6 +205,9 @@ static std::string get_texture_list_name()
void LLViewerTextureList::doPrefetchImages()
{
+ gTextureTimer.start();
+ gTextureTimer.pause();
+
if (LLAppViewer::instance()->getPurgeCache())
{
// cache was purged, no point
@@ -1402,6 +1405,33 @@ S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, fl
return max_texmem;
}
+bool LLViewerTextureList::isPrioRequestsFetched()
+{
+ static LLCachedControl<F32> prio_threshold(gSavedSettings, "TextureFetchUpdatePriorityThreshold", 0.0f);
+ static LLCachedControl<F32> fetching_textures_threshold(gSavedSettings, "TextureListFetchingThreshold", 0.97f);
+ S32 fetching_tex_count = 0;
+ S32 tex_count_threshold = gTextureList.mImageList.size() * (1 - fetching_textures_threshold);
+
+ for (LLViewerTextureList::image_priority_list_t::iterator iter = gTextureList.mImageList.begin();
+ iter != gTextureList.mImageList.end(); )
+ {
+ LLPointer<LLViewerFetchedTexture> imagep = *iter++;
+ if (imagep->getDecodePriority() > prio_threshold)
+ {
+ if (imagep->hasFetcher() || imagep->isFetching())
+ {
+ fetching_tex_count++;
+ if (fetching_tex_count >= tex_count_threshold)
+ {
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
const S32Megabytes VIDEO_CARD_FRAMEBUFFER_MEM(12);
const S32Megabytes MIN_MEM_FOR_NON_TEXTURE(512);
void LLViewerTextureList::updateMaxResidentTexMem(S32Megabytes mem)
diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h
index 281d23c671..fead2e52b2 100644
--- a/indra/newview/llviewertexturelist.h
+++ b/indra/newview/llviewertexturelist.h
@@ -138,6 +138,8 @@ public:
static S32Megabytes getMinVideoRamSetting();
static S32Megabytes getMaxVideoRamSetting(bool get_recommended, float mem_multiplier);
+
+ static bool isPrioRequestsFetched();
private:
void updateImagesDecodePriorities();
diff --git a/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml
index eb68b0e390..3f493192ff 100644
--- a/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml
+++ b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml
@@ -137,6 +137,15 @@
tick_spacing="100"
show_history="true"
show_bar="false"/>
+ <stat_bar name="texture_fetch_time"
+ label="Cache Fetch Time"
+ orientation="horizontal"
+ unit_label="sec"
+ stat="texture_fetch_time"
+ bar_max="1000.f"
+ tick_spacing="100"
+ show_history="true"
+ show_bar="false"/>
<stat_bar name="numimagesstat"
label="Count"
orientation="horizontal"
diff --git a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml
index 1ea256b8b3..9278a1a598 100644
--- a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml
+++ b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml
@@ -319,6 +319,18 @@
</button>
<button
follows="left|top"
+ height="22"
+ label="Reset Fetching Time"
+ layout="topleft"
+ left_pad="175"
+ name="reset_time_btn"
+ top_delta="0"
+ width="120">
+ <button.commit_callback
+ function="TexFetchDebugger.ResetFetchTime" />
+ </button>
+ <button
+ follows="left|top"
height="20"
label="Cache Read"
layout="topleft"