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

Author: Marek Olšák <[email protected]>
Date:   Sat Oct 31 07:23:00 2009 +0100

r300g: correct the pitch calculation for smaller mipmaps

---

 src/gallium/drivers/r300/r300_emit.c    |    2 +-
 src/gallium/drivers/r300/r300_texture.c |    7 +------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index be38fbc..22cf9ca 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -305,7 +305,7 @@ void r300_emit_fb_state(struct r300_context* r300,
                      RADEON_GEM_DOMAIN_VRAM, 0);
 
         OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i),
-            r300_translate_out_fmt(fb->cbufs[i]->format));
+            r300_translate_out_fmt(surf->format));
     }
 
     if (fb->zsbuf) {
diff --git a/src/gallium/drivers/r300/r300_texture.c 
b/src/gallium/drivers/r300/r300_texture.c
index 7199918..aea25cf 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -136,12 +136,7 @@ static void r300_setup_miptree(struct r300_texture* tex)
         tex->offset[i] = align(tex->size, 32);
         tex->size = tex->offset[i] + size;
         tex->layer_size[i] = layer_size;
-
-        if (tex->is_npot) {
-            tex->pitch[i] = stride / base->block.size;
-        } else {
-            tex->pitch[i] = base->width[i];
-        }
+        tex->pitch[i] = stride / base->block.size;
 
         debug_printf("r300: Texture miptree: Level %d "
                 "(%dx%dx%d px, pitch %d bytes)\n",

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to