summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-12-10 18:11:31 -0700
committerBrian Paul <brian.paul@tungstengraphics.com>2008-12-10 18:11:31 -0700
commit0c31661e73dd2979df22a275452efc71c7064f81 (patch)
tree8f6347c716219b513c56d827d88f461fa62da0a6 /src/gallium/drivers
parentb716de47798defa7d22b0f15b201af6fba27f0b9 (diff)
parentd0bc5293d6e1e9c34fa822b7c2928932ed22462c (diff)
Merge commit 'origin/gallium-0.1' into gallium-0.2
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_surface.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_surface.c b/src/gallium/drivers/softpipe/sp_state_surface.c
index ba8c9eece7..8877b18af9 100644
--- a/src/gallium/drivers/softpipe/sp_state_surface.c
+++ b/src/gallium/drivers/softpipe/sp_state_surface.c
@@ -101,6 +101,26 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
}
#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);
+ }
+
sp->framebuffer.width = fb->width;
sp->framebuffer.height = fb->height;