summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexturelist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r--indra/newview/llviewertexturelist.cpp44
1 files changed, 25 insertions, 19 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 0d609b8084..2dc0458d99 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->hasGLTexture() && 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();
}