summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-04-27 08:28:53 -0600
committerBrian Paul <[email protected]>2010-04-27 08:28:55 -0600
commitdb14a8022a2a957c83b1fe33a84af3cdb1952d68 (patch)
tree3c7de1bf2d978844cc49b53ea794c2677637e026 /src/mesa/state_tracker
parent15c53d124500864bfab66cfde43aa75d905925d8 (diff)
st/mesa: fix strides in (de)compress_image() functions
Mipmap generation for compressed textures works now.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index d6b024d8b8c..24a072ee12e 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -104,14 +104,8 @@ decompress_image(enum pipe_format format,
unsigned width, unsigned height)
{
const struct util_format_description *desc = util_format_description(format);
- const uint bw = util_format_get_blockwidth(format);
- const uint src_stride = align(width, bw) / util_format_get_blocksize(format);
const uint dst_stride = 4 * width;
-
- /*
- printf("decompress %s %d x %d %d -> %d\n",
- util_format_name(format), width, height, src_stride, dst_stride);
- */
+ const uint src_stride = util_format_get_stride(format, width);
desc->unpack_rgba_8unorm(dst, dst_stride, src, src_stride, width, height);
}
@@ -127,14 +121,8 @@ compress_image(enum pipe_format format,
unsigned width, unsigned height)
{
const struct util_format_description *desc = util_format_description(format);
- const uint bw = util_format_get_blockwidth(format);
+ const uint dst_stride = util_format_get_stride(format, width);
const uint src_stride = 4 * width;
- const uint dst_stride = align(width, bw) / util_format_get_blocksize(format);
-
- /*
- printf("compress %s %d x %d %d -> %d\n",
- util_format_name(format), width, height, src_stride, dst_stride);
- */
desc->pack_rgba_8unorm(dst, dst_stride, src, src_stride, width, height);
}