diff options
author | Brian Paul <[email protected]> | 2008-12-10 18:02:27 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-12-10 18:06:44 -0700 |
commit | d0bc5293d6e1e9c34fa822b7c2928932ed22462c (patch) | |
tree | 097faccccfa6a17402b1cbb86c4db719bfea9fdf /src/gallium/auxiliary/draw/draw_context.c | |
parent | 8137da952b6f30329adf7d49d2d9e58625534dd4 (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_context.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_context.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c index 74deb44bd28..fab8fc95fca 100644 --- a/src/gallium/auxiliary/draw/draw_context.c +++ b/src/gallium/auxiliary/draw/draw_context.c @@ -103,6 +103,18 @@ void draw_flush( struct draw_context *draw ) } +/** + * Specify the Minimum Resolvable Depth factor for polygon offset. + * This factor potentially depends on the number of Z buffer bits, + * the rasterization algorithm and the arithmetic performed on Z + * values between vertex shading and rasterization. It will vary + * from one driver to another. + */ +void draw_set_mrd(struct draw_context *draw, double mrd) +{ + draw->mrd = mrd; +} + /** * Register new primitive rasterization/rendering state. |