SL-18964 Smoke texture can fail to load

Debt from SL-18221.
Keep init together, after we got the cap; texture should finish loading before it's needed.
meow-7.2.2
Andrey Kleshchev 2023-03-16 00:04:11 +02:00
parent b75f353903
commit d2a8a3bd53
3 changed files with 3 additions and 13 deletions

View File

@ -281,12 +281,7 @@ void LLDrawPoolAlpha::renderDebugAlpha()
gHighlightProgram.bind();
gGL.diffuseColor4f(1, 0, 0, 1);
// SL-18964 : The creating of this texture was moved here from LLViewerTextureManager::init() to make the texture transparent before adding to cache
if (!LLViewerFetchedTexture::sSmokeImagep)
{
LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
LLViewerFetchedTexture::sSmokeImagep->setNoDelete();
}
LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f * 1024.f);
gGL.getTexUnit(0)->bindFast(LLViewerFetchedTexture::sSmokeImagep);

View File

@ -402,13 +402,6 @@ void LLViewerTextureManager::init()
LLViewerFetchedTexture::sDefaultImagep->dontDiscard();
LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER);
#if 0
// When called first time after clearing cache this call creates (and adds to cache) an opaque texture instead of transparent
// SL-18964 : The creating of this texture was moved to LLDrawPoolAlpha::renderDebugAlpha()
LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
LLViewerFetchedTexture::sSmokeImagep->setNoDelete();
#endif
image_raw = new LLImageRaw(32,32,3);
data = image_raw->getData();

View File

@ -228,6 +228,8 @@ void LLViewerTextureList::doPrefetchImages()
LLViewerTextureManager::getFetchedTexture(IMG_SHOT);
LLViewerTextureManager::getFetchedTexture(IMG_SMOKE_POOF);
LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
LLViewerFetchedTexture::sSmokeImagep->setNoDelete();
LLStandardBumpmap::addstandard();