- /* Tell draw module how deep the Z/depth buffer is */
- if (sp->framebuffer.zsbuf) {
- int depth_bits;
- double mrd;
- depth_bits = pf_get_component_bits(sp->framebuffer.zsbuf->format,
- PIPE_FORMAT_COMP_Z);
- 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);