From: Richard Sandiford Date: Wed, 5 Jun 2013 14:38:27 +0000 (+0100) Subject: util: Use sizeof(void *) rather than 0 as the fallback cache line size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=337f21bc356a89a9c755aebabb64ba381a59e39b;p=mesa.git 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 Signed-off-by: Richard Sandiford --- diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c index 7e6df9df157..763b5cc220f 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];