Quieten TGSI
authorKeith Whitwell <keith@tungstengraphics.com>
Thu, 9 Aug 2007 10:22:29 +0000 (11:22 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Thu, 9 Aug 2007 10:23:18 +0000 (11:23 +0100)
src/mesa/pipe/tgsi/core/tgsi_dump.c
src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c

index f1773ac..c3d796a 100644 (file)
@@ -1277,6 +1277,8 @@ tgsi_dump(
 
    tgsi_parse_free( &parse );
 
-   fclose( dump->file );
+   if (dump->file != stderr &&
+       dump->file != stdout)
+      fclose( dump->file );
 }
 
index 107b6bd..c3201ec 100644 (file)
@@ -1,6 +1,8 @@
 #include "tgsi_platform.h"\r
 #include "tgsi_mesa.h"\r
 \r
+#define TGSI_DEBUG 0\r
+\r
 /*\r
  * Map mesa register file to SBIR register file.\r
  */\r
@@ -571,9 +573,11 @@ tgsi_mesa_compile_fp_program(
             preamble_size,\r
             TGSI_PROCESSOR_FRAGMENT ) ) {\r
          assert( i == program->Base.NumInstructions - 1 );\r
-         tgsi_dump(\r
-            tokens,\r
-            0/*TGSI_DUMP_VERBOSE | TGSI_DUMP_NO_IGNORED | TGSI_DUMP_NO_DEFAULT*/ );\r
+\r
+        if (TGSI_DEBUG)\r
+           tgsi_dump(\r
+              tokens,\r
+              0/*TGSI_DUMP_VERBOSE | TGSI_DUMP_NO_IGNORED | TGSI_DUMP_NO_DEFAULT*/ );\r
          break;\r
       }\r
 \r
@@ -617,7 +621,8 @@ tgsi_mesa_compile_vp_program(
             0,\r
             TGSI_PROCESSOR_VERTEX ) ) {\r
          assert( ii == program->Base.NumInstructions - 1 );\r
-         tgsi_dump( tokens, TGSI_DUMP_NO_IGNORED | TGSI_DUMP_NO_DEFAULT );\r
+        if (TGSI_DEBUG)\r
+           tgsi_dump( tokens, TGSI_DUMP_NO_IGNORED | TGSI_DUMP_NO_DEFAULT );\r
          break;\r
       }\r
 \r