From: Brian Paul Date: Thu, 29 Oct 2009 17:04:11 +0000 (-0600) Subject: intel: check for single memcpy() in memcpy_get_tex_image() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea414e331802e49d59eb2ddd2466d58a383bc931;p=mesa.git intel: check for single memcpy() in memcpy_get_tex_image() --- diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index c861fc552f2..6301444c340 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -696,11 +696,16 @@ memcpy_get_tex_image(GLcontext *ctx, GLenum target, GLint level, const GLint srcRowStride = texImage->RowStride * bpp; GLuint row; - for (row = 0; row < texImage->Height; row++) { - memcpy(dst, src, bytesPerRow); - dst += dstRowStride; - src += srcRowStride; - } + if (bytesPerRow == dstRowStride && bytesPerRow == dstRowStride) { + memcpy(dst, src, bytesPerRow * texImage->Height); + } + else { + for (row = 0; row < texImage->Height; row++) { + memcpy(dst, src, bytesPerRow); + dst += dstRowStride; + src += srcRowStride; + } + } } if (_mesa_is_bufferobj(pack->BufferObj)) {