Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/integrator/denoiser.cpp
| Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
| static Device *find_best_device(Device *device, DenoiserType type) | static Device *find_best_device(Device *device, DenoiserType type) | ||||
| { | { | ||||
| Device *best_device = nullptr; | Device *best_device = nullptr; | ||||
| device->foreach_device([&](Device *sub_device) { | device->foreach_device([&](Device *sub_device) { | ||||
| if ((sub_device->info.denoisers & type) == 0) { | if ((sub_device->info.denoisers & type) == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (!best_device) { | if (!best_device) { | ||||
| best_device = sub_device; | best_device = sub_device; | ||||
| } | } | ||||
| else { | else { | ||||
| /* Prefer a device that can use graphics interop for faster display update. */ | |||||
| if (sub_device->should_use_graphics_interop() && | |||||
| !best_device->should_use_graphics_interop()) { | |||||
| best_device = sub_device; | |||||
| } | |||||
| /* TODO(sergey): Choose fastest device from available ones. Taking into account performance | /* TODO(sergey): Choose fastest device from available ones. Taking into account performance | ||||
| * of the device and data transfer cost. */ | * of the device and data transfer cost. */ | ||||
| } | } | ||||
| }); | }); | ||||
| return best_device; | return best_device; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines | |||||