[Mesa-dev] [PATCH 2/2] mesa: Don't minify depth for cube map arrays.

Kenneth Graunke kenneth at whitecape.org
Thu Mar 20 02:18:35 PDT 2014


Minifying depth really only make sense for 3D textures.  For 2D and Cube
arrays, we don't want to minify it.

Fixes oglconform's texture_view/basic.castTarget.cubeMapArray test,
which called glTexStorage3D to set up a cube map array with 18 layers
and 3 miplevels.  We only allocated 9 slices for miplevel 1, leading to
assertion failures when it tried to populate all 18 slices of data.

Also fixes oglconform's texture_view/basic.castTarget.2dArray test.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: Chris Forbes <chrisf at ijw.co.nz>
---
 src/mesa/main/mipmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Should apply to master - this isn't really texture view related.
It's just a bug.

diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index 521b2d8..2ad24f1 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -1788,7 +1788,7 @@ _mesa_next_mipmap_level_size(GLenum target, GLint border,
    }
 
    if ((srcDepth - 2 * border > 1) &&
-       (target != GL_TEXTURE_2D_ARRAY_EXT)) {
+       target != GL_TEXTURE_2D_ARRAY && target != GL_TEXTURE_CUBE_MAP_ARRAY) {
       *dstDepth = (srcDepth - 2 * border) / 2 + 2 * border;
    }
    else {
-- 
1.9.0



More information about the mesa-dev mailing list