summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texcompress_s3tc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texcompress_s3tc.c')
-rw-r--r--src/mesa/main/texcompress_s3tc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index 35f358a8f38..07ca6b0f014 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -57,7 +57,7 @@ texstore_rgb_dxt1(STORE_PARAMS)
const GLchan *pixels;
GLint srcRowStride;
GLubyte *dst;
- const GLint texWidth = dstRowStride / 2; /* a bit of a hack */
+ const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
const GLchan *tempImage = NULL;
ASSERT(dstFormat == &_mesa_texformat_rgb_dxt1);
@@ -114,7 +114,7 @@ texstore_rgba_dxt1(STORE_PARAMS)
const GLchan *pixels;
GLint srcRowStride;
GLubyte *dst;
- const GLint texWidth = dstRowStride / 2; /* a bit of a hack */
+ const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
const GLchan *tempImage = NULL;
ASSERT(dstFormat == &_mesa_texformat_rgba_dxt1);
@@ -169,7 +169,7 @@ texstore_rgba_dxt3(STORE_PARAMS)
const GLchan *pixels;
GLint srcRowStride;
GLubyte *dst;
- const GLint texWidth = dstRowStride / 4; /* a bit of a hack */
+ const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
const GLchan *tempImage = NULL;
ASSERT(dstFormat == &_mesa_texformat_rgba_dxt3);
@@ -223,7 +223,7 @@ texstore_rgba_dxt5(STORE_PARAMS)
const GLchan *pixels;
GLint srcRowStride;
GLubyte *dst;
- const GLint texWidth = dstRowStride / 4; /* a bit of a hack */
+ const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
const GLchan *tempImage = NULL;
ASSERT(dstFormat == &_mesa_texformat_rgba_dxt5);