Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/device_multi.cpp
| Show First 20 Lines • Show All 346 Lines • ▼ Show 20 Lines | static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool with_display, bool with_advanced_shading, const char *id_fmt, int num) | ||||
| /* create map to find duplicate descriptions */ | /* create map to find duplicate descriptions */ | ||||
| map<string, int> dupli_map; | map<string, int> dupli_map; | ||||
| map<string, int>::iterator dt; | map<string, int>::iterator dt; | ||||
| int num_added = 0, num_display = 0; | int num_added = 0, num_display = 0; | ||||
| info.advanced_shading = with_advanced_shading; | info.advanced_shading = with_advanced_shading; | ||||
| info.pack_images = false; | info.pack_images = false; | ||||
| info.extended_images = true; | info.has_bindless_textures = true; | ||||
| foreach(DeviceInfo& subinfo, devices) { | foreach(DeviceInfo& subinfo, devices) { | ||||
| if(subinfo.type == type) { | if(subinfo.type == type) { | ||||
| if(subinfo.advanced_shading != info.advanced_shading) | if(subinfo.advanced_shading != info.advanced_shading) | ||||
| continue; | continue; | ||||
| if(subinfo.display_device) { | if(subinfo.display_device) { | ||||
| if(with_display) | if(with_display) | ||||
| num_display++; | num_display++; | ||||
| else | else | ||||
| continue; | continue; | ||||
| } | } | ||||
| string key = subinfo.description; | string key = subinfo.description; | ||||
| if(dupli_map.find(key) == dupli_map.end()) | if(dupli_map.find(key) == dupli_map.end()) | ||||
| dupli_map[key] = 1; | dupli_map[key] = 1; | ||||
| else | else | ||||
| dupli_map[key]++; | dupli_map[key]++; | ||||
| info.multi_devices.push_back(subinfo); | info.multi_devices.push_back(subinfo); | ||||
| if(subinfo.display_device) | if(subinfo.display_device) | ||||
| info.display_device = true; | info.display_device = true; | ||||
| info.pack_images = info.pack_images || subinfo.pack_images; | info.pack_images = info.pack_images || subinfo.pack_images; | ||||
| info.extended_images = info.extended_images && subinfo.extended_images; | info.has_bindless_textures = info.has_bindless_textures && subinfo.has_bindless_textures; | ||||
| num_added++; | num_added++; | ||||
| } | } | ||||
| } | } | ||||
| if(num_added <= 1 || (with_display && num_display == 0)) | if(num_added <= 1 || (with_display && num_display == 0)) | ||||
| return false; | return false; | ||||
| /* generate string */ | /* generate string */ | ||||
| ▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines | |||||