mesa: add bool param to _mesa_free_context_data
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_mipmap_tree.c
index 8d01e21db72dba2b5653a7bd7e4b33aaaa099c19..09ccc5c6a12ec5a6d519b778f9abb61633ffd17a 100644 (file)
@@ -34,6 +34,7 @@
 #include "main/teximage.h"
 #include "main/texobj.h"
 #include "main/enums.h"
+#include "util/u_memory.h"
 #include "radeon_texture.h"
 #include "radeon_tile.h"
 
@@ -102,7 +103,7 @@ unsigned get_texture_image_row_stride(radeonContextPtr rmesa, mesa_format format
        } else {
                unsigned row_align;
 
-               if (!_mesa_is_pow_two(width) || target == GL_TEXTURE_RECTANGLE) {
+               if (!util_is_power_of_two_or_zero(width) || target == GL_TEXTURE_RECTANGLE) {
                        row_align = rmesa->texture_rect_row_align - 1;
                } else if (tiling) {
                        unsigned tileWidth, tileHeight;
@@ -129,7 +130,7 @@ static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree
        radeon_mipmap_level *lvl = &mt->levels[level];
        GLuint height;
 
-       height = _mesa_next_pow_two_32(lvl->height);
+       height = util_next_power_of_two(lvl->height);
 
        lvl->rowstride = get_texture_image_row_stride(rmesa, mt->mesaFormat, lvl->width, mt->tilebits, mt->target);
        lvl->size = get_texture_image_size(mt->mesaFormat, lvl->rowstride, height, lvl->depth, mt->tilebits);