Mesa (10.0): i965: Fix handling of MESA_pack_invert in blit (PBO) readpixels.

Carl Worth cworth at kemper.freedesktop.org
Thu Jan 9 20:57:13 UTC 2014


Module: Mesa
Branch: 10.0
Commit: 9b3ed4c8c2e985506628ff9e6be2431b4b01393f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9b3ed4c8c2e985506628ff9e6be2431b4b01393f

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Dec 23 12:11:25 2013 -0800

i965: Fix handling of MESA_pack_invert in blit (PBO) readpixels.

Fixes piglit GL_MESA_pack_invert/readpixels and GPU hangs with glamor and
cairo-gl.

Cc: 10.0 9.2 <mesa-stable at lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
(cherry picked from commit e186b927b8254ce62e0d47db90d16cd4253b3db5)

---

 src/mesa/drivers/dri/i965/intel_pixel_read.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c b/src/mesa/drivers/dri/i965/intel_pixel_read.c
index 08cb762..e98c190 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
@@ -106,13 +106,15 @@ do_blit_readpixels(struct gl_context * ctx,
    /* Mesa flips the dst_stride for pack->Invert, but we want our mt to have a
     * normal dst_stride.
     */
+   struct gl_pixelstore_attrib uninverted_pack = *pack;
    if (pack->Invert) {
       dst_stride = -dst_stride;
       dst_flip = true;
+      uninverted_pack.Invert = false;
    }
 
    dst_offset = (GLintptr)pixels;
-   dst_offset += _mesa_image_offset(2, pack, width, height,
+   dst_offset += _mesa_image_offset(2, &uninverted_pack, width, height,
 				    format, type, 0, 0, 0);
 
    if (!_mesa_clip_copytexsubimage(ctx,




More information about the mesa-commit mailing list