[Mesa-dev] [PATCH 1/2] i965: Use true AA line distance on G45/Ironlake.

Francisco Jerez currojerez at riseup.net
Wed Apr 26 22:45:00 UTC 2017


Kenneth Graunke <kenneth at whitecape.org> writes:

> The original Broadwater and Crestline platforms computed antialiased
> line distances using "manhattan" distance, aka a + b = c.  Eaglelake
> and Cantiga added "true" distance, aka a^2 + b^2 = c^2, which is
> obviously superior.
>

The hardware docs are incredibly optimistic calling the improved AA line
distance mode "true", in reality the strips and fans unit does something
along the lines of 'max(a, b) + min(a, b) / 4' in "true" distance mode
in order to avoid calculating the square root.  At any rate, it's still
better than manhattan.  Series is:

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

> The G45 documentation indicates that the old manhattan distance setting
> is "only for debug purposes" and should never be used.  The Ironlake
> documentation no longer mentions AALINEDISTANCE_MANHATTAN, though it
> does still contain the narrative about the feature.
>
> At any rate, we should use it.
>
> Cc: rafael.antognolli at intel.com
> ---
>  src/mesa/drivers/dri/i965/brw_sf_state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c
> index e919f5d14b4..d50ceb12133 100644
> --- a/src/mesa/drivers/dri/i965/brw_sf_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c
> @@ -265,7 +265,7 @@ static void upload_sf_unit( struct brw_context *brw )
>     /* _NEW_PROGRAM | _NEW_POINT */
>     sf->sf7.use_point_size_state = !(ctx->VertexProgram.PointSizeEnabled ||
>  				    ctx->Point._Attenuated);
> -   sf->sf7.aa_line_distance_mode = 0;
> +   sf->sf7.aa_line_distance_mode = brw->is_g4x || brw->gen == 5;
>  
>     /* might be BRW_NEW_PRIMITIVE if we have to adjust pv for polygons:
>      * _NEW_LIGHT
> -- 
> 2.12.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170426/235ca2f7/attachment.sig>


More information about the mesa-dev mailing list