diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2016-03-19 21:25:36 -0400 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2016-03-28 16:15:57 -0700 |
commit | e3d9d2f8fa140e9fd3580edd9601128b12dae156 (patch) | |
tree | aac84ef0e5b5bfd3922a2d8b245da88a3c9bea5f | |
parent | ea21ce45ee26252ed8ebeaeef5ae662109dabfa9 (diff) |
st/mesa: only minify depth for 3d targets
We make sure that that image depth matches the level's depth before
copying it into place. However we should only be minifying the first
level's depth for 3d textures - array textures have the same depth for
all levels.
This fixes tests such as
dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.* and I
suspect account for a number of other odd situations I've run into where
level > 0 of array textures was messed up.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit adb40a739943d62508b9c79cbd85e3c67ee3b43b)
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index cfec627f10..32c9139ef7 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -2886,10 +2886,13 @@ st_finalize_texture(struct gl_context *ctx, /* Need to import images in main memory or held in other textures. */ if (stImage && stObj->pt != stImage->pt) { + GLuint depth = stObj->depth0; + if (stObj->base.Target == GL_TEXTURE_3D) + depth = u_minify(depth, level); if (level == 0 || (stImage->base.Width == u_minify(stObj->width0, level) && stImage->base.Height == u_minify(stObj->height0, level) && - stImage->base.Depth == u_minify(stObj->depth0, level))) { + stImage->base.Depth == depth)) { /* src image fits expected dest mipmap level size */ copy_image_data_to_texture(st, stObj, level, stImage); } |