summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@tungstengraphics.com>2007-07-16 11:51:08 +0200
committerRoland Scheidegger <sroland@tungstengraphics.com>2007-07-16 11:51:08 +0200
commitd69cae95a072d3641bd8340a5216662e0365ed6f (patch)
tree6d3ade02607c0b34f9d6cb032ef69fc7487f9801 /src
parent99c7e38d8363eafe2fc079ed6e7bad289d65e965 (diff)
allow blit path for read pixels if pack->alignment isn't 1.
pack->alignment doesn't matter usually if the image is sufficiently aligned anyway. Speeds up some tests/readrate cases by a factor of 100 (since the pack->alignment default which noone ever bothers to change is 4).
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_read.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_read.c b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c
index c7bdb6bc85..c41ca33f8f 100644
--- a/src/mesa/drivers/dri/i915tex/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c
@@ -203,17 +203,18 @@ do_blit_readpixels(GLcontext * ctx,
return GL_FALSE;
}
- if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
- if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s: bad packing params\n", __FUNCTION__);
- return GL_FALSE;
- }
-
if (pack->RowLength > 0)
rowLength = pack->RowLength;
else
rowLength = width;
+ if (((rowLength * src->cpp) % pack->Alignment) ||
+ pack->SwapBytes || pack->LsbFirst) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ _mesa_printf("%s: bad packing params\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
if (pack->Invert) {
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);