summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-08-22 19:04:47 -0600
committerBrian Paul <brianp@vmware.com>2010-08-22 19:04:49 -0600
commit6b90d1b1acaaf42b9c8b787d0dac54ac74d4fdcc (patch)
tree11853f1f90d31b32ebf91e59963ec3bf57add32d /src/mesa
parentc94256e83b6d482cb0c92e09b9f3275894fdc1b8 (diff)
st/mesa: fix ReadPixels crashes when reading depth/stencil from a FBO
This is based on a patch from Marek Olšák. NOTE: This is a candidate for the Mesa 7.8 branch.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index d5f5d42274..6ab03ec939 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -68,6 +68,10 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
ubyte *stmap;
GLint j;
+ if (strb->Base.Wrapped) {
+ strb = st_renderbuffer(strb->Base.Wrapped);
+ }
+
if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
y = ctx->DrawBuffer->Height - y - height;
}
@@ -359,6 +363,9 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
else if (format == GL_DEPTH_COMPONENT) {
strb = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer);
+ if (strb->Base.Wrapped) {
+ strb = st_renderbuffer(strb->Base.Wrapped);
+ }
}
else {
/* Read color buffer */