Revision: 44386
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44386
Author:   blendix
Date:     2012-02-23 20:27:17 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
Fix #30140: cycles multi GPU rendering with one device supporting full
shading and the other not can't work correct, disabled that now.

Modified Paths:
--------------
    trunk/blender/intern/cycles/device/device_multi.cpp

Modified: trunk/blender/intern/cycles/device/device_multi.cpp
===================================================================
--- trunk/blender/intern/cycles/device/device_multi.cpp 2012-02-23 19:48:18 UTC 
(rev 44385)
+++ trunk/blender/intern/cycles/device/device_multi.cpp 2012-02-23 20:27:17 UTC 
(rev 44386)
@@ -293,7 +293,7 @@
        return new MultiDevice(info, background);
 }
 
-static void device_multi_add(vector<DeviceInfo>& devices, DeviceType type, 
bool with_display, const char *id_fmt, int num)
+static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, 
bool with_display, bool with_advanced_shading, const char *id_fmt, int num)
 {
        DeviceInfo info;
 
@@ -302,10 +302,12 @@
        map<string, int>::iterator dt;
        int num_added = 0, num_display = 0;
 
-       info.advanced_shading = true;
+       info.advanced_shading = with_advanced_shading;
 
        foreach(DeviceInfo& subinfo, devices) {
                if(subinfo.type == type) {
+                       if(subinfo.advanced_shading != info.advanced_shading)
+                               continue;
                        if(subinfo.display_device) {
                                if(with_display)
                                        num_display++;
@@ -323,14 +325,12 @@
                        info.multi_devices.push_back(subinfo);
                        if(subinfo.display_device)
                                info.display_device = true;
-                       if(!subinfo.advanced_shading)
-                               info.advanced_shading = false;
                        num_added++;
                }
        }
 
        if(num_added <= 1 || (with_display && num_display == 0))
-               return;
+               return false;
 
        /* generate string */
        stringstream desc;
@@ -384,17 +384,24 @@
                devices.push_back(info);
        else
                devices.insert(devices.begin(), info);
+       
+       return true;
 }
 
 void device_multi_info(vector<DeviceInfo>& devices)
 {
        int num = 0;
-       device_multi_add(devices, DEVICE_CUDA, false, "CUDA_MULTI_%d", num++);
-       device_multi_add(devices, DEVICE_CUDA, true, "CUDA_MULTI_%d", num++);
 
+       if(!device_multi_add(devices, DEVICE_CUDA, false, true, 
"CUDA_MULTI_%d", num++))
+               device_multi_add(devices, DEVICE_CUDA, false, false, 
"CUDA_MULTI_%d", num++);
+       if(!device_multi_add(devices, DEVICE_CUDA, true, true, "CUDA_MULTI_%d", 
num++))
+               device_multi_add(devices, DEVICE_CUDA, true, false, 
"CUDA_MULTI_%d", num++);
+
        num = 0;
-       device_multi_add(devices, DEVICE_OPENCL, false, "OPENCL_MULTI_%d", 
num++);
-       device_multi_add(devices, DEVICE_OPENCL, true, "OPENCL_MULTI_%d", 
num++);
+       if(!device_multi_add(devices, DEVICE_OPENCL, false, true, 
"OPENCL_MULTI_%d", num++))
+               device_multi_add(devices, DEVICE_OPENCL, false, false, 
"OPENCL_MULTI_%d", num++);
+       if(!device_multi_add(devices, DEVICE_OPENCL, true, true, 
"OPENCL_MULTI_%d", num++))
+               device_multi_add(devices, DEVICE_OPENCL, true, false, 
"OPENCL_MULTI_%d", num++);
 }
 
 CCL_NAMESPACE_END

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to