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.
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);
}