Mesa (master): r300g: align the height of NPOT textures to POT

Marek Olšák mareko at kemper.freedesktop.org
Fri Apr 9 23:30:48 UTC 2010


Module: Mesa
Branch: master
Commit: e7f1e5ca648d6c96d056d3ae8eab65e98f47f311
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7f1e5ca648d6c96d056d3ae8eab65e98f47f311

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sat Apr 10 01:09:40 2010 +0200

r300g: align the height of NPOT textures to POT

Needed by the CS checker.

---

 src/gallium/drivers/r300/r300_texture.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 2ef9ec0..8e5afc5 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -694,6 +694,9 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture* tex,
         tile_height = r300_texture_get_tile_size(tex, TILE_HEIGHT,
                                                  tex->mip_macrotile[level]);
         height = align(height, tile_height);
+
+        /* This is needed for the kernel checker, unfortunately. */
+        height = util_next_power_of_two(height);
     }
 
     return util_format_get_nblocksy(tex->tex.format, height);
@@ -802,7 +805,7 @@ static struct pipe_texture* r300_texture_create(struct pipe_screen* screen,
 
     r300_setup_flags(tex);
     if (!(base->tex_usage & R300_TEXTURE_USAGE_TRANSFER) &&
-        !(tex->tex.tex_usage & PIPE_TEXTURE_USAGE_SCANOUT)) {
+        !(base->tex_usage & PIPE_TEXTURE_USAGE_SCANOUT)) {
         r300_setup_tiling(screen, tex);
     }
     r300_setup_miptree(rscreen, tex);




More information about the mesa-commit mailing list