softpipe: Code (commented out) to dump BMPs.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 9 Sep 2008 13:17:31 +0000 (22:17 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 9 Sep 2008 13:19:31 +0000 (22:19 +0900)
src/gallium/drivers/softpipe/sp_flush.c

index e03994b63b76a53e7ff12afc4145b8b8170f6a90..401764bb4394f99dfe0a20716860c4f1e5ab65b3 100644 (file)
@@ -73,6 +73,19 @@ softpipe_flush( struct pipe_context *pipe,
       softpipe_unmap_surfaces(softpipe);
    }
 
+   /* Enable to dump BMPs of the color/depth buffers each frame */
+#if 0
+   if(flags & PIPE_FLUSH_FRAME) {
+      static unsigned frame_no = 1;
+      static char filename[256];
+      util_snprintf(filename, sizeof(filename), "cbuf_%u.bmp", frame_no);
+      debug_dump_surface_bmp(filename, softpipe->framebuffer.cbufs[0]);
+      util_snprintf(filename, sizeof(filename), "zsbuf_%u.bmp", frame_no);
+      debug_dump_surface_bmp(filename, softpipe->framebuffer.zsbuf);
+      ++frame_no;
+   }
+#endif
+   
    if (fence)
       *fence = NULL;
 }