Cycles: Allow enabling OIDN for HIP with environment variable

Using the existing OIDN_DEVICE_HIP, don't overwrite it if it was
already set.

Ref #115045

Pull Request: https://projects.blender.org/blender/blender/pulls/119672
This commit is contained in:
Brecht Van Lommel 2024-03-19 18:14:28 +01:00 committed by Brecht Van Lommel
parent f771a8563b
commit ab9f9930b5

@ -220,11 +220,13 @@ static void device_oidn_init_once()
*
* This also affects systems which have for example an NVIDIA GPU as OIDN
* initializes all device types together. */
if (getenv("OIDN_DEVICE_HIP") == nullptr) {
#ifdef _WIN32
_putenv_s("OIDN_DEVICE_HIP", "0");
_putenv_s("OIDN_DEVICE_HIP", "0");
#else
setenv("OIDN_DEVICE_HIP", "0", true);
setenv("OIDN_DEVICE_HIP", "0", true);
#endif
}
initialized = true;
}
}