r5xx: Fixup emit_tex, add debugging info, enable temp temps.
[mesa.git] / src / mesa / math / m_debug_xform.c
index 728ee2f1efeb56f4010f54813936cbc44d49e1be..2af837cf64bbe8dde6a5e272f0e7ff0f6f5a89cd 100644 (file)
@@ -1,9 +1,8 @@
-
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  6.1
  *
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -43,7 +42,7 @@
 static char dummy;
 #endif
 
-#ifdef DEBUG  /* This code only used for debugging */
+#ifdef DEBUG_MATH  /* This code only used for debugging */
 
 
 /* Overhead of profiling counter in cycles.  Automatically adjusted to
@@ -162,12 +161,12 @@ static void init_matrix( GLfloat *m )
    m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] =  9.0;
 }
 
-static GLfloat s[TEST_COUNT][4] ALIGN16;
-static GLfloat d[TEST_COUNT][4] ALIGN16;
-static GLfloat r[TEST_COUNT][4] ALIGN16;
+ALIGN16(static GLfloat, s[TEST_COUNT][4]);
+ALIGN16(static GLfloat, d[TEST_COUNT][4]);
+ALIGN16(static GLfloat, r[TEST_COUNT][4]);
 
 static int test_transform_function( transform_func func, int psize,
-                                   int mtype, long *cycles )
+                                   int mtype, unsigned long *cycles )
 {
    GLvector4f source[1], dest[1], ref[1];
    GLmatrix mat[1];
@@ -188,7 +187,7 @@ static int test_transform_function( transform_func func, int psize,
    mat->type = mtypes[mtype];
 
    m = mat->m;
-   ASSERT( ((GLuint)m & 15) == 0 );
+   ASSERT( ((long)m & 15) == 0 );
 
    init_matrix( m );
 
@@ -280,19 +279,19 @@ static int test_transform_function( transform_func func, int psize,
 void _math_test_all_transform_functions( char *description )
 {
    int psize, mtype;
-   long benchmark_tab[4][7];
+   unsigned long benchmark_tab[4][7];
    static int first_time = 1;
 
    if ( first_time ) {
       first_time = 0;
-      mesa_profile = getenv( "MESA_PROFILE" );
+      mesa_profile = _mesa_getenv( "MESA_PROFILE" );
    }
 
 #ifdef RUN_DEBUG_BENCHMARK
    if ( mesa_profile ) {
       if ( !counter_overhead ) {
         INIT_COUNTER();
-        _mesa_printf("counter overhead: %ld cycles\n\n", counter_overhead );
+        _mesa_printf("counter overhead: %lu cycles\n\n", counter_overhead );
       }
       _mesa_printf("transform results after hooking in %s functions:\n", description );
    }
@@ -311,7 +310,7 @@ void _math_test_all_transform_functions( char *description )
    for ( mtype = 0 ; mtype < 7 ; mtype++ ) {
       for ( psize = 1 ; psize <= 4 ; psize++ ) {
         transform_func func = _mesa_transform_tab[psize][mtypes[mtype]];
-        long *cycles = &(benchmark_tab[psize-1][mtype]);
+        unsigned long *cycles = &(benchmark_tab[psize-1][mtype]);
 
         if ( test_transform_function( func, psize, mtype, cycles ) == 0 ) {
            char buf[100];
@@ -336,4 +335,4 @@ void _math_test_all_transform_functions( char *description )
 }
 
 
-#endif /* DEBUG */
+#endif /* DEBUG_MATH */