1 |
From 9b3ed4c8c2e985506628ff9e6be2431b4b01393f Mon Sep 17 00:00:00 2001 |
2 |
From: Eric Anholt <eric@anholt.net> |
3 |
Date: Mon, 23 Dec 2013 12:11:00 -0800 |
4 |
Subject: [PATCH] i965: Fix handling of MESA_pack_invert in blit (PBO) |
5 |
readpixels. |
6 |
|
7 |
Fixes piglit GL_MESA_pack_invert/readpixels and GPU hangs with glamor and |
8 |
cairo-gl. |
9 |
|
10 |
Cc: 10.0 9.2 <mesa-stable@lists.freedesktop.org> |
11 |
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> |
12 |
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> |
13 |
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> |
14 |
(cherry picked from commit e186b927b8254ce62e0d47db90d16cd4253b3db5) |
15 |
--- |
16 |
src/mesa/drivers/dri/i965/intel_pixel_read.c | 4 +++- |
17 |
1 file changed, 3 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c b/src/mesa/drivers/dri/i965/intel_pixel_read.c |
20 |
index 08cb762..e98c190 100644 |
21 |
--- a/src/mesa/drivers/dri/i965/intel_pixel_read.c |
22 |
+++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c |
23 |
@@ -106,13 +106,15 @@ do_blit_readpixels(struct gl_context * ctx, |
24 |
/* Mesa flips the dst_stride for pack->Invert, but we want our mt to have a |
25 |
* normal dst_stride. |
26 |
*/ |
27 |
+ struct gl_pixelstore_attrib uninverted_pack = *pack; |
28 |
if (pack->Invert) { |
29 |
dst_stride = -dst_stride; |
30 |
dst_flip = true; |
31 |
+ uninverted_pack.Invert = false; |
32 |
} |
33 |
|
34 |
dst_offset = (GLintptr)pixels; |
35 |
- dst_offset += _mesa_image_offset(2, pack, width, height, |
36 |
+ dst_offset += _mesa_image_offset(2, &uninverted_pack, width, height, |
37 |
format, type, 0, 0, 0); |
38 |
|
39 |
if (!_mesa_clip_copytexsubimage(ctx, |
40 |
-- |
41 |
1.8.4.5 |
42 |
|