i965: fix cube map on IGDNG
authorXiang, Haihao <haihao.xiang@intel.com>
Thu, 13 Aug 2009 10:42:52 +0000 (18:42 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 13 Aug 2009 10:42:52 +0000 (18:42 +0800)
src/mesa/drivers/dri/i965/brw_tex_layout.c

index 7f9b2535340bf8dbd939dbc87dae47303b253693..1d2e953eb1ef173e84055a247ba90a6340c2fbfe 100644 (file)
@@ -65,11 +65,6 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
 
           if (mt->compressed) {
               mt->pitch = ALIGN(mt->width0, align_w);
-              qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4 * mt->pitch * mt->cpp;
-              mt->total_height = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4 * 6;
-          } else {
-              qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) * mt->pitch * mt->cpp;
-              mt->total_height = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) * 6;
           }
 
           if (mt->first_level != mt->last_level) {
@@ -90,6 +85,14 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
 
           mt->pitch = intel_miptree_pitch_align(intel, mt, tiling, mt->pitch);
 
+          if (mt->compressed) {
+              qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4 * mt->pitch * mt->cpp;
+              mt->total_height = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4 * 6;
+          } else {
+              qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) * mt->pitch * mt->cpp;
+              mt->total_height = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) * 6;
+          }
+
           for (level = mt->first_level; level <= mt->last_level; level++) {
               GLuint img_height;
               GLuint nr_images = 6;