Merge remote branch 'origin/gallium-0.2' into gallium-0.2
[mesa.git] / src / mesa / drivers / dri / i965 / brw_tex_layout.c
index d9e8896252164d5581b84ef424a5b7ae4158b294..51a617fcb400efb722eaa1b1ed6645dfc36fbe85 100644 (file)
 
 #include "intel_mipmap_tree.h"
 #include "intel_tex_layout.h"
-#include "macros.h"
+#include "intel_context.h"
+#include "main/macros.h"
 
 #define FILE_DEBUG_FLAG DEBUG_MIPTREE
 
-GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
+GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_tree *mt )
 {
    /* XXX: these vary depending on image format: 
     */
@@ -64,7 +65,7 @@ GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
           mt->pitch = ALIGN(width, align_w);
           pack_y_pitch = (height + 3) / 4;
       } else {
-          mt->pitch = ALIGN(mt->width0 * mt->cpp, 4) / mt->cpp;
+          mt->pitch = intel_miptree_pitch_align (intel, mt, mt->width0);
           pack_y_pitch = ALIGN(mt->height0, align_h);
       }
 
@@ -122,7 +123,7 @@ GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
    }
 
    default:
-      i945_miptree_layout_2d(mt);
+      i945_miptree_layout_2d(intel, mt);
       break;
    }
    DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,