diff options
author | Marek Olšák <[email protected]> | 2011-04-06 01:23:51 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-04-08 04:38:36 +0200 |
commit | 6eff8479af1a137d81d7bffc0c55a39910c28ce9 (patch) | |
tree | 11102ed21814288f3aca3ffced8448e2dada701a /src/mesa/main/texcompress_rgtc.c | |
parent | 55a629cee5c20b357cca5c767a14fb27d9691e16 (diff) |
mesa: fix dstRowDiff computation in RGTC texstore functions
Copied from libtxc_dxtn, this fixes NPOT RGTC1 textures with r300g.
I also did the same for RGTC2.
Diffstat (limited to 'src/mesa/main/texcompress_rgtc.c')
-rw-r--r-- | src/mesa/main/texcompress_rgtc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/texcompress_rgtc.c b/src/mesa/main/texcompress_rgtc.c index c50df19c5d8..d9de9bec3d1 100644 --- a/src/mesa/main/texcompress_rgtc.c +++ b/src/mesa/main/texcompress_rgtc.c @@ -121,7 +121,7 @@ _mesa_texstore_red_rgtc1(TEXSTORE_PARAMS) texWidth, (GLubyte *) dstAddr); blkaddr = dst; - dstRowDiff = dstRowStride >= (srcWidth * 4) ? dstRowStride - (((srcWidth + 3) & ~3) * 4) : 0; + dstRowDiff = dstRowStride >= (srcWidth * 2) ? dstRowStride - (((srcWidth + 3) & ~3) * 2) : 0; for (j = 0; j < srcHeight; j+=4) { if (srcHeight > j + 3) numypixels = 4; else numypixels = srcHeight - j; @@ -176,7 +176,7 @@ _mesa_texstore_signed_red_rgtc1(TEXSTORE_PARAMS) texWidth, (GLubyte *) dstAddr); blkaddr = dst; - dstRowDiff = dstRowStride >= (srcWidth * 4) ? dstRowStride - (((srcWidth + 3) & ~3) * 4) : 0; + dstRowDiff = dstRowStride >= (srcWidth * 2) ? dstRowStride - (((srcWidth + 3) & ~3) * 2) : 0; for (j = 0; j < srcHeight; j+=4) { if (srcHeight > j + 3) numypixels = 4; else numypixels = srcHeight - j; @@ -232,7 +232,7 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS) texWidth, (GLubyte *) dstAddr); blkaddr = dst; - dstRowDiff = dstRowStride >= (srcWidth * 8) ? dstRowStride - (((srcWidth + 7) & ~7) * 8) : 0; + dstRowDiff = dstRowStride >= (srcWidth * 4) ? dstRowStride - (((srcWidth + 3) & ~3) * 4) : 0; for (j = 0; j < srcHeight; j+=4) { if (srcHeight > j + 3) numypixels = 4; else numypixels = srcHeight - j; @@ -294,7 +294,7 @@ _mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS) texWidth, (GLubyte *) dstAddr); blkaddr = dst; - dstRowDiff = dstRowStride >= (srcWidth * 8) ? dstRowStride - (((srcWidth + 7) & ~7) * 8) : 0; + dstRowDiff = dstRowStride >= (srcWidth * 4) ? dstRowStride - (((srcWidth + 3) & ~3) * 4) : 0; for (j = 0; j < srcHeight; j += 4) { if (srcHeight > j + 3) numypixels = 4; else numypixels = srcHeight - j; |