Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/device_multi.cpp
| Show First 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | foreach(SubDevice& sub, devices) { | ||||
| if(sub.device == sub_device) | if(sub.device == sub_device) | ||||
| return i; | return i; | ||||
| i++; | i++; | ||||
| } | } | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| void task_add(DeviceTask& task) | int task_add(DeviceTask& task) | ||||
| { | { | ||||
| list<DeviceTask> tasks; | list<DeviceTask> tasks; | ||||
| task.split(tasks, devices.size()); | task.split(tasks, devices.size()); | ||||
| foreach(SubDevice& sub, devices) { | foreach(SubDevice& sub, devices) { | ||||
| if(!tasks.empty()) { | if(!tasks.empty()) { | ||||
| DeviceTask subtask = tasks.front(); | DeviceTask subtask = tasks.front(); | ||||
| tasks.pop_front(); | tasks.pop_front(); | ||||
| if(task.buffer) subtask.buffer = sub.ptr_map[task.buffer]; | if(task.buffer) subtask.buffer = sub.ptr_map[task.buffer]; | ||||
| if(task.rgba_byte) subtask.rgba_byte = sub.ptr_map[task.rgba_byte]; | if(task.rgba_byte) subtask.rgba_byte = sub.ptr_map[task.rgba_byte]; | ||||
| if(task.rgba_half) subtask.rgba_half = sub.ptr_map[task.rgba_half]; | if(task.rgba_half) subtask.rgba_half = sub.ptr_map[task.rgba_half]; | ||||
| if(task.shader_input) subtask.shader_input = sub.ptr_map[task.shader_input]; | if(task.shader_input) subtask.shader_input = sub.ptr_map[task.shader_input]; | ||||
| if(task.shader_output) subtask.shader_output = sub.ptr_map[task.shader_output]; | if(task.shader_output) subtask.shader_output = sub.ptr_map[task.shader_output]; | ||||
| sub.device->task_add(subtask); | sub.device->task_add(subtask); | ||||
| } | } | ||||
| } | } | ||||
| //XXX do I need to include the subtasks in the count? | |||||
| return tasks.size(); | |||||
| } | } | ||||
| void task_wait() | void task_wait() | ||||
| { | { | ||||
| foreach(SubDevice& sub, devices) | foreach(SubDevice& sub, devices) | ||||
| sub.device->task_wait(); | sub.device->task_wait(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines | |||||