Mesa (7.9): st/mesa: use the wrapped renderbuffer in CopyPixels()
Brian Paul
brianp at kemper.freedesktop.org
Fri Sep 24 16:18:38 UTC 2010
Module: Mesa
Branch: 7.9
Commit: 96085dc41a7ceb6210d1911cd97f5ef78dd4bfeb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=96085dc41a7ceb6210d1911cd97f5ef78dd4bfeb
Author: Brian Paul <brianp at vmware.com>
Date: Fri Sep 24 10:18:12 2010 -0600
st/mesa: use the wrapped renderbuffer in CopyPixels()
Fixes assertion failures when copying stencil pixels.
NOTE: this is a candidate for the 7.9 branch.
(cherry picked from commit f5c810c42f9dfcb660303ea898975b64f060b238)
---
src/mesa/state_tracker/st_cb_drawpixels.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 1147b19..fb1fec1 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -832,7 +832,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLsizei width, GLsizei height,
GLint dstx, GLint dsty)
{
- struct st_renderbuffer *rbDraw = st_renderbuffer(ctx->DrawBuffer->_StencilBuffer);
+ struct st_renderbuffer *rbDraw;
struct pipe_context *pipe = st_context(ctx)->pipe;
enum pipe_transfer_usage usage;
struct pipe_transfer *ptDraw;
@@ -846,6 +846,13 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
return;
}
+ /* Get the dest renderbuffer. If there's a wrapper, use the
+ * underlying renderbuffer.
+ */
+ rbDraw = st_renderbuffer(ctx->DrawBuffer->_StencilBuffer);
+ if (rbDraw->Base.Wrapped)
+ rbDraw = st_renderbuffer(rbDraw->Base.Wrapped);
+
/* this will do stencil pixel transfer ops */
st_read_stencil_pixels(ctx, srcx, srcy, width, height,
GL_STENCIL_INDEX, GL_UNSIGNED_BYTE,
@@ -968,6 +975,9 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
driver_vp = make_passthrough_vertex_shader(st, GL_TRUE);
}
+ if (rbRead->Base.Wrapped)
+ rbRead = st_renderbuffer(rbRead->Base.Wrapped);
+
sample_count = rbRead->texture->nr_samples;
/* I believe this would be legal, presumably would need to do a resolve
for color, and for depth/stencil spec says to just use one of the
More information about the mesa-commit
mailing list