diff options
author | Dave Parks <davep@lindenlab.com> | 2022-02-23 17:55:44 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-02-23 17:55:44 -0600 |
commit | fc0b238654091c6090d5d85ceda51fbc6cb71eaa (patch) | |
tree | 1f12b135e73d088b4dd0606e6a80ba3895468c35 /indra/llrender | |
parent | d9a68339d5aa18af349e347d6ed74bc01824cec7 (diff) |
Fix for media textures failing to update (and eating lots of memory) on Mac/Intel
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 23 | ||||
-rw-r--r-- | indra/llrender/llimagegl.h | 3 |
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 ; |