- /* Tell draw module how deep the Z/depth buffer is */
- if (lp->framebuffer.zsbuf) {
- int depth_bits;
- double mrd;
- depth_bits = util_format_get_component_bits(lp->framebuffer.zsbuf->format,
- UTIL_FORMAT_COLORSPACE_ZS,
- 0);
- if (depth_bits > 16) {
- mrd = 0.0000001;
- }
- else {
- mrd = 0.00002;
- }
- draw_set_mrd(lp->draw, mrd);
- }
+ /*
+ * Calculate the floating point depth sense and Minimum Resolvable Depth
+ * value for the llvmpipe module. This is separate from the draw module.
+ */
+ lp->floating_point_depth =
+ (util_get_depth_format_type(depth_desc) == UTIL_FORMAT_TYPE_FLOAT);
+
+ lp->mrd = util_get_depth_format_mrd(depth_desc);
+
+ /* Tell the draw module how deep the Z/depth buffer is. */
+ draw_set_zs_format(lp->draw, depth_format);