summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index e1cc7d98bd6..64a64fd6b9c 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -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);
}