summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pipe_offset.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-12-10 18:02:27 -0700
committerBrian Paul <[email protected]>2008-12-10 18:06:44 -0700
commitd0bc5293d6e1e9c34fa822b7c2928932ed22462c (patch)
tree097faccccfa6a17402b1cbb86c4db719bfea9fdf /src/gallium/auxiliary/draw/draw_pipe_offset.c
parent8137da952b6f30329adf7d49d2d9e58625534dd4 (diff)
gallium: added draw_set_mrd() function to fix polygon offset
The Minimum Resolvable Depth factor depends on the driver and can't just be computed from the number of Z buffer bits. Glean's polygon offset test now passes with softpipe. Still need to determine the MRD factor for other gallium drivers, if they use the draw module's polygon offset stage...
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_offset.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_offset.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_offset.c b/src/gallium/auxiliary/draw/draw_pipe_offset.c
index 1fea5e6dcbc..8ddc4ee6178 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_offset.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_offset.c
@@ -122,9 +122,8 @@ static void offset_first_tri( struct draw_stage *stage,
struct prim_header *header )
{
struct offset_stage *offset = offset_stage(stage);
- float mrd = 1.0f / 65535.0f; /* XXX this depends on depthbuffer bits! */
- offset->units = stage->draw->rasterizer->offset_units * mrd;
+ offset->units = stage->draw->rasterizer->offset_units * stage->draw->mrd;
offset->scale = stage->draw->rasterizer->offset_scale;
stage->tri = offset_tri;