diff options
author | Brian Paul <[email protected]> | 2012-03-23 08:16:58 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-03-23 10:08:49 -0600 |
commit | 318669f196ca922337da02af9d72773e76e70b45 (patch) | |
tree | de929a4376c38729aab7a88329e7c82406daf604 /src/mesa/state_tracker/st_gen_mipmap.c | |
parent | 281d0fd3a9cd2b4e97cdb58eb7854f9f90220fc7 (diff) |
st/mesa: fix mipmap image size computation w.r.t. texture arrays
The image height or depth is the array_size for array textures.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47742
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_gen_mipmap.c')
-rw-r--r-- | src/mesa/state_tracker/st_gen_mipmap.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index d3496642f54..889200686e4 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -233,10 +233,22 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, = _mesa_get_tex_image(ctx, texObj, target, srcLevel); struct gl_texture_image *dstImage; struct st_texture_image *stImage; - uint dstWidth = u_minify(pt->width0, dstLevel); - uint dstHeight = u_minify(pt->height0, dstLevel); - uint dstDepth = u_minify(pt->depth0, dstLevel); uint border = srcImage->Border; + uint dstWidth, dstHeight, dstDepth; + + dstWidth = u_minify(pt->width0, dstLevel); + if (texObj->Target == GL_TEXTURE_1D_ARRAY) { + dstHeight = pt->array_size; + } + else { + dstHeight = u_minify(pt->height0, dstLevel); + } + if (texObj->Target == GL_TEXTURE_2D_ARRAY) { + dstDepth = pt->array_size; + } + else { + dstDepth = u_minify(pt->depth0, dstLevel); + } dstImage = _mesa_get_tex_image(ctx, texObj, target, dstLevel); if (!dstImage) { |