[Mesa-dev] [PATCH] i965: Allow fast-path for glReadPixels sub-rectangle case

Nanley Chery nanleychery at gmail.com
Wed Feb 17 19:26:00 UTC 2016


From: Nanley Chery <nanley.g.chery at intel.com>

Since _mesa_image_row_stride() is used to calculate the destination's
row stride, we can read pixels into a destination sub-rectangle (whose
width is smaller than the destination buffer).

Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---

The fast-path is confirmed to work with the following piglit test:
https://lists.freedesktop.org/archives/piglit/2016-February/019009.html

 src/mesa/drivers/dri/i965/intel_pixel_read.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c b/src/mesa/drivers/dri/i965/intel_pixel_read.c
index 31030b1..5fcfc85 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
@@ -100,7 +100,6 @@ intel_readpixels_tiled_memcpy(struct gl_context * ctx,
        pack->Alignment > 4 ||
        pack->SkipPixels > 0 ||
        pack->SkipRows > 0 ||
-       (pack->RowLength != 0 && pack->RowLength != width) ||
        pack->SwapBytes ||
        pack->LsbFirst ||
        pack->Invert)
-- 
2.7.1



More information about the mesa-dev mailing list