Mesa (7.9): mesa: fix assertions to handle srgb formats
Brian Paul
brianp at kemper.freedesktop.org
Fri Sep 24 16:18:38 UTC 2010
Module: Mesa
Branch: 7.9
Commit: b7561008922699d75b31b585b4ebc40411854008
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b7561008922699d75b31b585b4ebc40411854008
Author: Brian Paul <brianp at vmware.com>
Date: Fri Sep 24 10:16:52 2010 -0600
mesa: fix assertions to handle srgb formats
http://bugs.freedesktop.org/show_bug.cgi?id=30333
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit 9f7c8053e06663ba1f7b105f987052d9412d8fad)
---
src/mesa/main/texcompress_s3tc.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index 8e05980..45a2f9c 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -167,7 +167,8 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
const GLchan *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1);
+ ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1 ||
+ dstFormat == MESA_FORMAT_SRGB_DXT1);
ASSERT(dstXoffset % 4 == 0);
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
@@ -230,7 +231,8 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
const GLchan *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1);
+ ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1 ||
+ dstFormat == MESA_FORMAT_SRGBA_DXT1);
ASSERT(dstXoffset % 4 == 0);
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
@@ -292,7 +294,8 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
const GLchan *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3);
+ ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3 ||
+ dstFormat == MESA_FORMAT_SRGBA_DXT3);
ASSERT(dstXoffset % 4 == 0);
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
@@ -353,7 +356,8 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
const GLchan *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5);
+ ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5 ||
+ dstFormat == MESA_FORMAT_SRGBA_DXT5);
ASSERT(dstXoffset % 4 == 0);
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
More information about the mesa-commit
mailing list