mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 09:30:20 +01:00
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 <jakob@vmware.com>
(cherry picked from commit 318669f196)
This commit is contained in:
parent
57a273d89b
commit
da8d65fde4
1 changed files with 15 additions and 3 deletions
|
|
@ -229,10 +229,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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue