diff options
author | Mai Lavelle <mai.lavelle@gmail.com> | 2017-02-18 15:07:01 +0300 |
---|---|---|
committer | Mai Lavelle <mai.lavelle@gmail.com> | 2017-02-18 15:07:01 +0300 |
commit | f4f3e90fbd7ec97f3d6475c95e8d21081fdd9400 (patch) | |
tree | 23a4195061807bc32c1d88e87ce75ad6f7e8d918 /intern/cycles/device | |
parent | f36289ac1d50fd94e425370edbd8b390e2e47e7e (diff) |
Cycles: Update tiles less frequently for split kernel
Increases the time between tile updates exponentially until theres 10 seconds
between updates. By having more time between updates we can push more samples
to the device at once and keep the number of threads doing actual work
higher. This gives a nice speed up.
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/device_split_kernel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/device/device_split_kernel.cpp b/intern/cycles/device/device_split_kernel.cpp index c5571ad36d3..c50afe85da5 100644 --- a/intern/cycles/device/device_split_kernel.cpp +++ b/intern/cycles/device/device_split_kernel.cpp @@ -158,6 +158,9 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task, tile.sample = tile.start_sample; + /* for exponential increase between tile updates */ + int time_multiplier = 1; + while(tile.sample < tile.start_sample + tile.num_samples) { /* to keep track of how long it takes to run a number of samples */ double start_time = time_dt(); @@ -166,7 +169,7 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task, const int initial_num_samples = 1; /* approx number of samples per second */ int samples_per_second = (avg_time_per_sample > 0.0) ? - int(1.0 / avg_time_per_sample) + 1 : initial_num_samples; + int(double(time_multiplier) / avg_time_per_sample) + 1 : initial_num_samples; RenderTile subtile = tile; subtile.start_sample = tile.sample; @@ -265,6 +268,8 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task, tile.sample += subtile.num_samples; task->update_progress(&tile, tile.w*tile.h*subtile.num_samples); + time_multiplier = min(time_multiplier << 1, 10); + if(task->get_cancel()) { return true; } |