diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llrender/llimagegl.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp index 464507e..e2c4a59 100644 --- a/linden/indra/llrender/llimagegl.cpp +++ b/linden/indra/llrender/llimagegl.cpp | |||
@@ -129,19 +129,27 @@ void LLImageGL::bindExternalTexture(LLGLuint gl_name, S32 stage, LLGLenum bind_t | |||
129 | // static | 129 | // static |
130 | void LLImageGL::unbindTexture(S32 stage, LLGLenum bind_target) | 130 | void LLImageGL::unbindTexture(S32 stage, LLGLenum bind_target) |
131 | { | 131 | { |
132 | glActiveTextureARB(GL_TEXTURE0_ARB + stage); | 132 | // LLGLSLShader can return -1 |
133 | glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); | 133 | if (stage >= 0) |
134 | glBindTexture(bind_target, 0); | 134 | { |
135 | sCurrentBoundTextures[stage] = 0; | 135 | glActiveTextureARB(GL_TEXTURE0_ARB + stage); |
136 | glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); | ||
137 | glBindTexture(bind_target, 0); | ||
138 | sCurrentBoundTextures[stage] = 0; | ||
139 | } | ||
136 | } | 140 | } |
137 | 141 | ||
138 | // static (duplicated for speed and to avoid GL_TEXTURE_2D default argument which requires GL header dependency) | 142 | // static (duplicated for speed and to avoid GL_TEXTURE_2D default argument which requires GL header dependency) |
139 | void LLImageGL::unbindTexture(S32 stage) | 143 | void LLImageGL::unbindTexture(S32 stage) |
140 | { | 144 | { |
141 | glActiveTextureARB(GL_TEXTURE0_ARB + stage); | 145 | // LLGLSLShader can return -1 |
142 | glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); | 146 | if (stage >= 0) |
143 | glBindTexture(GL_TEXTURE_2D, 0); | 147 | { |
144 | sCurrentBoundTextures[stage] = 0; | 148 | glActiveTextureARB(GL_TEXTURE0_ARB + stage); |
149 | glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); | ||
150 | glBindTexture(GL_TEXTURE_2D, 0); | ||
151 | sCurrentBoundTextures[stage] = 0; | ||
152 | } | ||
145 | } | 153 | } |
146 | 154 | ||
147 | // static | 155 | // static |