diff options
author | Marek Olšák <[email protected]> | 2010-08-15 03:14:25 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-08-15 08:07:11 +0200 |
commit | d5a86f9fc9fc96a0d771c0409b557636ef89f350 (patch) | |
tree | 68f362d9e6c30e71b816a2f6b3bd496035d5806a /src/gallium/drivers/r300/r300_hyperz.c | |
parent | 59c2230879cb5149ce99ac8565ce6af9c5b02e04 (diff) |
r300g: do not use HiZ if HiZ RAM is not properly initialized
Diffstat (limited to 'src/gallium/drivers/r300/r300_hyperz.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_hyperz.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_hyperz.c b/src/gallium/drivers/r300/r300_hyperz.c index 9cce195eb46..811b5646e16 100644 --- a/src/gallium/drivers/r300/r300_hyperz.c +++ b/src/gallium/drivers/r300/r300_hyperz.c @@ -131,7 +131,10 @@ static void r300_update_hyperz(struct r300_context* r300) (struct r300_hyperz_state*)r300->hyperz_state.state; struct pipe_framebuffer_state *fb = (struct pipe_framebuffer_state*)r300->fb_state.state; + struct r300_texture *zstex = + fb->zsbuf ? r300_texture(fb->zsbuf->texture) : NULL; boolean zmask_in_use = FALSE; + boolean hiz_in_use = FALSE; z->gb_z_peq_config = 0; z->zb_bw_cntl = 0; @@ -143,13 +146,14 @@ static void r300_update_hyperz(struct r300_context* r300) return; } - if (!fb->zsbuf) + if (!zstex) return; if (!r300->rws->get_value(r300->rws, R300_CAN_HYPERZ)) return; - zmask_in_use = r300_texture(fb->zsbuf->texture)->zmask_in_use[fb->zsbuf->level]; + zmask_in_use = zstex->zmask_in_use[fb->zsbuf->level]; + hiz_in_use = zstex->hiz_in_use[fb->zsbuf->level]; /* Z fastfill. */ if (zmask_in_use) { @@ -167,7 +171,7 @@ static void r300_update_hyperz(struct r300_context* r300) if (r300->z_compression == RV350_Z_COMPRESS_88) z->gb_z_peq_config |= R300_GB_Z_PEQ_CONFIG_Z_PEQ_SIZE_8_8; - if (r300->hiz_enable) { + if (hiz_in_use) { bool can_hiz = r300_can_hiz(r300); if (can_hiz) { z->zb_bw_cntl |= R300_HIZ_ENABLE; @@ -177,8 +181,8 @@ static void r300_update_hyperz(struct r300_context* r300) } } + /* R500-specific features and optimizations. */ if (r300->screen->caps.is_r500) { - /* XXX Are these bits really available on RV350? */ z->zb_bw_cntl |= R500_HIZ_FP_EXP_BITS_3; z->zb_bw_cntl |= R500_HIZ_EQUAL_REJECT_ENABLE | |