Skip to content

Commit

Permalink
Fixed Embree URL, enabled OIDN
Browse files Browse the repository at this point in the history
  • Loading branch information
skwerner committed Mar 2, 2021
1 parent a365a0a commit 1ca877d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build_files/build_environment/cmake/versions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ set(EMBREE_HASH 4bbe29e7eaa46417efc75fc5f1e8eb87)

set(EMBREE_AARCH64_VERSION 3.12.0)
set(EMBREE_AARCH64_GIT_URI https://github.com/lighttransport/embree-aarch64.git)
set(EMBREE_AARCH64_GIT_TAG 54a6ebc2e97f5a9980d674c42dbd7fda0a212ba2)
set(EMBREE_AARCH64_GIT_TAG 3dd19186c6fa921690ed0379726bce4ec9d2bcb7)

set(USD_VERSION 20.05)
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
Expand Down
8 changes: 7 additions & 1 deletion build_files/cmake/platform/platform_apple.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ set(PLATFORM_LINKFLAGS

list(APPEND PLATFORM_LINKLIBS c++)

if(WITH_OPENIMAGEDENOISE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
# OpenImageDenoise uses BNNS from the Accelerate framework.
string(APPEND PLATFORM_LINKFLAGS " -framework Accelerate")
endif()
endif()

if(WITH_JACK)
string(APPEND PLATFORM_LINKFLAGS " -F/Library/Frameworks -weak_framework jackmp")
endif()
Expand Down Expand Up @@ -337,7 +344,6 @@ if(WITH_CYCLES_OSL)
endif()

if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(WITH_OPENIMAGEDENOISE OFF)
set(WITH_CPU_SSE OFF)
endif()

Expand Down
9 changes: 7 additions & 2 deletions intern/cycles/util/util_openimagedenoise.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ CCL_NAMESPACE_BEGIN

static inline bool openimagedenoise_supported()
{
#ifdef WITH_OPENIMAGEDENOISE
return system_cpu_support_sse41();
#ifdef WITH_OPENIMAGEDENOISE+
# ifdef __APPLE__
/* Always supported through Accelerate framework BNNS. */
return true;
# else
return system_cpu_support_sse41();
# endif
#else
return false;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ void DenoiseOperation::generateDenoise(float *data,
return;
}
#ifdef WITH_OPENIMAGEDENOISE
if (BLI_cpu_support_sse41()) {
# ifndef __APPLE__
if (BLI_cpu_support_sse41())
# endif
{
oidn::DeviceRef device = oidn::newDevice();
device.commit();

Expand Down
2 changes: 2 additions & 0 deletions source/blender/editors/space_node/drawnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2698,9 +2698,11 @@ static void node_composit_buts_denoise(uiLayout *layout, bContext *UNUSED(C), Po
#ifndef WITH_OPENIMAGEDENOISE
uiItemL(layout, IFACE_("Disabled, built without OpenImageDenoise"), ICON_ERROR);
#else
# ifndef __APPLE__
if (!BLI_cpu_support_sse41()) {
uiItemL(layout, IFACE_("Disabled, CPU with SSE4.1 is required"), ICON_ERROR);
}
# endif
#endif

uiItemR(layout, ptr, "use_hdr", DEFAULT_FLAGS, NULL, ICON_NONE);
Expand Down

0 comments on commit 1ca877d

Please sign in to comment.