r600: cubemap levels seem to be aligned to 8 images
authorAndre Maasikas <amaasikas@gmail.com>
Fri, 22 Jan 2010 11:32:04 +0000 (13:32 +0200)
committerAndre Maasikas <amaasikas@gmail.com>
Fri, 22 Jan 2010 11:33:15 +0000 (13:33 +0200)
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c

index 3a3658c31413d2a1e160136c713753ef5ade8bd3..5ea213dc5ffa9729a2162c235d0dbf6a9f0052bd 100644 (file)
@@ -177,6 +177,12 @@ static void calculate_miptree_layout_r300(radeonContextPtr rmesa, radeon_mipmap_
 
                for(face = 0; face < mt->faces; face++)
                        compute_tex_image_offset(rmesa, mt, face, level, &curOffset);
+               /* r600 cube levels seems to be aligned to 8 faces but
+                * we have separate register for 1'st level offset so add
+                * 2 image alignment after 1'st mip level */
+               if(rmesa->radeonScreen->chip_family >= CHIP_FAMILY_R600 &&
+                  level >= 1)
+                       curOffset += 2 * mt->levels[level].size;
        }
 
        /* Note the required size in memory */