softpipe: minor code movement in softpipe_get_tex_transfer()
[mesa.git] / src / gallium / drivers / softpipe / sp_flush.c
index e03994b63b76a53e7ff12afc4145b8b8170f6a90..035f4b963eb37426ceab9501654616d5129f8d05 100644 (file)
@@ -57,7 +57,7 @@ softpipe_flush( struct pipe_context *pipe,
    }
 
    if (flags & PIPE_FLUSH_RENDER_CACHE) {
-      for (i = 0; i < softpipe->framebuffer.num_cbufs; i++)
+      for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++)
          if (softpipe->cbuf_cache[i])
             sp_flush_tile_cache(softpipe, softpipe->cbuf_cache[i]);
 
@@ -70,9 +70,22 @@ softpipe_flush( struct pipe_context *pipe,
        * that's called before swapbuffers because we don't always want
        * to unmap surfaces when flushing.
        */
-      softpipe_unmap_surfaces(softpipe);
+      softpipe_unmap_transfers(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;
 }