Mesa (gallium-cylindrical-wrap): softpipe: Properly implement cylindrical wrapping.

michal michal at vmware.com
Fri Feb 5 09:37:41 PST 2010


Micha?? Kr??l wrote on 2010-02-05 17:34:
> Module: Mesa
> Branch: gallium-cylindrical-wrap
> Commit: f90399107eb9b54ea2c76f973ab487c38e61a5f0
> URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f90399107eb9b54ea2c76f973ab487c38e61a5f0
>
> Author: Michal Krol <michal at vmware.com>
> Date:   Fri Feb  5 17:12:48 2010 +0100
>
> softpipe: Properly implement cylindrical wrapping.
>
> @@ -801,21 +900,23 @@ line_linear_coeff(const struct setup_context *setup,
>  /**
>   * Compute a0, dadx and dady for a perspective-corrected interpolant,
>   * for a line.
> + * v[0] and v[1] are vmin and vmax, respectively.
>   */
>  static void
>  line_persp_coeff(const struct setup_context *setup,
>                   struct tgsi_interp_coef *coef,
> -                 uint vertSlot, uint i)
> +                 uint i,
> +                 const float v[2])
>  {
>     /* XXX double-check/verify this arithmetic */
> -   const float a0 = setup->vmin[vertSlot][i] * setup->vmin[0][3];
> -   const float a1 = setup->vmax[vertSlot][i] * setup->vmax[0][3];
> +   const float a0 = v[0] * setup->vmin[0][3];
> +   const float a1 = v[1] * setup->vmax[0][3];
>     const float da = a1 - a0;
>     const float dadx = da * setup->emaj.dx * setup->oneoverarea;
>     const float dady = da * setup->emaj.dy * setup->oneoverarea;
>     coef->dadx[i] = dadx;
>     coef->dady[i] = dady;
> -   coef->a0[i] = (setup->vmin[vertSlot][i] -
> +   coef->a0[i] = (v[0] - /* XXX: <-- shouldn't that be a0? */
>   
I have put this XXX comment, because the code in line_persp_coeff() is 
not consistent wih tri_persp_coeff(). Can someone double check this?

Thanks.


More information about the mesa-commit mailing list