diff options
author | Don Kjer <don@lindenlab.com> | 2007-05-02 21:24:47 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2007-05-02 21:24:47 +0000 |
commit | 1c909afe3998778e4cc045c9ab733e8afbf7c25b (patch) | |
tree | 75c00a32a8e305280cbec253195d1113d628fc3e /indra/llrender/llimagegl.cpp | |
parent | bc59c04653bf1404e8148a8169208b146a123b28 (diff) |
svn merge -r 60342:61148 svn+ssh://svn/svn/linden/branches/maintenance into release
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index a36dfd2269..0ec161b232 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -109,19 +109,27 @@ void LLImageGL::bindExternalTexture(LLGLuint gl_name, S32 stage, LLGLenum bind_t // static void LLImageGL::unbindTexture(S32 stage, LLGLenum bind_target) { - glActiveTextureARB(GL_TEXTURE0_ARB + stage); - glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); - glBindTexture(bind_target, 0); - sCurrentBoundTextures[stage] = 0; + // LLGLSLShader can return -1 + if (stage >= 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB + stage); + glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); + glBindTexture(bind_target, 0); + sCurrentBoundTextures[stage] = 0; + } } // static (duplicated for speed and to avoid GL_TEXTURE_2D default argument which requires GL header dependency) void LLImageGL::unbindTexture(S32 stage) { - glActiveTextureARB(GL_TEXTURE0_ARB + stage); - glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); - glBindTexture(GL_TEXTURE_2D, 0); - sCurrentBoundTextures[stage] = 0; + // LLGLSLShader can return -1 + if (stage >= 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB + stage); + glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); + glBindTexture(GL_TEXTURE_2D, 0); + sCurrentBoundTextures[stage] = 0; + } } // static |