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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index f58d532b2a..80c92e8b7a 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -104,6 +104,9 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
assert(strb->surface);
if (!strb->surface)
return GL_FALSE;
+ strb->surface->cpp = cpp;
+ strb->surface->pitch = pipe->winsys->surface_pitch(pipe->winsys, cpp,
+ width, flags);
}
/* free old region */
@@ -115,8 +118,9 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
pipe->winsys->region_release(pipe->winsys, &strb->surface->region);
}
- strb->surface->region = pipe->winsys->region_alloc(pipe->winsys, cpp,
- width, height, flags);
+ strb->surface->region = pipe->winsys->region_alloc(pipe->winsys,
+ strb->surface->pitch *
+ cpp * height, flags);
if (!strb->surface->region)
return GL_FALSE; /* out of memory, try s/w buffer? */