aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texcompress.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-13 08:50:32 +0100
committermarha <marha@users.sourceforge.net>2012-02-13 08:50:32 +0100
commit179ebdfaf7fe0a0017054c052b76210eeff084a9 (patch)
tree5daa6e5583ced6a6b12b03e12c16ef2acedb5b5c /mesalib/src/mesa/main/texcompress.c
parent535951cba015f2a2b63292e0ca983d0d6e736b71 (diff)
parenteaa70945cb3f1a432b8c505ecede9ebc7769f36d (diff)
downloadvcxsrv-179ebdfaf7fe0a0017054c052b76210eeff084a9.tar.gz
vcxsrv-179ebdfaf7fe0a0017054c052b76210eeff084a9.tar.bz2
vcxsrv-179ebdfaf7fe0a0017054c052b76210eeff084a9.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/texcompress.c')
-rw-r--r--mesalib/src/mesa/main/texcompress.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c
index 44590ea96..c376b970e 100644
--- a/mesalib/src/mesa/main/texcompress.c
+++ b/mesalib/src/mesa/main/texcompress.c
@@ -465,6 +465,8 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
/**
* Decompress a compressed texture image, returning a GL_RGBA/GL_FLOAT image.
+ * \param srcRowStride stride in bytes between rows of blocks in the
+ * compressed source image.
*/
void
_mesa_decompress_image(gl_format format, GLuint width, GLuint height,
@@ -475,11 +477,19 @@ _mesa_decompress_image(gl_format format, GLuint width, GLuint height,
GLint i, GLint j, GLint k, GLfloat *texel);
struct swrast_texture_image texImage; /* dummy teximage */
GLuint i, j;
+ GLuint bytes, bw, bh;
+
+ bytes = _mesa_get_format_bytes(format);
+ _mesa_get_format_block_size(format, &bw, &bh);
/* setup dummy texture image info */
memset(&texImage, 0, sizeof(texImage));
texImage.Map = (void *) src;
- texImage.RowStride = srcRowStride;
+
+ /* XXX This line is a bit of a hack to adapt to the row stride
+ * convention used by the texture decompression functions.
+ */
+ texImage.RowStride = srcRowStride * bh / bytes;
switch (format) {
/* DXT formats */