summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2006-02-01 18:42:16 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2006-02-01 18:42:16 +0000
commit11c0215bf8afcb8c578f0b5eb850d3ef28c619b5 (patch)
tree10d679cd4f91355e415089aa344208ad905b5586
parent6a13b6c346402c4c3fe79157ae8b2f7870b7372d (diff)
Switch between memcpy implementations according to src/dest alignment.mesa_20060201
-rw-r--r--src/mesa/drivers/dri/i915/intel_tex.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_tex.c b/src/mesa/drivers/dri/i915/intel_tex.c
index fb542ed7b5..7d52bfc27d 100644
--- a/src/mesa/drivers/dri/i915/intel_tex.c
+++ b/src/mesa/drivers/dri/i915/intel_tex.c
@@ -57,6 +57,15 @@ static void intelFreeTextureImageData( GLcontext *ctx,
}
}
+static void *do_memcpy( void *dest, const void *src, size_t n )
+{
+ if ( (((unsigned)src) & 63) ||
+ (((unsigned)dest) & 63))
+ return __memcpy(dest, src, n);
+ else
+ return memcpy(dest, src, n);
+}
+
void intelInitTextureFuncs(struct dd_function_table * functions)
{
@@ -88,5 +97,5 @@ void intelInitTextureFuncs(struct dd_function_table * functions)
*
* TODO: switch dynamically.
*/
- functions->TextureMemCpy = __memcpy;
+ functions->TextureMemCpy = do_memcpy;
}