diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-11-13 12:12:49 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-11-13 12:12:49 +0800 |
commit | 4ffc623e0fbb3e8a8559d7d833d70cb759ff8ebc (patch) | |
tree | b699a71b4439219b78055edebe0165cf4f37ff0c /indra/newview/llviewertexturelist.cpp | |
parent | 362d0668a5927a34856233266bc6559889a4b6ac (diff) | |
parent | c654dac4b7593355a5754042d0b43e03924b3efb (diff) |
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index fc92b72513..538e6a6763 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1062,8 +1062,32 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) LLTimer create_timer; + while (!mCreateTextureList.empty()) + { + LLViewerFetchedTexture* imagep = mCreateTextureList.front(); + llassert(imagep->mCreatePending); + imagep->createTexture(); + imagep->postCreateTexture(); + imagep->mCreatePending = false; + mCreateTextureList.pop(); + + if (imagep->getDiscardLevel() < imagep->getDesiredDiscardLevel()) + { + LL_WARNS_ONCE("Texture") << "Texture will be downscaled immediately after loading." << LL_ENDL; + imagep->scaleDown(); + } + + if (create_timer.getElapsedTimeF32() > max_time) + { + break; + } + } + if (!mDownScaleQueue.empty() && gPipeline.mDownResMap.isComplete()) { + LLGLDisable blend(GL_BLEND); + gGL.setColorMask(true, true); + // just in case we downres textures, bind downresmap and copy program gPipeline.mDownResMap.bindTarget(); gCopyProgram.bind(); @@ -1077,6 +1101,7 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) // freeze. S32 min_count = (S32)mCreateTextureList.size() / 20 + 5; + create_timer.reset(); while (!mDownScaleQueue.empty()) { LLViewerFetchedTexture* image = mDownScaleQueue.front(); @@ -1101,25 +1126,6 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) gPipeline.mDownResMap.flush(); } - // do at least 5 and make sure we don't get too far behind even if it violates - // the time limit. Textures pending creation have a copy of their texture data - // in system memory, so we don't want to let them pile up. - S32 min_count = (S32) mCreateTextureList.size() / 20 + 5; - - while (!mCreateTextureList.empty()) - { - LLViewerFetchedTexture *imagep = mCreateTextureList.front(); - llassert(imagep->mCreatePending); - imagep->createTexture(); - imagep->postCreateTexture(); - imagep->mCreatePending = false; - mCreateTextureList.pop(); - - if (create_timer.getElapsedTimeF32() > max_time && --min_count <= 0) - { - break; - } - } return create_timer.getElapsedTimeF32(); } |