[Bf-blender-cvs] [3824ba7] gooseberry_farm: Cycles: Report currently sampling tile when CPU is working on the last tile

Sergey Sharybin noreply at git.blender.org
Thu Jun 18 16:18:54 CEST 2015


Commit: 3824ba7b98c929e3b8399c37afb5937841c300c9
Author: Sergey Sharybin
Date:   Thu Jun 18 16:15:37 2015 +0200
Branches: gooseberry_farm
https://developer.blender.org/rB3824ba7b98c929e3b8399c37afb5937841c300c9

Cycles: Report currently sampling tile when CPU is working on the last tile

This is mainly useful for the render farms output when logging might stop at
the "Path Tracing Tile N/N" string, which makes it a bit difficult to follow
what exactly is happening (node going crazy, hardware issues or just last tile
is too much heavy).

This is more like an experiment, might be changed in the future.

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

M	intern/cycles/render/session.cpp

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

diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index cddc569..c5d0e70 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -810,16 +810,21 @@ void Session::update_status_time(bool show_pause, bool show_done)
 	string status, substatus;
 
 	if(!params.progressive) {
-		bool is_gpu = params.device.type == DEVICE_CUDA || params.device.type == DEVICE_OPENCL;
-		bool is_multidevice = params.device.multi_devices.size() > 1;
-		bool is_cpu = params.device.type == DEVICE_CPU;
+		const int progress_sample = progress.get_sample(), num_samples = tile_manager.num_samples;
+		const bool is_gpu = params.device.type == DEVICE_CUDA || params.device.type == DEVICE_OPENCL;
+		const bool is_multidevice = params.device.multi_devices.size() > 1;
+		const bool is_cpu = params.device.type == DEVICE_CPU;
+		const bool is_last_tile = (num_samples * num_tiles - progress_sample) < num_samples;
 
 		substatus = string_printf("Path Tracing Tile %d/%d", tile, num_tiles);
 
-		if(((is_gpu && !is_multidevice) || (is_cpu && num_tiles == 1)) && !device->info.use_split_kernel) {
+		if((is_gpu && !is_multidevice && !device->info.use_split_kernel) ||
+		   (is_cpu && (num_tiles == 1 || is_last_tile)))
+		{
 			/* When using split-kernel (OpenCL) each thread in a tile will be working on a different
 			 * sample. Can't display sample number when device uses split-kernel
 			 */
+
 			/* when rendering on GPU multithreading happens within single tile, as in
 			 * tiles are handling sequentially and in this case we could display
 			 * currently rendering sample number
@@ -827,17 +832,21 @@ void Session::update_status_time(bool show_pause, bool show_done)
 			 * also display the info on CPU, when using 1 tile only
 			 */
 
-			int sample = progress.get_sample(), num_samples = tile_manager.num_samples;
-
+			int status_sample = progress_sample;
 			if(tile > 1) {
 				/* sample counter is global for all tiles, subtract samples
 				 * from already finished tiles to get sample counter for
 				 * current tile only
 				 */
-				sample -= (tile - 1) * num_samples;
+				if(is_cpu && is_last_tile && num_tiles > 1) {
+					status_sample = num_samples - (num_samples * num_tiles - progress_sample);
+				}
+				else {
+					status_sample -= (tile - 1) * num_samples;
+				}
 			}
 
-			substatus += string_printf(", Sample %d/%d", sample, num_samples);
+			substatus += string_printf(", Sample %d/%d", status_sample, num_samples);
 		}
 	}
 	else if(tile_manager.num_samples == USHRT_MAX)




More information about the Bf-blender-cvs mailing list