Re-add optional OIDN denoise as an external dynamic library.#82831
Re-add optional OIDN denoise as an external dynamic library.#82831bruvzg wants to merge 1 commit intogodotengine:masterfrom
Conversation
e105c9e to
37aabd0
Compare
|
Superseded by #82832. |
|
Bummer. Using OIDN as an external lib sounded mor reasonable for integrations. |
|
Well this can be reconsidered later if need be, it doesn't change much in the implementation. But not having macOS ARM support would be the bigger bummer IMO. |
It seems to be possible to build it for ARM macOS, but for some reason it's not part of official releases. |
|
We're planning to include ARM macOS builds for OIDN starting with the next major release. |
Seems like on Windows, OIDN is unusable as a dynamic library unless all dependency libs are in the same folder as executable. Main dll is loading fine, and it's finding module dll, but unable to load its dependencies ( But in should be fixable in the OIDN module loader with something like this: diff --git a/core/module.cpp b/core/module.cpp
index 14ac590..db74014 100644
--- a/core/module.cpp
+++ b/core/module.cpp
@@ -50,7 +50,7 @@ OIDN_NAMESPACE_BEGIN
// Prevent the system from displaying a message box when the module fails to load
UINT prevErrorMode = GetErrorMode();
SetErrorMode(prevErrorMode | SEM_FAILCRITICALERRORS);
- void* module = LoadLibraryW(path.c_str());
+ void* module = LoadLibraryExW(path.c_str(), nullptr, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
SetErrorMode(prevErrorMode);
#else
void* module = dlopen(path.c_str(), RTLD_NOW | RTLD_LOCAL);I'll check it on Linux and macOS a bit later. |
|
A new PR version - #83314 |
Implements godotengine/godot-proposals#7640
Alternative variant #82832 (uses executable).
Pros: more stable API, no writing/reading to disk.
Cons: library should be the same architecture as executable (and there's no ARM64 prebuild library for macOS in official releases), might have issues with dependency loading paths.
TODO: ensure correct library lookup paths are set on all platforms.