diff options
Diffstat (limited to 'intern/cycles/device/device.cpp')
-rw-r--r-- | intern/cycles/device/device.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index dfbf57e8b88..bad156d40bf 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -494,16 +494,18 @@ vector<DeviceInfo> Device::available_devices(uint mask) } #endif -#ifdef WITH_CUDA - if (mask & DEVICE_MASK_CUDA) { +#if defined(WITH_CUDA) || defined(WITH_OPTIX) + if (mask & (DEVICE_MASK_CUDA | DEVICE_MASK_OPTIX)) { if (!(devices_initialized_mask & DEVICE_MASK_CUDA)) { if (device_cuda_init()) { device_cuda_info(cuda_devices); } devices_initialized_mask |= DEVICE_MASK_CUDA; } - foreach (DeviceInfo &info, cuda_devices) { - devices.push_back(info); + if (mask & DEVICE_MASK_CUDA) { + foreach (DeviceInfo &info, cuda_devices) { + devices.push_back(info); + } } } #endif @@ -512,7 +514,7 @@ vector<DeviceInfo> Device::available_devices(uint mask) if (mask & DEVICE_MASK_OPTIX) { if (!(devices_initialized_mask & DEVICE_MASK_OPTIX)) { if (device_optix_init()) { - device_optix_info(optix_devices); + device_optix_info(cuda_devices, optix_devices); } devices_initialized_mask |= DEVICE_MASK_OPTIX; } |