mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 08:40:11 +01:00
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>
This commit is contained in:
parent
ba6cd796dd
commit
337f21bc35
1 changed files with 5 additions and 0 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue