summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_fbo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_cb_fbo.c')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 43681b7f8a..6b9023c410 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -109,22 +109,22 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
width, flags);
}
- /* 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->winsys->region_release(pipe->winsys, &strb->surface->region);
- }
-
- strb->surface->region = pipe->winsys->region_alloc(pipe->winsys,
- strb->surface->pitch *
- cpp * height, flags);
- if (!strb->surface->region)
+ /* loop here since mapping is refcounted */
+ while (strb->surface->map)
+ pipe_surface_unmap(strb->surface);
+ if (strb->surface->buffer)
+ pipe->winsys->buffer_reference(pipe->winsys, &strb->surface->buffer,
+ NULL);
+
+ strb->surface->buffer = pipe->winsys->buffer_create(pipe->winsys, flags);
+ if (!strb->surface->buffer)
return GL_FALSE; /* out of memory, try s/w buffer? */
- ASSERT(strb->surface->region->buffer);
+ pipe->winsys->buffer_data(pipe->winsys, strb->surface->buffer,
+ strb->surface->pitch * cpp * height, NULL,
+ PIPE_BUFFER_USAGE_PIXEL);
+
+ ASSERT(strb->surface->buffer);
ASSERT(strb->surface->format);
strb->Base.Width = strb->surface->width = width;