From 11c0215bf8afcb8c578f0b5eb850d3ef28c619b5 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 1 Feb 2006 18:42:16 +0000 Subject: Switch between memcpy implementations according to src/dest alignment. --- src/mesa/drivers/dri/i915/intel_tex.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3