From 2050f2ab96f923112d3475a655b31c8f5145a800 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 28 Jan 2011 01:01:01 +0100 Subject: r300g: fix and re-enable 8x8 zbuffer compression mode Also cleanup the whole thing. --- src/gallium/drivers/r300/r300_emit.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'src/gallium/drivers/r300/r300_emit.c') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 54e263436b..2157cb3ede 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -1141,42 +1141,14 @@ void r300_emit_zmask_clear(struct r300_context *r300, unsigned size, void *state struct pipe_framebuffer_state *fb = (struct pipe_framebuffer_state*)r300->fb_state.state; struct r300_texture *tex; - unsigned numdw, pipes; - unsigned compsize = r300->screen->caps.z_compress; - /* The tile size of 1 DWORD is: - * - * GPU Pipes 4x4 mode 8x8 mode - * ------------------------------------------ - * R580 4P/1Z 32x32 64x64 - * RV570 3P/1Z 48x16 96x32 - * RV530 1P/2Z 32x16 64x32 - */ - static unsigned num_blocks_x_per_dw[4] = {4, 8, 12, 8}; - static unsigned num_blocks_y_per_dw[4] = {4, 4, 4, 8}; CS_LOCALS(r300); - if (r300->screen->caps.family == CHIP_FAMILY_RV530) { - pipes = r300->screen->caps.num_z_pipes; - } else { - pipes = r300->screen->caps.num_frag_pipes; - } - tex = r300_texture(fb->zsbuf->texture); - /* Get the zbuffer size (with the aligned width and height). */ - numdw = align(tex->desc.stride_in_pixels[fb->zsbuf->u.tex.level], - num_blocks_x_per_dw[pipes-1] * compsize) * - align(fb->zsbuf->height, - num_blocks_y_per_dw[pipes-1] * compsize); - - /* Convert pixels -> dwords. */ - numdw = ALIGN_DIVUP(numdw, num_blocks_x_per_dw[pipes-1] * compsize * - num_blocks_y_per_dw[pipes-1] * compsize); - BEGIN_CS(size); OUT_CS_PKT3(R300_PACKET3_3D_CLEAR_ZMASK, 2); OUT_CS(0); - OUT_CS(numdw); + OUT_CS(tex->desc.zmask_dwords[fb->zsbuf->u.tex.level]); OUT_CS(0); END_CS; -- cgit v1.2.3