Mesa (master): r600g: fix height calcs for miptree

Dave Airlie airlied at kemper.freedesktop.org
Wed Aug 18 00:51:01 UTC 2010


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Aug 18 10:50:19 2010 +1000

r600g: fix height calcs for miptree

h needs to be rounded up, this probably needs revisiting when we get
to tiling etc.

fixes fbo-generatemipmap-npot

---

 src/gallium/drivers/r600/r600_texture.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 30d79eb..55cceb6 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -65,6 +65,7 @@ static void r600_setup_miptree(struct r600_screen *rscreen, struct r600_resource
 	for (i = 0, offset = 0; i <= ptex->last_level; i++) {
 		w = u_minify(ptex->width0, i);
 		h = u_minify(ptex->height0, i);
+		h = util_next_power_of_two(h);
 		pitch = util_format_get_stride(ptex->format, align(w, 64));
 		layer_size = pitch * h;
 		if (ptex->target == PIPE_TEXTURE_CUBE)




More information about the mesa-commit mailing list