r300g: correct the pitch calculation for smaller mipmaps
authorMarek Olšák <maraeo@gmail.com>
Sat, 31 Oct 2009 06:23:00 +0000 (07:23 +0100)
committerJoakim Sindholt <opensource@zhasha.com>
Sat, 31 Oct 2009 06:30:48 +0000 (07:30 +0100)
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_texture.c

index be38fbc619e6018fb09342742674eb76fde4fd61..22cf9cac2a38cf204997ddfb4b680305ad62660d 100644 (file)
@@ -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) {
index 7199918a8498e1f899970aa65ba60181ba593a75..aea25cf71dd48a7c16563bc254d2d3594e5dd3d3 100644 (file)
@@ -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",