}
}
+static uint32_t r300_hiz_clear_value(double depth)
+{
+ uint32_t r = (uint32_t)(CLAMP(depth, 0, 1) * 255.5);
+ assert(r <= 255);
+ return r | (r << 8) | (r << 16) | (r << 24);
+}
+
/* Clear currently bound buffers. */
static void r300_clear(struct pipe_context* pipe,
unsigned buffers,
}
if (r300_hiz_clear_allowed(r300)) {
+ r300->hiz_clear_value = r300_hiz_clear_value(depth);
r300_mark_atom_dirty(r300, &r300->hiz_clear);
}
}
boolean hiz_in_use;
/* HiZ function. Can be either MIN or MAX. */
enum r300_hiz_func hiz_func;
+ /* HiZ clear value. */
+ uint32_t hiz_clear_value;
void *dsa_decompress_zmask;
OUT_CS_PKT3(R300_PACKET3_3D_CLEAR_HIZ, 2);
OUT_CS(0);
OUT_CS(tex->tex.hiz_dwords[fb->zsbuf->u.tex.level]);
- OUT_CS(0xffffffff);
+ OUT_CS(r300->hiz_clear_value);
END_CS;
/* Mark the current zbuffer's hiz ram as in use. */
r300_get_sc_hz_max(r300);
if (r300->screen->caps.is_r500) {
- z->zb_bw_cntl |= R500_HIZ_FP_EXP_BITS_3 |
- R500_HIZ_EQUAL_REJECT_ENABLE;
+ z->zb_bw_cntl |= R500_HIZ_EQUAL_REJECT_ENABLE;
}
}
}