diff options
author | Marek Olšák <[email protected]> | 2010-08-14 18:37:04 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-08-15 08:07:11 +0200 |
commit | 5f8ccf1e2766e3e7537dd8a838837c5e4af4246c (patch) | |
tree | c9426ce50d9cf236138a702b142b41e2a52b7f77 /src/gallium/drivers/r300/r300_blit.c | |
parent | 0d699e8ee930c6c7e0f8abff14bf37e7f67807fe (diff) |
r300g: do not use fastfill if ZMask RAM is not properly initialized
z_fastfill -> dirty_zmask[level].
Diffstat (limited to 'src/gallium/drivers/r300/r300_blit.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_blit.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 5fe9b9017d1..d44f53ec6f3 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); |