summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lldrawpoolalpha.cpp3
-rw-r--r--indra/newview/lldrawpoolwater.cpp2
-rw-r--r--indra/newview/llviewertexture.cpp16
-rw-r--r--indra/newview/llviewertexture.h5
4 files changed, 19 insertions, 7 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index c09de14b23..6e0913705d 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 bc42dab1f2..77da29061d 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 0fd796afba..c295bc76c0 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 5fa5d893e7..facf05e52f 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -525,9 +525,12 @@ public:
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();
};
//