[Bf-blender-cvs] [f4f3e90fbd] cycles_split_kernel: Cycles: Update tiles less frequently for split kernel

Mai Lavelle noreply at git.blender.org
Sat Feb 18 13:13:22 CET 2017


Commit: f4f3e90fbd7ec97f3d6475c95e8d21081fdd9400
Author: Mai Lavelle
Date:   Sat Feb 18 07:07:01 2017 -0500
Branches: cycles_split_kernel
https://developer.blender.org/rBf4f3e90fbd7ec97f3d6475c95e8d21081fdd9400

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.

===================================================================

M	intern/cycles/device/device_split_kernel.cpp

===================================================================

diff --git a/intern/cycles/device/device_split_kernel.cpp b/intern/cycles/device/device_split_kernel.cpp
index c5571ad36d..c50afe85da 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;
 		}




More information about the Bf-blender-cvs mailing list