Keith Whitwell wrote:
> 
> Brian Paul wrote:
> >
> > CVSROOT:        /cvsroot/dri
> > Module name:    xc
> > Repository:     xc/xc/lib/GL/mesa/src/drv/tdfx/
> > Changes by:     brianp@usw-pr-cvs1.     01/06/07 09:46:17
> >
> > Log message:
> >   add divide by zero checks to fix occasional clipping bugs in Q3
> >
> > Modified files:
> >       xc/xc/lib/GL/mesa/src/drv/tdfx/:  Tag: mesa-3-5-branch
> >         tdfx_vbtmp.h
> >
> 
> Have you traced the source of these zero oow values?  Any vertex with clip w
> == 0 should have clipmask != 0, therefore in tdfx_vbtmp.h
> 
>             if (mask[i] == 0) {
>                /* unclipped */
>                v->v.x   = s[0]  * proj[0][0] + s[12];
>                v->v.y   = s[5]  * proj[0][1] + s[13];
>                v->v.z   = s[10] * proj[0][2] + s[14];
>                v->v.rhw = proj[0][3];
>             } else {
>                /* clipped */
>                v->v.rhw = 1.0;
>             }
> 
> the vertex oow value will be assigned 1.0.  Any ideas what's going wrong?

I found that dstclip[3] in the tdfx interp function was sometimes zero.
This value is interpolated from the 'in' and 'out' coordinates by the
INTERP_4F macro.

The divide by zero resulted in 'inf' values and later 'nan' texture
coordinates.

I also found that the 'out' vertex rhw was also zero sometimes so I
applied the same divide by zero check to the wout computation.  It
does seem strange that out->v.rhw would be zero, as you said.  I've
already spent too much time on this but I might take a second look.

-Brian

_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to