i965: Push intel_get_texture_alignment_unit call into brw_miptree_layout
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 2 Jul 2013 22:06:10 +0000 (15:06 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 3 Jul 2013 17:48:15 +0000 (10:48 -0700)
intel_miptree_create_layout() calls intel_get_texture_alignment_unit()
and then immediately calls brw_miptree_layout().  There are no other
callers.

intel_get_texture_alignment_unit() populates the miptree's alignment
unit fields, which are used by brw_miptree_layout() to determine where
to place each miplevel.  Since brw_miptree_layout() needs those to be
present, it makes sense to have it initialize them as the first step.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/brw_tex_layout.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index 6fe43981fbf33d7277ed8ed46b14a55c006c9409..f4029c431ab8a074fe05fc9a764b7ed7e2efcd78 100644 (file)
@@ -212,6 +212,9 @@ brw_miptree_layout_texture_3d(struct intel_context *intel,
 void
 brw_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree *mt)
 {
+   intel_get_texture_alignment_unit(intel, mt->format,
+                                    &mt->align_w, &mt->align_h);
+
    switch (mt->target) {
    case GL_TEXTURE_CUBE_MAP:
       if (intel->gen == 4) {
index e9b2464b6656448f3a656b6e8773cfcd4535a8af..bebfe511bb4b13652478af5645ba23a6301b923e 100644 (file)
@@ -400,9 +400,6 @@ intel_miptree_create_layout(struct intel_context *intel,
       }
    }
 
-   intel_get_texture_alignment_unit(intel, mt->format,
-                                   &mt->align_w, &mt->align_h);
-
    brw_miptree_layout(intel, mt);
 
    return mt;