diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-05-06 22:48:24 +0300 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-05-07 08:25:13 +0300 |
commit | ea268fcd48550f98baceef0294fd977ff12d2b35 (patch) | |
tree | e9c27493a8b1d6e20b31cb591b0074238470b2e5 /indra/newview | |
parent | 7d87e41bbd5d4761b1eb17e49b7a00b948d84213 (diff) |
viewer#799 getAvailableVRAMMegabytes cleanup
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterlagmeter.cpp | 4 | ||||
-rw-r--r-- | indra/newview/lltextureview.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 52 | ||||
-rw-r--r-- | indra/newview/llviewertexture.h | 4 |
4 files changed, 3 insertions, 62 deletions
diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp index 1cd46cdd44..c258da6640 100644 --- a/indra/newview/llfloaterlagmeter.cpp +++ b/indra/newview/llfloaterlagmeter.cpp @@ -179,10 +179,6 @@ void LLFloaterLagMeter::determineClient() { mClientCause->setText( getString("client_texture_loading_cause_msg", mStringArgs) ); } - else if(LLViewerTexture::isMemoryForTextureLow()) - { - mClientCause->setText( getString("client_texture_memory_cause_msg", mStringArgs) ); - } else { mClientCause->setText( getString("client_complex_objects_cause_msg", mStringArgs) ); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index f410217387..e1779ba976 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -529,12 +529,11 @@ void LLGLTexMemBar::draw() U32 texFetchLatMed = U32(recording.getMean(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); U32 texFetchLatMax = U32(recording.getMax(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); - text = llformat("GL Free: %d MB Sys Free: %d MB FBO: %d MB Bias: %.2f(%d MB) Cache: %.1f/%.1f MB", - gViewerWindow->getWindow()->getAvailableVRAMMegabytes(), + text = llformat("Est. Free: %d MB Sys Free: %d MB FBO: %d MB Bias: %.2f Cache: %.1f/%.1f MB", + (S32)LLViewerTexture::sFreeVRAMMegabytes, LLMemory::getAvailableMemKB()/1024, LLRenderTarget::sBytesAllocated/(1024*1024), discard_bias, - (S32)LLViewerTexture::sFreeVRAMMegabytes, cache_usage, cache_max_usage); //, cache_entries, cache_max_entries diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 4b94fe141c..dee68b2068 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1,3 +1,4 @@ + /** * @file llviewertexture.cpp * @brief Object which handles a received image (and associated texture(s)) @@ -471,61 +472,10 @@ void LLViewerTexture::initClass() LLImageGL::sDefaultGLTexture = LLViewerFetchedTexture::sDefaultImagep->getGLTexture(); } -// tuning params -const F32 GPU_MEMORY_CHECK_WAIT_TIME = 1.0f; // non-const (used externally F32 texmem_lower_bound_scale = 0.85f; F32 texmem_middle_bound_scale = 0.925f; -//static -bool LLViewerTexture::isMemoryForTextureLow() -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - // Note: we need to figure out a better source for 'min' values, - // what is free for low end at minimal settings is 'nothing left' - // for higher end gpus at high settings. - const S32Megabytes MIN_FREE_TEXTURE_MEMORY(20); - const S32Megabytes MIN_FREE_MAIN_MEMORY(100); - - S32Megabytes gpu; - S32Megabytes physical; - getGPUMemoryForTextures(gpu, physical); - - return (gpu < MIN_FREE_TEXTURE_MEMORY); // || (physical < MIN_FREE_MAIN_MEMORY); -} - -//static -void LLViewerTexture::getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - static LLFrameTimer timer; - - static S32Megabytes gpu_res = S32Megabytes(S32_MAX); - static S32Megabytes physical_res = S32Megabytes(S32_MAX); - - if (timer.getElapsedTimeF32() < GPU_MEMORY_CHECK_WAIT_TIME) //call this once per second. - { - gpu = gpu_res; - physical = physical_res; - return; - } - timer.reset(); - - { - // For purposes of texture memory need to check both, actual free - // memory and estimated free texture memory from bias calculations - U32 free_memory = llmin(gViewerWindow->getWindow()->getAvailableVRAMMegabytes(), (U32)sFreeVRAMMegabytes); - gpu_res = (S32Megabytes)free_memory; - - //check main memory, only works for windows and macos. - LLMemory::updateMemoryInfo(); - physical_res = LLMemory::getAvailableMemKB(); - - gpu = gpu_res; - physical = physical_res; - } -} - //static void LLViewerTexture::updateClass() { diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index ffa072b7f6..16446ffe58 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -185,11 +185,7 @@ private: friend class LLUIImageList; virtual void switchToCachedImage(); - - static void getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical); -public: - static bool isMemoryForTextureLow(); protected: friend class LLViewerTextureList; LLUUID mID; |