diff options
author | Brian Paul <brianp@vmware.com> | 2010-08-22 19:04:47 -0600 |
---|---|---|
committer | Tom Fogal <tfogal@alumni.unh.edu> | 2010-08-23 09:58:08 -0600 |
commit | 6628188a871b3ee354c2b0e2c6276af582035656 (patch) | |
tree | e83b2eeea5bfc8c9ebd2e56c26d9b3c32f6e42fa | |
parent | 435474e116199a7f68b96e869108a68936e824ba (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.
-rw-r--r-- | src/mesa/state_tracker/st_cb_readpixels.c | 7 |
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 952d9ce9156..7ff10d473b4 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -69,6 +69,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; } @@ -366,6 +370,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 */ |