Fix T41222 Blender gives weird output when baking (4096*4096) resolution on GPU
[blender-staging.git] / intern / cycles / device / device_multi.cpp
index 564fbdbadf82f030abdb80c0215b5fd4577428d4..7f055c79491c7f28237e4781b3b99200007198d4 100644 (file)
@@ -280,7 +280,18 @@ public:
 
        int get_split_task_count(DeviceTask& task)
        {
 
        int get_split_task_count(DeviceTask& task)
        {
-               return 1;
+               int total_tasks = 0;
+               list<DeviceTask> tasks;
+               task.split(tasks, devices.size());
+               foreach(SubDevice& sub, devices) {
+                       if(!tasks.empty()) {
+                               DeviceTask subtask = tasks.front();
+                               tasks.pop_front();
+
+                               total_tasks += sub.device->get_split_task_count(subtask);
+                       }
+               }
+               return total_tasks;
        }
 
        void task_add(DeviceTask& task)
        }
 
        void task_add(DeviceTask& task)