Mesa (master): i965: Don' t minify depth when setting up cube map miptrees on Gen4.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Dec 20 00:32:00 UTC 2011


Module: Mesa
Branch: master
Commit: 79d981cd03f2e2e8f67ab21d52711de989bb9a44
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=79d981cd03f2e2e8f67ab21d52711de989bb9a44

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Dec 15 13:43:00 2011 -0800

i965: Don't minify depth when setting up cube map miptrees on Gen4.

Prior to Ironlake, cube maps were stored as 3D textures.  In recent
refactoring, we removed a separate "layers" parameter in favor of using
depth.  Unfortunately, depth was getting minified, which is only correct
for actual 3D textures.

Fixes piglit tests:
- bugs/crash-cubemap-order
- fbo/fbo-cubemap
- texturing/cubemap

Also changes texturing/cubemap npot from abort to fail.

This hasn't seen a full test run since Piglit on Mesa master hangs
GM45 a lot.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/i965/brw_tex_layout.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index eaea49b..4c7e88c 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -124,7 +124,8 @@ brw_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree *mt)
 	 mt->total_height += y;
 	 width  = minify(width);
 	 height = minify(height);
-	 depth  = minify(depth);
+	 if (mt->target == GL_TEXTURE_3D)
+	    depth = minify(depth);
 
 	 if (mt->compressed) {
 	    pack_y_pitch = (height + 3) / 4;




More information about the mesa-commit mailing list