diff options
author | Oz Linden <oz@lindenlab.com> | 2011-06-17 17:32:28 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-06-17 17:32:28 -0400 |
commit | 068c6d45099411d7827db3e50d9c91331fa5c189 (patch) | |
tree | c46cce78e6db0d87c1d9b0da9229ea0cf1d727de /indra/llrender/llimagegl.cpp | |
parent | 5e5be51edebf0fb6a59d4907c9fcaac1b1667ac4 (diff) | |
parent | 806b11c5720e1bd9e9764fcfd896436b8385e8b2 (diff) |
merge mesh branch changes (storm-1390)
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index d408077c68..60a5962234 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1083,12 +1083,17 @@ void LLImageGL::generateTextures(S32 numTextures, U32 *textures) } // static -void LLImageGL::deleteTextures(S32 numTextures, U32 *textures) +void LLImageGL::deleteTextures(S32 numTextures, U32 *textures, bool immediate) { for (S32 i = 0; i < numTextures; i++) { sDeadTextureList.push_back(textures[i]); } + + if (immediate) + { + LLImageGL::deleteDeadTextures(); + } } // static @@ -1413,11 +1418,13 @@ void LLImageGL::deleteDeadTextures() { GLuint tex = sDeadTextureList.front(); sDeadTextureList.pop_front(); - for (int i = 0; i < gGLManager.mNumTextureUnits; i++) + for (int i = 0; i < gGLManager.mNumTextureImageUnits; i++) { - if (sCurrentBoundTextures[i] == tex) + LLTexUnit* tex_unit = gGL.getTexUnit(i); + + if (tex_unit->getCurrTexture() == tex) { - gGL.getTexUnit(i)->unbind(LLTexUnit::TT_TEXTURE); + tex_unit->unbind(tex_unit->getCurrType()); stop_glerror(); } } |