summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/readpix.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-09-01 15:57:02 +1000
committerDave Airlie <airlied@redhat.com>2015-09-02 09:34:21 +1000
commit32769ac016dee4ce5767a922f91de47df4ce984d (patch)
tree39f53a879c4c00112ff85adf61a4216694720307 /src/mesa/main/readpix.c
parentb4a70401f52e5d7e08c94715b250ea1de8f63d15 (diff)
downloadexternal_mesa3d-32769ac016dee4ce5767a922f91de47df4ce984d.zip
external_mesa3d-32769ac016dee4ce5767a922f91de47df4ce984d.tar.gz
external_mesa3d-32769ac016dee4ce5767a922f91de47df4ce984d.tar.bz2
mesa/readpixels: check strides are equal before skipping conversion
The CTS packed_pixels test checks that readpixels doesn't write into the space between rows, however we fail that here unless we check the format and stride match. This fixes all the core mesa problems with CTS packed_pixels tests. Cc: "11.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r--src/mesa/main/readpix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 03a484c..76ef8ee 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -523,7 +523,8 @@ read_rgba_pixels( struct gl_context *ctx,
* convert to, then we can convert directly into the dst buffer and avoid
* the final conversion/copy from the rgba buffer to the dst buffer.
*/
- if (dst_format == rgba_format) {
+ if (dst_format == rgba_format &&
+ dst_stride == rgba_stride) {
need_convert = false;
rgba = dst;
} else {