summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-04-28 10:06:05 -0600
committerBrian Paul <brianp@vmware.com>2010-04-28 10:06:08 -0600
commit7b640f9f708306b3e8c661771f29bf24bf8687fb (patch)
tree7a22c985d141bb1c2fcee595821bbaeaf37dee6a /src/mesa/state_tracker
parent56f99ee640772f71c1eac0388ba2d70935010e3e (diff)
st/mesa: fix incorrect RowStride computation
Fixes incorrect stride when getting a compressed tex image.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 92eefca2e7..61d3f0f98c 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -931,7 +931,10 @@ st_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
PIPE_TRANSFER_READ, 0, 0,
stImage->base.Width,
stImage->base.Height);
- texImage->RowStride = stImage->transfer->stride / util_format_get_blocksize(stImage->pt->format);
+ /* compute stride in texels from stride in bytes */
+ texImage->RowStride = stImage->transfer->stride
+ * util_format_get_blockwidth(stImage->pt->format)
+ / util_format_get_blocksize(stImage->pt->format);
}
else {
/* Otherwise, the image should actually be stored in