blob: 7dc74f0d8c0df88b4e28f2ce030ef173b02d593d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/* SPDX-License-Identifier: Apache-2.0
* Copyright 2022 Blender Foundation */
#pragma once
#ifdef WITH_PATH_GUIDING
# include <openpgl/cpp/OpenPGL.h>
# include <openpgl/version.h>
#endif
#include "util/system.h"
CCL_NAMESPACE_BEGIN
static int guiding_device_type()
{
#ifdef WITH_PATH_GUIDING
# if defined(__ARM_NEON)
return 8;
# else
# if OPENPGL_VERSION_MINOR >= 4
if (system_cpu_support_avx2()) {
return 8;
}
# endif
if (system_cpu_support_sse41()) {
return 4;
}
return 0;
# endif
#else
return 0;
#endif
}
static inline bool guiding_supported()
{
return guiding_device_type() != 0;
}
CCL_NAMESPACE_END
|