From 5f8ccf1e2766e3e7537dd8a838837c5e4af4246c Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 14 Aug 2010 18:37:04 +0200 Subject: r300g: do not use fastfill if ZMask RAM is not properly initialized z_fastfill -> dirty_zmask[level]. --- src/gallium/drivers/r300/r300_blit.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/r300/r300_blit.c') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 5fe9b9017d..d44f53ec6f 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -99,9 +99,6 @@ static boolean r300_cbzb_clear_allowed(struct r300_context *r300, struct pipe_framebuffer_state *fb = (struct pipe_framebuffer_state*)r300->fb_state.state; - if (r300->z_fastfill) - clear_buffers &= ~(PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL); - /* Only color clear allowed, and only one colorbuffer. */ if (clear_buffers != PIPE_CLEAR_COLOR || fb->nr_cbufs != 1) return FALSE; @@ -186,8 +183,10 @@ static void r300_clear(struct pipe_context* pipe, r300_depth_clear_value(fb->zsbuf->format, depth, stencil); r300_mark_fb_state_dirty(r300, R300_CHANGED_ZCLEAR_FLAG); - if (r300->z_compression || r300->z_fastfill) + if (r300_texture(fb->zsbuf->texture)->zmask_mem[fb->zsbuf->level]) { r300->zmask_clear.dirty = TRUE; + buffers &= ~PIPE_CLEAR_DEPTHSTENCIL; + } if (r300->hiz_enable) r300->hiz_clear.dirty = TRUE; } @@ -222,6 +221,15 @@ static void r300_clear(struct pipe_context* pipe, r300_mark_fb_state_dirty(r300, R300_CHANGED_CBZB_FLAG); } + /* Enable fastfill. + * + * If we cleared the zmask, it's dirty now. The Hyper-Z state update + * looks for a dirty zmask and enables fastfill accordingly. */ + if (fb->zsbuf && + r300_texture(fb->zsbuf->texture)->dirty_zmask[fb->zsbuf->level]) { + r300->hyperz_state.dirty = TRUE; + } + /* XXX this flush "fixes" a hardlock in the cubestorm xscreensaver */ if (r300->flush_counter == 0) pipe->flush(pipe, 0, NULL); -- cgit v1.2.3