summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llimagegl.cpp23
-rw-r--r--indra/llrender/llimagegl.h3
2 files changed, 17 insertions, 9 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 5cf3a2a15f..63f9a67e2c 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1685,18 +1685,23 @@ void LLImageGL::syncToMainThread(LLGLuint new_tex_name)
[=]()
{
LL_PROFILE_ZONE_NAMED("cglt - delete callback");
- if (new_tex_name != 0)
- {
- if (mTexName != 0 && mTexName != new_tex_name)
- {
- LLImageGL::deleteTextures(1, &mTexName);
- }
- mTexName = new_tex_name;
- unref();
- }
+ syncTexName(new_tex_name);
+ unref();
});
}
+void LLImageGL::syncTexName(LLGLuint texname)
+{
+ if (texname != 0)
+ {
+ if (mTexName != 0 && mTexName != texname)
+ {
+ LLImageGL::deleteTextures(1, &mTexName);
+ }
+ mTexName = texname;
+ }
+}
+
BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok) const
{
llassert_always(sAllowReadBackRaw) ;
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index 574d83c37e..4d5b60d6bc 100644
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -304,6 +304,9 @@ public:
void setTexName(GLuint texName) { mTexName = texName; }
+ //similar to setTexName, but will call deleteTextures on mTexName if mTexName is not 0 or texname
+ void syncTexName(LLGLuint texname);
+
//for debug use: show texture size distribution
//----------------------------------------
static S32 sCurTexSizeBar ;