diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-30 20:36:54 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-30 20:36:54 +0300 |
commit | f4b1f1f0beece897df0a9013adf2253e89a85975 (patch) | |
tree | 936e13ede178105f13396008076db7a955bc97a9 /intern/cycles/app | |
parent | ab682b15582bfc2e550f979c34f2f2b27629ea3d (diff) | |
parent | 001414fb2f7346d2ff332bf851373522d87659d7 (diff) |
Merge branch 'blender2.7'
Diffstat (limited to 'intern/cycles/app')
-rw-r--r-- | intern/cycles/app/cycles_standalone.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp index ff2e0156b1a..9c899a38e7b 100644 --- a/intern/cycles/app/cycles_standalone.cpp +++ b/intern/cycles/app/cycles_standalone.cpp @@ -363,13 +363,8 @@ static void options_parse(int argc, const char **argv) string devicename = "CPU"; bool list = false; - vector<DeviceType>& types = Device::available_types(); - - /* TODO(sergey): Here's a feedback loop happens: on the one hand we want - * the device list to be printed in help message, on the other hand logging - * is not initialized yet so we wouldn't have debug log happening in the - * device initialization. - */ + /* List devices for which support is compiled in. */ + vector<DeviceType> types = Device::available_types(); foreach(DeviceType type, types) { if(device_names != "") device_names += ", "; @@ -421,7 +416,7 @@ static void options_parse(int argc, const char **argv) } if(list) { - vector<DeviceInfo>& devices = Device::available_devices(); + vector<DeviceInfo> devices = Device::available_devices(); printf("Devices:\n"); foreach(DeviceInfo& info, devices) { @@ -456,15 +451,12 @@ static void options_parse(int argc, const char **argv) /* find matching device */ DeviceType device_type = Device::type_from_string(devicename.c_str()); - vector<DeviceInfo>& devices = Device::available_devices(); - bool device_available = false; + vector<DeviceInfo> devices = Device::available_devices(DEVICE_MASK(device_type)); - foreach(DeviceInfo& device, devices) { - if(device_type == device.type) { - options.session_params.device = device; - device_available = true; - break; - } + bool device_available = false; + if (!devices.empty()) { + options.session_params.device = devices.front(); + device_available = true; } /* handle invalid configurations */ |