summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_cpu_detect.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-06-05 15:38:27 +0100
committerAdam Jackson <ajax@redhat.com>2013-06-10 16:26:09 -0400
commit337f21bc356a89a9c755aebabb64ba381a59e39b (patch)
tree6ae7b5beb859e3f69a65e472f4f02d3f0d63474b /src/gallium/auxiliary/util/u_cpu_detect.c
parentba6cd796dd60635ca12f036ba9de5b907d8e82f5 (diff)
downloadexternal_mesa3d-337f21bc356a89a9c755aebabb64ba381a59e39b.zip
external_mesa3d-337f21bc356a89a9c755aebabb64ba381a59e39b.tar.gz
external_mesa3d-337f21bc356a89a9c755aebabb64ba381a59e39b.tar.bz2
util: Use sizeof(void *) rather than 0 as the fallback cache line size
Without this, llvmpipe ends up giving a zero size to all uncompressed textures on non-x86 systems, since align() cannot handle a 0 alignment. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Diffstat (limited to 'src/gallium/auxiliary/util/u_cpu_detect.c')
-rw-r--r--src/gallium/auxiliary/util/u_cpu_detect.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index 7e6df9d..763b5cc 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -250,6 +250,11 @@ util_cpu_detect(void)
util_cpu_caps.nr_cpus = 1;
#endif
+ /* Make the fallback cacheline size nonzero so that it can be
+ * safely passed to align().
+ */
+ util_cpu_caps.cacheline = sizeof(void *);
+
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
if (has_cpuid()) {
uint32_t regs[4];