llvmpipe: avoid overflow in triangle culling
authorKeith Whitwell <keithw@vmware.com>
Fri, 8 Oct 2010 16:06:05 +0000 (17:06 +0100)
committerKeith Whitwell <keithw@vmware.com>
Fri, 8 Oct 2010 16:30:08 +0000 (17:30 +0100)
commit29d6a1483d6c4ecb9c34989423e025b3784ec019
tree9049e626e46035f64e27fcb30983f6e30ffd2c5d
parentad6730fadbbeacea96322e31064ede9ea7ebad6f
llvmpipe: avoid overflow in triangle culling

Avoid multiplying fixed-point values.  Calculate triangle area in
floating point use that for culling.

Lift area calculations up a level as we are already doing this in the
triangle_both() case.

Would like to share the calculated area with attribute interpolation,
but the way the code is structured makes this difficult.
src/gallium/drivers/llvmpipe/lp_setup_tri.c