diff options
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 1196db18fa..a36dfd2269 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -157,7 +157,7 @@ void LLImageGL::destroyGL(BOOL save_state) if (save_state) { glimage->mSaveData = new LLImageRaw; - glimage->readBackRaw(glimage->mCurrentDiscardLevel, glimage->mSaveData); + glimage->readBackRaw(glimage->mCurrentDiscardLevel, glimage->mSaveData, false); } glimage->destroyGLTexture(); stop_glerror(); @@ -920,7 +920,7 @@ BOOL LLImageGL::setDiscardLevel(S32 discard_level) LLPointer<LLImageRaw> imageraw = new LLImageRaw; while(discard_level > mCurrentDiscardLevel) { - if (readBackRaw(discard_level, imageraw)) + if (readBackRaw(discard_level, imageraw, false)) { break; } @@ -942,7 +942,7 @@ BOOL LLImageGL::setDiscardLevel(S32 discard_level) } } -BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw) +BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok) { if (discard_level < 0) { @@ -980,7 +980,10 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw) } LLGLint is_compressed = 0; - glGetTexLevelParameteriv(mTarget, is_compressed, GL_TEXTURE_COMPRESSED, (GLint*)&is_compressed); + if (compressed_ok) + { + glGetTexLevelParameteriv(mTarget, is_compressed, GL_TEXTURE_COMPRESSED, (GLint*)&is_compressed); + } if (is_compressed) { LLGLint glbytes; |