summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2006-12-14 10:01:43 +0100
committerMichel Dänzer <[email protected]>2006-12-14 11:01:38 +0100
commit9c09259b8bef8f120cc6f4bb1a44f0eae37d71b3 (patch)
treee22ddc54f948e3ce110649814fd914c10c27c133 /src/mesa/main/texstore.c
parent78a6e054393533a9cb2fe9f5a087d10b0f15bd9c (diff)
_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.
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 89563842c25..87f8fa7a0d4 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