summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-05-18 10:28:04 -0600
committerBrian Paul <brianp@vmware.com>2009-05-18 10:28:04 -0600
commit7ce105d2e6885eeac73c59dc14c4cd59a89c1425 (patch)
tree52a2039d7f2c3a68c3ca8f49e73897d5a586b304
parentadabd0e81e287cd5dac60fa63841d8b096d10d5f (diff)
st/mesa: fix incorrect src/dst stride params to _mesa_generate_mipmap_level()
The stride needs to be in texels, not bytes.
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index 3a88908022..dc6d77825f 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -123,6 +123,7 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
struct pipe_transfer *srcTrans, *dstTrans;
const ubyte *srcData;
ubyte *dstData;
+ int srcStride, dstStride;
srcTrans = st_cond_flush_get_tex_transfer(st_context(ctx), pt, face,
srcLevel, zslice,
@@ -139,14 +140,17 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
srcData = (ubyte *) screen->transfer_map(screen, srcTrans);
dstData = (ubyte *) screen->transfer_map(screen, dstTrans);
+ srcStride = srcTrans->stride / srcTrans->block.size;
+ dstStride = dstTrans->stride / dstTrans->block.size;
+
_mesa_generate_mipmap_level(target, datatype, comps,
0 /*border*/,
pt->width[srcLevel], pt->height[srcLevel], pt->depth[srcLevel],
srcData,
- srcTrans->stride, /* stride in bytes */
+ srcStride, /* stride in texels */
pt->width[dstLevel], pt->height[dstLevel], pt->depth[dstLevel],
dstData,
- dstTrans->stride); /* stride in bytes */
+ dstStride); /* stride in texels */
screen->transfer_unmap(screen, srcTrans);
screen->transfer_unmap(screen, dstTrans);