aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-16 17:16:41 +0000
committermarha <marha@users.sourceforge.net>2011-02-16 17:16:41 +0000
commit41723858b0effb450ce946297e5a606bc7348be2 (patch)
tree8831ace435ad11e06f196e62f0fb4d63fa740deb /mesalib/src/mesa/state_tracker/st_gen_mipmap.c
parent92fef6a3a6851ee123dd793788aac50c0831a964 (diff)
parent48d0dcbd5b7f80810ce259bc9ed6f57f99e27ca9 (diff)
downloadvcxsrv-41723858b0effb450ce946297e5a606bc7348be2.tar.gz
vcxsrv-41723858b0effb450ce946297e5a606bc7348be2.tar.bz2
vcxsrv-41723858b0effb450ce946297e5a606bc7348be2.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_gen_mipmap.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_gen_mipmap.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
index 0be66a2c2..5fcd806e0 100644
--- a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
@@ -105,13 +105,12 @@ st_render_mipmap(struct st_context *st,
static void
decompress_image(enum pipe_format format,
const uint8_t *src, uint8_t *dst,
- unsigned width, unsigned height)
+ unsigned width, unsigned height, unsigned src_stride)
{
const struct util_format_description *desc = util_format_description(format);
const uint bw = util_format_get_blockwidth(format);
const uint bh = util_format_get_blockheight(format);
const uint dst_stride = 4 * MAX2(width, bw);
- const uint src_stride = util_format_get_stride(format, width);
desc->unpack_rgba_8unorm(dst, dst_stride, src, src_stride, width, height);
@@ -144,10 +143,9 @@ decompress_image(enum pipe_format format,
static void
compress_image(enum pipe_format format,
const uint8_t *src, uint8_t *dst,
- unsigned width, unsigned height)
+ unsigned width, unsigned height, unsigned dst_stride)
{
const struct util_format_description *desc = util_format_description(format);
- const uint dst_stride = util_format_get_stride(format, width);
const uint src_stride = 4 * width;
desc->pack_rgba_8unorm(dst, dst_stride, src, src_stride, width, height);
@@ -236,7 +234,7 @@ fallback_generate_mipmap(struct gl_context *ctx, GLenum target,
dstTemp = malloc(dstWidth2 * dstHeight2 * comps + 000);
/* decompress the src image: srcData -> srcTemp */
- decompress_image(format, srcData, srcTemp, srcWidth, srcHeight);
+ decompress_image(format, srcData, srcTemp, srcWidth, srcHeight, srcTrans->stride);
_mesa_generate_mipmap_level(target, datatype, comps,
0 /*border*/,
@@ -248,7 +246,7 @@ fallback_generate_mipmap(struct gl_context *ctx, GLenum target,
dstWidth2); /* stride in texels */
/* compress the new image: dstTemp -> dstData */
- compress_image(format, dstTemp, dstData, dstWidth, dstHeight);
+ compress_image(format, dstTemp, dstData, dstWidth, dstHeight, dstTrans->stride);
free(srcTemp);
free(dstTemp);