summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Kuehling <fxkuehl@gmx.de>2005-05-16 23:01:09 +0000
committerFelix Kuehling <fxkuehl@gmx.de>2005-05-16 23:01:09 +0000
commitffd97d20aaa1cf7fa683d25deb0391f24ff14589 (patch)
tree633ed61cfb00e0a001d4f2f322e6a026fa6f001c /src
parenta33f0d302445cbef740fb8c454ec0e2d5acb0458 (diff)
Don't use _mesa_swizzle_ubyte_image if all three texture formats
involved in _mesa_textore_argb/rgba8888 (source, base-internal, destination) differ. _mesa_swizzle_ubyte_image knows only about two of the formats and can't handle the case that all three are different correctly. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=3111.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/texstore.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index e4c3f6651d..d46b23c803 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1079,6 +1079,12 @@ _mesa_texstore_rgba8888(STORE_PARAMS)
srcType == GL_UNSIGNED_BYTE &&
dstFormat == &_mesa_texformat_rgba8888 &&
littleEndian &&
+ /* Three texture formats involved: srcFormat,
+ * baseInternalFormat and destFormat (GL_RGBA). Only two
+ * may differ. _mesa_swizzle_ubyte_image can't handle two
+ * propagations at once correctly. */
+ (srcFormat == baseInternalFormat ||
+ baseInternalFormat == GL_RGBA) &&
can_swizzle(srcFormat)) {
GLubyte dstmap[4];
@@ -1252,6 +1258,12 @@ _mesa_texstore_argb8888(STORE_PARAMS)
dstFormat == &_mesa_texformat_argb8888 &&
srcType == GL_UNSIGNED_BYTE &&
littleEndian &&
+ /* Three texture formats involved: srcFormat,
+ * baseInternalFormat and destFormat (GL_RGBA). Only two
+ * may differ. _mesa_swizzle_ubyte_image can't handle two
+ * propagations at once correctly. */
+ (srcFormat == baseInternalFormat ||
+ baseInternalFormat == GL_RGBA) &&
can_swizzle(srcFormat)) {
GLubyte dstmap[4];