Merge branch '7.8'
[mesa.git] / src / mesa / state_tracker / st_cb_texture.c
index 613fff019d99f33d4c00a60c5fb5e35d47405920..3457214ca4c24e8c384f392459c823d7784d43a7 100644 (file)
@@ -974,7 +974,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