aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-26 14:34:38 +0200
committermarha <marha@users.sourceforge.net>2012-03-26 14:34:38 +0200
commit1d6d472342aee7b9c68e9f1d92762ef808d35ac2 (patch)
tree49700f649b4f4fedb3346ea7c58776925be11990 /mesalib/src/mesa/state_tracker/st_gen_mipmap.c
parent0f834b91a4768673833ab4917e87d86c237bb1a6 (diff)
downloadvcxsrv-1d6d472342aee7b9c68e9f1d92762ef808d35ac2.tar.gz
vcxsrv-1d6d472342aee7b9c68e9f1d92762ef808d35ac2.tar.bz2
vcxsrv-1d6d472342aee7b9c68e9f1d92762ef808d35ac2.zip
fontconfig libxcb mesa xkeyboard-config git update 26 Mar 2012
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_gen_mipmap.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_gen_mipmap.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
index d3496642f..889200686 100644
--- a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/mesalib/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) {