diff options
Diffstat (limited to 'linden/indra/llrender/llimagegl.cpp')
-rw-r--r-- | linden/indra/llrender/llimagegl.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp index 8386e95..464507e 100644 --- a/linden/indra/llrender/llimagegl.cpp +++ b/linden/indra/llrender/llimagegl.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -176,7 +177,7 @@ void LLImageGL::destroyGL(BOOL save_state) | |||
176 | if (save_state) | 177 | if (save_state) |
177 | { | 178 | { |
178 | glimage->mSaveData = new LLImageRaw; | 179 | glimage->mSaveData = new LLImageRaw; |
179 | glimage->readBackRaw(glimage->mCurrentDiscardLevel, glimage->mSaveData); | 180 | glimage->readBackRaw(glimage->mCurrentDiscardLevel, glimage->mSaveData, false); |
180 | } | 181 | } |
181 | glimage->destroyGLTexture(); | 182 | glimage->destroyGLTexture(); |
182 | stop_glerror(); | 183 | stop_glerror(); |
@@ -939,7 +940,7 @@ BOOL LLImageGL::setDiscardLevel(S32 discard_level) | |||
939 | LLPointer<LLImageRaw> imageraw = new LLImageRaw; | 940 | LLPointer<LLImageRaw> imageraw = new LLImageRaw; |
940 | while(discard_level > mCurrentDiscardLevel) | 941 | while(discard_level > mCurrentDiscardLevel) |
941 | { | 942 | { |
942 | if (readBackRaw(discard_level, imageraw)) | 943 | if (readBackRaw(discard_level, imageraw, false)) |
943 | { | 944 | { |
944 | break; | 945 | break; |
945 | } | 946 | } |
@@ -961,7 +962,7 @@ BOOL LLImageGL::setDiscardLevel(S32 discard_level) | |||
961 | } | 962 | } |
962 | } | 963 | } |
963 | 964 | ||
964 | BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw) | 965 | BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok) |
965 | { | 966 | { |
966 | if (discard_level < 0) | 967 | if (discard_level < 0) |
967 | { | 968 | { |
@@ -999,7 +1000,10 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw) | |||
999 | } | 1000 | } |
1000 | 1001 | ||
1001 | LLGLint is_compressed = 0; | 1002 | LLGLint is_compressed = 0; |
1002 | glGetTexLevelParameteriv(mTarget, is_compressed, GL_TEXTURE_COMPRESSED, (GLint*)&is_compressed); | 1003 | if (compressed_ok) |
1004 | { | ||
1005 | glGetTexLevelParameteriv(mTarget, is_compressed, GL_TEXTURE_COMPRESSED, (GLint*)&is_compressed); | ||
1006 | } | ||
1003 | if (is_compressed) | 1007 | if (is_compressed) |
1004 | { | 1008 | { |
1005 | LLGLint glbytes; | 1009 | LLGLint glbytes; |