summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorsimon@lindenlab.com <simon@lindenlab.com>2011-06-21 09:36:31 -0700
committersimon@lindenlab.com <simon@lindenlab.com>2011-06-21 09:36:31 -0700
commitd11cabc4898a7a1995ed7c89d2cdac46dfcf24ec (patch)
tree9f8e5e57d4ed074e148227c56556bcace90e2e3a /indra/llrender/llimagegl.cpp
parentc0c0a2b9a5f41fc06619330a81c34955a39ddfe2 (diff)
parentede3b577d8cebd5065514bb485e2cbd93dd5b05a (diff)
Merge with latest lindenlab/viewer-development
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r--indra/llrender/llimagegl.cpp15
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();
}
}