From 5c08afc894a66fa51eb8531a93d4e9f8b7b74edd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 1 Sep 2015 15:57:02 +1000 Subject: [PATCH] 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" Reviewed-by: Iago Toral Quiroga Signed-off-by: Dave Airlie (cherry picked from commit 32769ac016dee4ce5767a922f91de47df4ce984d) --- src/mesa/main/readpix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 7c37fd47fdc..e7d28328c79 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 { -- 2.11.0