- /* update cache */
- if (fb->sbuf != fb->zbuf) {
- /* separate stencil buf */
- sp->sbuf_cache = sp->sbuf_cache_sep;
- sp_tile_cache_set_surface(sp->sbuf_cache, fb->sbuf);
- }
- else {
- /* combined depth/stencil */
- sp->sbuf_cache = sp->zbuf_cache;
- sp_tile_cache_set_surface(sp->sbuf_cache, fb->sbuf);
- }
- }
-#endif
-
- /* Tell draw module how deep the Z/depth buffer is */
- {
- int depth_bits;
- double mrd;
- if (sp->framebuffer.zsbuf) {
- depth_bits = pf_get_component_bits(sp->framebuffer.zsbuf->format,
- PIPE_FORMAT_COMP_Z);
- }
- else {
- depth_bits = 0;
- }
- if (depth_bits > 16) {
- mrd = 0.0000001;
- }
- else {
- mrd = 0.00002;
- }
- draw_set_mrd(sp->draw, mrd);
+ /* Tell draw module how deep the Z/depth buffer is
+ *
+ * If no depth buffer is bound, send the utility function the
+ * format for no bound depth (PIPE_FORMAT_NONE).
+ */
+ draw_set_zs_format(sp->draw,
+ (sp->framebuffer.zsbuf) ?
+ sp->framebuffer.zsbuf->format : PIPE_FORMAT_NONE);