i965: Fix incorrect bounds tracking for blit readpixels's GPU access.
authorEric Anholt <eric@anholt.net>
Mon, 23 Dec 2013 09:56:26 +0000 (01:56 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 9 Jan 2014 07:30:32 +0000 (15:30 +0800)
While incorrect, it probably wouldn't affect anyone ever: You'd have to do
an appropriately-formatted readpixels into a PBO, then overwrite the tail
end of the updated area of the PBO with glBufferSubData(), and you
wouldn't get appropriate synchronization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/intel_pixel_read.c

index 08cb7624bb1cbf9906b9252ffd3add64d2d0e26c..0f6d2aaa38724d98072e9af95c0d2b685d49fafc 100644 (file)
@@ -127,8 +127,7 @@ do_blit_readpixels(struct gl_context * ctx,
    brw->front_buffer_dirty = dirty;
 
    dst_buffer = intel_bufferobj_buffer(brw, dst,
-                                      dst_offset, width * height *
-                                       irb->mt->cpp);
+                                      dst_offset, height * dst_stride);
 
    struct intel_mipmap_tree *pbo_mt =
       intel_miptree_create_for_bo(brw,