Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2022-10-30 00:41:21 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2022-10-30 01:14:59 +0300
commitbc37e8d8399eef686b71341aa90eced9bc117786 (patch)
tree92e4af388150209df9bc44e2cba6f2f303aa7baf /intern/cycles/util/guiding.h
parent552abb838c76d44a0d7d1226b59a1ab381e88386 (diff)
parentd1d2f002c7caaf4ab457ec27bbc44666d7aac624 (diff)
Merge remote-tracking branch 'origin/master' into principled-v2
Diffstat (limited to 'intern/cycles/util/guiding.h')
-rw-r--r--intern/cycles/util/guiding.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/intern/cycles/util/guiding.h b/intern/cycles/util/guiding.h
new file mode 100644
index 00000000000..7dc74f0d8c0
--- /dev/null
+++ b/intern/cycles/util/guiding.h
@@ -0,0 +1,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