r300: working trivial/clear for r5xx
authorJoakim Sindholt <bacn@zhasha.com>
Thu, 5 Feb 2009 21:23:40 +0000 (22:23 +0100)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Thu, 5 Feb 2009 21:37:29 +0000 (13:37 -0800)
src/gallium/drivers/r300/r300_surface.c
src/gallium/drivers/r300/r300_texture.c

index e03f3de37127c0fcdeec79bab6143b2266d17460..3db013cd7e5a628904793c76fe528238ae33582b 100644 (file)
@@ -290,8 +290,8 @@ OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT,
 OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1);
 OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
 /* XXX this should not be so rigid and it still doesn't work right */
-OUT_CS_REG(R300_RB3D_COLORPITCH0, (w / 4) | R300_COLOR_TILE_ENABLE |
-    R300_COLOR_FORMAT_ARGB8888);
+debug_printf("Buffer width (stride): %d\n", dest->stride);
+OUT_CS_REG(R300_RB3D_COLORPITCH0, (dest->stride >> 2) | R300_COLOR_FORMAT_ARGB8888);
 OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F);
 /* XXX Packet3 */
 OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8));
index 537425c1e2fdd47f6d06c668f8c2a020f1f4036e..f9ad14f12be4b310fe27bde711359427a779d8fc 100644 (file)
@@ -44,11 +44,11 @@ static void r300_setup_miptree(struct r300_texture* tex)
 
         /* Radeons enjoy things in multiples of 32. */
         /* XXX NPOT -> 64, not 32 */
-        stride = (base->nblocksx[i] * base->block.size + 31) & ~31;
+        stride = (base->nblocksx[i] * base->block.size + 63) & ~63;
         size = stride * base->nblocksy[i] * base->depth[i];
 
         /* XXX 64 for NPOT */
-        tex->offset[i] = (tex->size + 31) & ~31;
+        tex->offset[i] = (tex->size + 63) & ~63;
         tex->size = tex->offset[i] + size;
     }
 }
@@ -72,7 +72,7 @@ static struct pipe_texture*
 
     r300_setup_miptree(tex);
 
-    tex->buffer = screen->buffer_create(screen, 32,
+    tex->buffer = screen->buffer_create(screen, 63,
                                         PIPE_BUFFER_USAGE_PIXEL,
                                         tex->size);
 
@@ -130,7 +130,7 @@ static struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen,
         surface->nblocksy = texture->nblocksy[level];
         /* XXX save the actual stride instead plz kthnxbai */
         surface->stride =
-            (texture->nblocksx[level] * texture->block.size + 31) & ~31;
+            (texture->nblocksx[level] * texture->block.size + 63) & ~63;
         surface->offset = offset;
         surface->usage = flags;
         surface->status = PIPE_SURFACE_STATUS_DEFINED;