radeon: Some possible improvements that I spoted in radeon_tiled_texture branch.
authorMaciej Cencora <m.cencora@gmail.com>
Sun, 7 Mar 2010 11:15:25 +0000 (12:15 +0100)
committerMaciej Cencora <m.cencora@gmail.com>
Sun, 7 Mar 2010 11:21:30 +0000 (12:21 +0100)
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c

index ee91f30be5cc0ab79f3597398d8d1cae3d2dd2d0..c6cc417dd6c4b08d71710cf094796f55f1ffcc15 100644 (file)
@@ -96,15 +96,6 @@ unsigned get_texture_image_size(
        return rowStride * height * depth;
 }
 
-static unsigned is_pot(unsigned value)
-{
-       unsigned m;
-
-       for (m = 1; m < value; m *= 2) {}
-
-       return value == m;
-}
-
 unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling)
 {
        if (_mesa_is_format_compressed(format)) {
@@ -112,7 +103,7 @@ unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format,
        } else {
                unsigned row_align;
 
-               if (!is_pot(width)) {
+               if (!_mesa_is_pow_two(width)) {
                        row_align = rmesa->texture_rect_row_align - 1;
                } else if (tiling) {
                        unsigned tileWidth, tileHeight;