summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/intel_tex_image.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2015-03-04 15:21:53 -0800
committerMatt Turner <mattst88@gmail.com>2015-03-05 10:18:28 -0800
commit2e4c95dfe2cb205c327ceaa12b44a9273bdb20dc (patch)
treebbf37b168d4470c516825f212030f0f54ac72837 /src/mesa/drivers/dri/i965/intel_tex_image.c
parent5f9ee6a02f54864df166e5dcc7303771d4eac9b3 (diff)
downloadexternal_mesa3d-2e4c95dfe2cb205c327ceaa12b44a9273bdb20dc.zip
external_mesa3d-2e4c95dfe2cb205c327ceaa12b44a9273bdb20dc.tar.gz
external_mesa3d-2e4c95dfe2cb205c327ceaa12b44a9273bdb20dc.tar.bz2
i965: Tell intel_get_memcpy() which direction the memcpy() is going.
The SSSE3 swizzling code was written for fast uploads to the GPU and assumed the destination was always 16-byte aligned. When we began using this code for fast downloads as well we didn't do anything to account for the fact that the destination pointer given by glReadPixels() or glGetTexImage() is not guaranteed to be suitably aligned. With SSSE3 enabled (at compile-time), some applications would crash when an SSE aligned-store instruction tried to store to an unaligned destination (or an assertion that the destination is aligned would trigger). To remedy this, tell intel_get_memcpy() whether we're uploading or downloading so that it can select whether to assume the destination or source is aligned, respectively. Cc: 10.5 <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89416 Tested-by: Uriy Zhuravlev <stalkerg@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_tex_image.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index da42fdd..00bf9ce 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -408,7 +408,8 @@ intel_gettexsubimage_tiled_memcpy(struct gl_context *ctx,
texImage->TexFormat == MESA_FORMAT_R8G8B8X8_UNORM)
return false;
- if (!intel_get_memcpy(texImage->TexFormat, format, type, &mem_copy, &cpp))
+ if (!intel_get_memcpy(texImage->TexFormat, format, type, &mem_copy, &cpp,
+ INTEL_DOWNLOAD))
return false;
/* If this is a nontrivial texture view, let another path handle it instead. */