Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/device_task.cpp
| Show All 13 Lines | |||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "device_task.h" | #include "device_task.h" | ||||
| #include "buffers.h" | |||||
| #include "util_algorithm.h" | #include "util_algorithm.h" | ||||
| #include "util_time.h" | #include "util_time.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /* Device Task */ | /* Device Task */ | ||||
| DeviceTask::DeviceTask(Type type_) | DeviceTask::DeviceTask(Type type_) | ||||
| ▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void DeviceTask::update_progress(RenderTile *rtile) | void DeviceTask::update_progress(RenderTile *rtile) | ||||
| { | { | ||||
| if((type != PATH_TRACE) && | if((type != PATH_TRACE) && | ||||
| (type != SHADER)) | (type != SHADER)) | ||||
| return; | return; | ||||
| if(update_progress_sample) | if(update_progress_sample) { | ||||
| update_progress_sample(); | int pixel_samples; | ||||
| if(type == PATH_TRACE) { | |||||
sergey: Would be cool to avoid having this in DeviceTask. Maybe can pass number of pixels as an… | |||||
| pixel_samples = rtile->w * rtile->h; | |||||
| } | |||||
| else { | |||||
| pixel_samples = shader_w; | |||||
| } | |||||
| update_progress_sample(pixel_samples, rtile? rtile->sample : 0); | |||||
| } | |||||
| if(update_tile_sample) { | if(update_tile_sample) { | ||||
| double current_time = time_dt(); | double current_time = time_dt(); | ||||
| if(current_time - last_update_time >= 1.0) { | if(current_time - last_update_time >= 1.0) { | ||||
| update_tile_sample(*rtile); | update_tile_sample(*rtile); | ||||
| last_update_time = current_time; | last_update_time = current_time; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
Would be cool to avoid having this in DeviceTask. Maybe can pass number of pixels as an argument (if that makes things easier to calculate in the callee).
Not so much concerned about about considering this a stopper tho.