Leif Delgass wrote:
> 
> The mach64 driver with Mesa 3.x was using code like this (borrowed from
> utah-glx) to cull primitives:
> 
> xx[0] = (GLint)(v0->v.x * 4);
> yy[0] = (GLint)(v0->v.y * 4);
> 
> xx[1] = (GLint)(v1->v.x * 4);
> yy[1] = (GLint)(v1->v.y * 4);
> 
> xx[2] = (GLint)(v3->v.x * 4);
> yy[2] = (GLint)(v3->v.y * 4);
> 
> /* calculate one over area */
> ooa = 0.25 * 0.25 * ((xx[0] - xx[2]) * (yy[1] - yy[2]) -
>                      (yy[0] - yy[2]) * (xx[1] - xx[2]));
> 
> if ( ooa * ctx->backface_sign < 0 )
>         /* cull primitive */
>         return;
> }
> 

There's one in swrast somewhere.  It's not guarenteed to be uptodate unless
you're actually emitting swrast triangles... 

In other words, no, there isn't, you'll have to maintain your own.  But you
can look at swrast/s_context.c & see how it's done.

Keith

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

Reply via email to