unmap regions when reallocating renderbuffer storage
authorBrian <brian.paul@tungstengraphics.com>
Sat, 20 Oct 2007 21:20:46 +0000 (15:20 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Sat, 20 Oct 2007 21:20:46 +0000 (15:20 -0600)
src/mesa/state_tracker/st_cb_fbo.c

index e1cc7d98bd6235afc59d6f2992093cdf3c31da5d..64a64fd6b9c88c24c3e1d6d6d32ab307e56a0cc6 100644 (file)
@@ -92,6 +92,10 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
 
    /* free old region */
    if (strb->surface->region) {
+      /* loop here since mapping is refcounted */
+      struct pipe_region *r = strb->surface->region;
+      while (r->map)
+         pipe->region_unmap(pipe, r);
       pipe->region_release(pipe, &strb->surface->region);
    }