From 9c09259b8bef8f120cc6f4bb1a44f0eae37d71b3 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 14 Dec 2006 10:01:43 +0100 Subject: _mesa_swizzle_ubyte_image: Only use single swizzle_copy call when strides match. This fixes texture data corruption with glTexSubimage (and probably glTexImage under some circumstances) with the texstore swizzle path. --- src/mesa/main/texstore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 89563842c2..87f8fa7a0d 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -808,7 +808,8 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx, /* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */ - if (srcRowStride == srcWidth * srcComponents && + if (srcRowStride == dstRowStride && + srcRowStride == srcWidth * srcComponents && dimensions < 3) { /* 1 and 2D images only */ GLubyte *dstImage = (GLubyte *) dstAddr -- cgit v1.2.3