diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index c09de14b238e40050d8f3e77d3b81529c9ad14ef..6e0913705d6e3040b0821a7429729a5f3c1573f4 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -315,8 +315,7 @@ void LLDrawPoolAlpha::renderDebugAlpha() { gHighlightProgram.bind(); gGL.diffuseColor4f(1, 0, 0, 1); - LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f * 1024.f); - gGL.getTexUnit(0)->bindFast(LLViewerFetchedTexture::sSmokeImagep); + gGL.getTexUnit(0)->bindFast(LLViewerFetchedTexture::getSmokeImage()); renderAlphaHighlight(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index bc42dab1f2aad784eb3e0faf4dfecff88967a004..77da29061dc076b06f4ce522a06c5cc6aca466ae 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -743,7 +743,7 @@ void LLDrawPoolWater::renderWater() LLViewerTexture *LLDrawPoolWater::getDebugTexture() { - return LLViewerFetchedTexture::sSmokeImagep; + return LLViewerTextureManager::getFetchedTexture(IMG_SMOKE); } LLColor3 LLDrawPoolWater::getDebugColor() const diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 0fd796afba714fea79ad3d1159c3662c3c0c9aae..c295bc76c0ae8c9b0d0a78b0beff1e004c93dbc6 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -408,9 +408,6 @@ void LLViewerTextureManager::init() LLViewerFetchedTexture::sDefaultImagep->dontDiscard(); LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER); - LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); - LLViewerFetchedTexture::sSmokeImagep->setNoDelete(); - image_raw = new LLImageRaw(32,32,3); data = image_raw->getData(); @@ -1013,6 +1010,19 @@ const std::string& fttype_to_string(const FTType& fttype) //start of LLViewerFetchedTexture //---------------------------------------------------------------------------------------------- +//static +LLViewerFetchedTexture* LLViewerFetchedTexture::getSmokeImage() +{ + if (sSmokeImagep.isNull()) + { + sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE); + } + + gPipeline.touchTexture(sSmokeImagep, 1024.f * 1024.f); + + return sSmokeImagep; +} + LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, const LLHost& host, BOOL usemipmaps) : LLViewerTexture(id, usemipmaps), mTargetHost(host) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 5fa5d893e71f443589d0aa3492939939295a52b1..facf05e52fbb41ada99144e011c468cf2514c2f0 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -525,9 +525,12 @@ class LLViewerFetchedTexture : public LLViewerTexture static LLPointer<LLViewerFetchedTexture> sMissingAssetImagep; // Texture to show for an image asset that is not in the database static LLPointer<LLViewerFetchedTexture> sWhiteImagep; // Texture to show NOTHING (whiteness) static LLPointer<LLViewerFetchedTexture> sDefaultImagep; // "Default" texture for error cases, the only case of fetched texture which is generated in local. - static LLPointer<LLViewerFetchedTexture> sSmokeImagep; // Old "Default" translucent texture static LLPointer<LLViewerFetchedTexture> sFlatNormalImagep; // Flat normal map denoting no bumpiness on a surface static LLPointer<LLViewerFetchedTexture> sDefaultIrradiancePBRp; // PBR: irradiance + + // not sure why, but something is iffy about the loading of this particular texture, use the accessor instead of accessing directly + static LLPointer<LLViewerFetchedTexture> sSmokeImagep; // Old "Default" translucent texture + static LLViewerFetchedTexture* getSmokeImage(); }; //