1.1 --- a/src/pvr2/tacore.c Sun Aug 06 03:36:51 2006 +0000
1.2 +++ b/src/pvr2/tacore.c Sun Aug 06 03:50:36 2006 +0000
1.5 - * $Id: tacore.c,v 1.4 2006-08-06 03:36:51 nkeynes Exp $
1.6 + * $Id: tacore.c,v 1.5 2006-08-06 03:50:36 nkeynes Exp $
1.8 * PVR2 Tile Accelerator implementation
1.10 @@ -100,6 +100,12 @@
1.12 #define TA_IS_END_VERTEX(i) (i & 0x10000000)
1.14 +/** Note these are not the IEEE 754 definitions - the TA treats NANs
1.15 + * as if they were INFs of the appropriate sign.
1.17 +#define TA_IS_INF(f) (((*((uint32_t *)&f)) & 0xFF800000) == 0x7F800000)
1.18 +#define TA_IS_NINF(f) (((*((uint32_t *)&f)) & 0xFF800000) == 0xFF800000)
1.20 #define MIN3( x1, x2, x3 ) ( (x1)<(x2)? ((x1)<(x3)?(x1):(x3)) : ((x2)<(x3)?(x2):(x3)) )
1.21 #define MAX3( x1, x2, x3 ) ( (x1)>(x2)? ((x1)>(x3)?(x1):(x3)) : ((x2)>(x3)?(x2):(x3)) )
1.23 @@ -457,16 +463,16 @@
1.26 for( i=0; i<ta_status.vertex_count; i++ ) {
1.27 - if( ta_status.poly_vertex[i].x < 0.0 ) {
1.28 + if( ta_status.poly_vertex[i].x < 0.0 || TA_IS_NINF(ta_status.poly_vertex[i].x) ) {
1.30 - } else if( ta_status.poly_vertex[i].x > (float)INT_MAX ) {
1.31 + } else if( ta_status.poly_vertex[i].x > (float)INT_MAX || TA_IS_INF(ta_status.poly_vertex[i].x) ) {
1.34 tx[i] = (int)(ta_status.poly_vertex[i].x / 32.0);
1.36 - if( ta_status.poly_vertex[i].y < 0.0 ) {
1.37 + if( ta_status.poly_vertex[i].y < 0.0 || TA_IS_NINF(ta_status.poly_vertex[i].y)) {
1.39 - } else if( ta_status.poly_vertex[i].y > (float)INT_MAX ) {
1.40 + } else if( ta_status.poly_vertex[i].y > (float)INT_MAX || TA_IS_INF(ta_status.poly_vertex[i].y) ) {
1.43 ty[i] = (int)(ta_status.poly_vertex[i].y / 32.0);