[Mesa-dev] [PATCH 4/8] i965/gen4-5: Stop using bogus polygon_offset_scale field.

Kenneth Graunke kenneth at whitecape.org
Fri Jun 21 21:55:14 PDT 2013

On 06/21/2013 10:57 AM, Eric Anholt wrote:
> The polygon offset math used for triangles by the WM is "OffsetUnits * 2 *
> MRD + OffsetFactor * m" where 'MRD' is the minimum resolvable difference
> for the depth buffer (~1/(1<<16) or ~1/(1<<24)), 'm' is the approximated
> slope from the GL spec, and '2' is this magic number from the original
> i965 code dump that we deviate from the GL spec by because "it makes glean
> work" (except that it doesn't, because of some hilarity with 0.5 *
> approximately 2.0 != 1.0.  go glean!).
> This clipper code for unfilled polygons, on the other hand, was doing
> "OffsetUnits * garbage + OffsetFactor * m", where garbage was MRD in the
> case of 16-bit depth visual (regardless the FBO's depth resolution), or
> 128 * MRD for 24-bit depth visual.
> This change just makes the unfilled polygons behavior match the WM's
> filled polygons behavior.

Thanks!  I was just looking at this code earlier today and got very 
confused.  Nice to see it go.  This passes Keith's polygon-offset test 
on Ivybridge.

Patches 1-7 are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(assuming the _mesa_update_state() removed in patch 2 really isn't 

Patch 8 is:
Acked-by: Kenneth Graunke <kenneth at whitecape.org>

More information about the mesa-dev mailing list