From: Nanley Chery Date: Sat, 6 Feb 2016 00:25:01 +0000 (-0800) Subject: mesa/readpix: Don't clip in _mesa_readpixels() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b89a8a15c240418d1859947b5114993ecdf424fb;p=mesa.git mesa/readpix: Don't clip in _mesa_readpixels() The clipping is performed higher up in the call-chain. Signed-off-by: Nanley Chery Reviewed-by: Ian Romanick Reviewed-by: Brian Paul --- diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index a5b74bcccfd..56e9d60bb11 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -858,21 +858,16 @@ _mesa_readpixels(struct gl_context *ctx, const struct gl_pixelstore_attrib *packing, GLvoid *pixels) { - struct gl_pixelstore_attrib clippedPacking = *packing; - if (ctx->NewState) _mesa_update_state(ctx); - /* Do all needed clipping here, so that we can forget about it later */ - if (_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) { - - pixels = _mesa_map_pbo_dest(ctx, &clippedPacking, pixels); + pixels = _mesa_map_pbo_dest(ctx, packing, pixels); if (pixels) { /* Try memcpy first. */ if (readpixels_memcpy(ctx, x, y, width, height, format, type, pixels, packing)) { - _mesa_unmap_pbo_dest(ctx, &clippedPacking); + _mesa_unmap_pbo_dest(ctx, packing); return; } @@ -880,25 +875,24 @@ _mesa_readpixels(struct gl_context *ctx, switch (format) { case GL_STENCIL_INDEX: read_stencil_pixels(ctx, x, y, width, height, type, pixels, - &clippedPacking); + packing); break; case GL_DEPTH_COMPONENT: read_depth_pixels(ctx, x, y, width, height, type, pixels, - &clippedPacking); + packing); break; case GL_DEPTH_STENCIL_EXT: read_depth_stencil_pixels(ctx, x, y, width, height, type, pixels, - &clippedPacking); + packing); break; default: /* all other formats should be color formats */ read_rgba_pixels(ctx, x, y, width, height, format, type, pixels, - &clippedPacking); + packing); } - _mesa_unmap_pbo_dest(ctx, &clippedPacking); + _mesa_unmap_pbo_dest(ctx, packing); } - } }