softpipe: map only once in softpipe_map_surfaces
authorJerome Glisse <glisse@freedesktop.org>
Thu, 10 Jan 2008 00:11:53 +0000 (01:11 +0100)
committerJohn Doe <glisse@freedesktop.org>
Thu, 10 Jan 2008 00:14:07 +0000 (01:14 +0100)
softpipe_map_surfaces get call several time but softpipe_unmap_surfaces
get call only once. So to make sure stuff are properly unmap when
softpipe_unmap_surfaces get call we map surfaces only one time in
softpipe_map_surfaces.

src/mesa/pipe/softpipe/sp_context.c

index c7af63cc2d3cc4cfa8f458705758c1f4c04b6e94..075909230551b00e7927ab3c40d3c9f3d0bb02ce 100644 (file)
@@ -80,16 +80,16 @@ softpipe_map_surfaces(struct softpipe_context *sp)
 
    for (i = 0; i < sp->framebuffer.num_cbufs; i++) {
       ps = sp->framebuffer.cbufs[i];
-      if (ps->buffer)
+      if (ps->buffer && !ps->map)
          pipe_surface_map(ps);
    }
 
    ps = sp->framebuffer.zbuf;
-   if (ps && ps->buffer)
+   if (ps && ps->buffer && !ps->map)
       pipe_surface_map(ps);
 
    ps = sp->framebuffer.sbuf;
-   if (ps && ps->buffer)
+   if (ps && ps->buffer && !ps->map)
       pipe_surface_map(ps);
 }