diff options
author | Dave Parks <davep@lindenlab.com> | 2024-11-12 17:26:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-12 15:26:38 -0800 |
commit | 2b255535efbce4634cdd2c671f597774e1783372 (patch) | |
tree | 24be217e4002dcb9ee7d78df4d305a4740038a68 /indra/newview/llviewertexturelist.cpp | |
parent | 13c0708cc70078e5118dd88de57d4ffd52f85024 (diff) |
2590 mac intel and radeon pro 5300m horrible fps 2 (#3030)
* OpenGL 3.3 compatibility pass. Fix for FBO driven downscaling corrupting textures.
* Increase maximum texture bias, immediately scale down when textures are loaded higher resolution than desired
* #2590 Fix for some frame stalls on Intel Macs
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 0d609b8084..5f678d4008 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1052,8 +1052,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(); @@ -1067,6 +1091,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(); @@ -1091,25 +1116,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(); } |