diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 23 | ||||
-rw-r--r-- | indra/llrender/llimagegl.h | 3 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 5 |
3 files changed, 22 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 ; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index e442afe4b1..272da6367b 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2997,10 +2997,15 @@ void LLViewerMediaImpl::doMediaTexUpdate(LLViewerMediaTexture* media_tex, U8* da // copy just the subimage covered by the image raw to GL media_tex->setSubImage(data, data_width, data_height, x_pos, y_pos, width, height, tex_name); + if (sync) { media_tex->getGLTexture()->syncToMainThread(tex_name); } + else + { + media_tex->getGLTexture()->syncTexName(tex_name); + } // release the data pointer before freeing raw so LLImageRaw destructor doesn't // free memory at data pointer |