Skip to content
Snippets Groups Projects
Commit 4c0ba539 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Improve information in about floater for texture and disk cache

parent 5536f7b7
No related branches found
No related tags found
No related merge requests found
......@@ -198,10 +198,11 @@ const std::string LLDiskCache::metaDataToFilepath(const LLUUID& id,
const std::string LLDiskCache::getCacheInfo()
{
F32 max_in_mb = (F32)mMaxSizeBytes / (1024.0 * 1024.0);
F32 percent_used = ((F32)dirFileSize(sCacheDir) / (F32)mMaxSizeBytes) * 100.0;
uintmax_t cache_used_mb = dirFileSize(sCacheDir) / (1024U * 1024U);
uintmax_t max_in_mb = mMaxSizeBytes / (1024U * 1024U);
F64 percent_used = ((F64)cache_used_mb / (F64)max_in_mb) * 100.0;
return llformat("Max size %1.f MB (%.1f %% used)", max_in_mb, percent_used);
return llformat("%juMB / %juMB (%.1f%% used)", cache_used_mb, max_in_mb, percent_used);
}
void LLDiskCache::clearCache()
......
......@@ -3300,6 +3300,12 @@ LLSD LLAppViewer::getViewerInfo() const
info["SERVER_RELEASE_NOTES_URL"] = mServerReleaseNotesURL;
}
// populate field for the texture cache with some details
S64Bytes texture_cache_used = getTextureCache()->getUsage();
S64Bytes texture_cache_max = getTextureCache()->getMaxUsage();
F64 percent_used = ((F64)texture_cache_used.value() / (F64)texture_cache_max.value()) * 100.0;
info["TEXTURE_CACHE_INFO"] = llformat("%dMB / %dMB (%.1f%% used)", S32Megabytes(texture_cache_used).value(), S32Megabytes(texture_cache_max).value(), percent_used);
// populate field for new local disk cache with some details
info["DISK_CACHE_INFO"] = LLDiskCache::getInstance()->getCacheInfo();
......
......@@ -60,6 +60,7 @@ LOD factor: [LOD_FACTOR]
Render quality: [RENDER_QUALITY]
Advanced Lighting Model: [GPU_SHADERS]
Texture memory: [TEXTURE_MEMORY]MB
Texture cache: [TEXTURE_CACHE_INFO]
Disk cache: [DISK_CACHE_INFO]
</string>
<string name="AboutOSXHiDPI">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment