struct pipe_framebuffer_state *fb =
(struct pipe_framebuffer_state*)r300->fb_state.state;
- if (r300->zmask_in_use && !r300->hyperz_locked) {
+ if (r300->zmask_in_use && !r300->locked_zbuffer) {
if (fb->zsbuf->texture == dst->texture) {
r300_decompress_zmask(r300);
}
struct pipe_framebuffer_state *fb =
(struct pipe_framebuffer_state*)r300->fb_state.state;
- if (!r300->zmask_in_use || r300->hyperz_locked)
+ if (!r300->zmask_in_use || r300->locked_zbuffer)
return;
r300->zmask_decompress = TRUE;
return;
}
- if (r300->zmask_in_use && !r300->hyperz_locked) {
+ if (r300->zmask_in_use && !r300->locked_zbuffer) {
if (fb->zsbuf->texture == src ||
fb->zsbuf->texture == dst) {
r300_decompress_zmask(r300);
/* Whether ZMASK is being decompressed. */
boolean zmask_decompress;
/* Whether ZMASK/HIZ is locked, i.e. should be disabled and cannot be taken over. */
- boolean hyperz_locked;
- /* The zbuffer the ZMASK of which is locked. */
struct pipe_surface *locked_zbuffer;
/* Whether HIZ is enabled. */
boolean hiz_in_use;
return;
/* Zbuffer compression. */
- if (r300->zmask_in_use && !r300->hyperz_locked) {
+ if (r300->zmask_in_use && !r300->locked_zbuffer) {
z->zb_bw_cntl |= R300_FAST_FILL_ENABLE |
/*R300_FORCE_COMPRESSED_STENCIL_VALUE_ENABLE |*/
R300_RD_COMP_ENABLE;
}
/* HiZ. */
- if (r300->hiz_in_use && !r300->hyperz_locked) {
+ if (r300->hiz_in_use && !r300->locked_zbuffer) {
/* Set the HiZ function if needed. */
if (r300->hiz_func == HIZ_FUNC_NONE) {
r300->hiz_func = r300_get_hiz_func(r300);
struct pipe_framebuffer_state *old_state = r300->fb_state.state;
unsigned max_width, max_height, i;
uint32_t zbuffer_bpp = 0;
+ boolean unlock_zbuffer = FALSE;
if (r300->screen->caps.is_r500) {
max_width = max_height = 4096;
return;
}
- if (old_state->zsbuf && r300->zmask_in_use && !r300->hyperz_locked) {
+ if (old_state->zsbuf && r300->zmask_in_use && !r300->locked_zbuffer) {
/* There is a zmask in use, what are we gonna do? */
if (state->zsbuf) {
if (!pipe_surface_equal(old_state->zsbuf, state->zsbuf)) {
}
} else {
/* We don't bind another zbuffer, so lock the current one. */
- r300->hyperz_locked = TRUE;
pipe_surface_reference(&r300->locked_zbuffer, old_state->zsbuf);
}
- } else if (r300->hyperz_locked && r300->locked_zbuffer) {
+ } else if (r300->locked_zbuffer) {
/* We have a locked zbuffer now, what are we gonna do? */
if (state->zsbuf) {
if (!pipe_surface_equal(r300->locked_zbuffer, state->zsbuf)) {
r300->hiz_in_use = FALSE;
} else {
/* We are binding the locked zbuffer again, so unlock it. */
- r300->hyperz_locked = FALSE;
+ unlock_zbuffer = TRUE;
}
}
}
- assert(state->zsbuf || r300->hyperz_locked || !r300->zmask_in_use);
+ assert(state->zsbuf || (r300->locked_zbuffer && !unlock_zbuffer) || !r300->zmask_in_use);
/* Need to reset clamping or colormask. */
r300_mark_atom_dirty(r300, &r300->blend_state);
util_copy_framebuffer_state(r300->fb_state.state, state);
- if (!r300->hyperz_locked) {
+ if (unlock_zbuffer) {
pipe_surface_reference(&r300->locked_zbuffer, NULL);
}