This commit updates all defines, compiler flags and cleans up some code for unused CPU capabilities. There should be no functional change, unless it's run on a CPU that supports sse41 but not sse42. It will fallback to the SSE2 kernel in this case. In preparation for the new SSE4.2 minimum in Blender 4.2. Pull Request: https://projects.blender.org/blender/blender/pulls/118043
41 lines
618 B
C
41 lines
618 B
C
/* SPDX-FileCopyrightText: 2022 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
|
|
|
#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 (system_cpu_support_avx2()) {
|
|
return 8;
|
|
}
|
|
if (system_cpu_support_sse42()) {
|
|
return 4;
|
|
}
|
|
return 0;
|
|
# endif
|
|
#else
|
|
return 0;
|
|
#endif
|
|
}
|
|
|
|
static inline bool guiding_supported()
|
|
{
|
|
return guiding_device_type() != 0;
|
|
}
|
|
|
|
CCL_NAMESPACE_END
|