r300g: do not align texture height to 2^n for 1D and 2D non-mipmapped textures
authorMarek Olšák <maraeo@gmail.com>
Sat, 24 Jul 2010 01:07:45 +0000 (03:07 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sun, 25 Jul 2010 08:25:21 +0000 (10:25 +0200)
I don't remember why the alignment was there, but it seems to be
no longer needed. I guess it was a dirty fix for some other bug.

src/gallium/drivers/r300/r300_texture.c

index 5750bc4329f0bde65e7330beebdf15a04111c341..f7c167d1bfee6224189e2be699686b0ad35bbb5e 100644 (file)
@@ -774,7 +774,11 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture* tex,
         height = align(height, tile_height);
 
         /* This is needed for the kernel checker, unfortunately. */
-        height = util_next_power_of_two(height);
+        if ((tex->b.b.target != PIPE_TEXTURE_1D &&
+             tex->b.b.target != PIPE_TEXTURE_2D) ||
+            tex->b.b.last_level != 0) {
+            height = util_next_power_of_two(height);
+        }
     }
 
     return util_format_get_nblocksy(tex->b.b.format, height);