llvmpipe: update image dump/debug code
authorBrian Paul <brianp@vmware.com>
Mon, 10 May 2010 22:45:25 +0000 (16:45 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 10 May 2010 23:04:19 +0000 (17:04 -0600)
src/gallium/drivers/llvmpipe/lp_flush.c

index 644b821957a2f5c7b40bae339bf62dfb30c97386..e1425435e1952dee46b7a8e3ef0d9a082c0f5278 100644 (file)
@@ -31,6 +31,7 @@
 
 
 #include "pipe/p_defines.h"
+#include "util/u_string.h"
 #include "draw/draw_context.h"
 #include "lp_flush.h"
 #include "lp_context.h"
@@ -71,25 +72,25 @@ llvmpipe_flush( struct pipe_context *pipe,
    }
 
    /* Enable to dump BMPs of the color/depth buffers each frame */
-#if 0
-   if (flags & PIPE_FLUSH_FRAME) {
-      static unsigned frame_no = 1;
-      char filename[256];
-      unsigned i;
-
-      for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) {
-        util_snprintf(filename, sizeof(filename), "cbuf%u_%u", i, frame_no);
-         debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.cbufs[0]);
-      }
+   if (0) {
+      if (flags & PIPE_FLUSH_FRAME) {
+         static unsigned frame_no = 1;
+         char filename[256];
+         unsigned i;
+
+         for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) {
+            util_snprintf(filename, sizeof(filename), "cbuf%u_%u", i, frame_no);
+            debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.cbufs[0]);
+         }
 
-      if (0) {
-         util_snprintf(filename, sizeof(filename), "zsbuf_%u", frame_no);
-         debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.zsbuf);
-      }
+         if (0) {
+            util_snprintf(filename, sizeof(filename), "zsbuf_%u", frame_no);
+            debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.zsbuf);
+         }
 
-      ++frame_no;
+         ++frame_no;
+      }
    }
-#endif
 }