aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texcompress_s3tc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-10-10 08:28:58 +0200
committermarha <marha@users.sourceforge.net>2011-10-10 08:28:58 +0200
commitbaf98f9bb36f956245d83ecd04f90625d6d68d2b (patch)
treec4af86b7cdb9c57cc539fa0764050865233e3617 /mesalib/src/mesa/main/texcompress_s3tc.c
parent7fae5492e3ef8e5fa15f742be4c2a15b9782e89a (diff)
parentafbd3947071a33f59dda122f1ac396442a02c128 (diff)
downloadvcxsrv-baf98f9bb36f956245d83ecd04f90625d6d68d2b.tar.gz
vcxsrv-baf98f9bb36f956245d83ecd04f90625d6d68d2b.tar.bz2
vcxsrv-baf98f9bb36f956245d83ecd04f90625d6d68d2b.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/texcompress_s3tc.c')
-rw-r--r--mesalib/src/mesa/main/texcompress_s3tc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c
index 83bd6b950..29386a37d 100644
--- a/mesalib/src/mesa/main/texcompress_s3tc.c
+++ b/mesalib/src/mesa/main/texcompress_s3tc.c
@@ -182,6 +182,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
if (srcFormat != GL_RGB ||
srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
+ srcPacking->RowLength != srcWidth ||
srcPacking->SwapBytes) {
/* convert image to RGB/GLubyte */
tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
@@ -196,7 +197,8 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
srcFormat = GL_RGB;
}
else {
- pixels = (const GLubyte *) srcAddr;
+ pixels = _mesa_image_address2d(srcPacking, srcAddr, srcWidth, srcHeight,
+ srcFormat, srcType, 0, 0);
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
@@ -240,6 +242,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
+ srcPacking->RowLength != srcWidth ||
srcPacking->SwapBytes) {
/* convert image to RGBA/GLubyte */
tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
@@ -254,7 +257,8 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
srcFormat = GL_RGBA;
}
else {
- pixels = (const GLubyte *) srcAddr;
+ pixels = _mesa_image_address2d(srcPacking, srcAddr, srcWidth, srcHeight,
+ srcFormat, srcType, 0, 0);
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
@@ -297,6 +301,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
+ srcPacking->RowLength != srcWidth ||
srcPacking->SwapBytes) {
/* convert image to RGBA/GLubyte */
tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
@@ -310,7 +315,8 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
pixels = tempImage;
}
else {
- pixels = (const GLubyte *) srcAddr;
+ pixels = _mesa_image_address2d(srcPacking, srcAddr, srcWidth, srcHeight,
+ srcFormat, srcType, 0, 0);
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
@@ -353,6 +359,7 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
+ srcPacking->RowLength != srcWidth ||
srcPacking->SwapBytes) {
/* convert image to RGBA/GLubyte */
tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
@@ -366,7 +373,8 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
pixels = tempImage;
}
else {
- pixels = (const GLubyte *) srcAddr;
+ pixels = _mesa_image_address2d(srcPacking, srcAddr, srcWidth, srcHeight,
+ srcFormat, srcType, 0, 0);
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,