summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authornobled <[email protected]>2011-10-19 06:35:53 +0000
committernobled <[email protected]>2011-12-08 21:23:59 +0000
commiteefff37060de8c2e98c687c9263e783dfe3ac8cc (patch)
tree3fda2ed799c06e0cdcdd07454aa04df0134ebfd6 /src/mesa/drivers
parent4a2b9b53052a74e71aac59592e95e3910b5b7da5 (diff)
mesa,intel: use _mesa_image_offset() for PBOs
This avoids forming invalid pointers needlessly, which even if never dereferenced is undefined behavior. It also makes _mesa_validate_pbo_access() more comprehensible. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_read.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c
index 1e23fdb31ec..34fed3d1f44 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c
@@ -120,8 +120,9 @@ do_blit_readpixels(struct gl_context * ctx,
rowLength = -rowLength;
}
- dst_offset = (GLintptr) _mesa_image_address(2, pack, pixels, width, height,
- format, type, 0, 0, 0);
+ dst_offset = (GLintptr)pixels;
+ dst_offset += _mesa_image_offset(2, pack, width, height,
+ format, type, 0, 0, 0);
if (!_mesa_clip_copytexsubimage(ctx,
&dst_x, &dst_y,