[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49641] branches/soc-2011-tomato/intern/ cycles: Tomato Cycles: do not discard unfinished tiles on cancel

Sergey Sharybin sergey.vfx at gmail.com
Tue Aug 7 11:22:26 CEST 2012


Revision: 49641
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49641
Author:   nazgul
Date:     2012-08-07 09:22:26 +0000 (Tue, 07 Aug 2012)
Log Message:
-----------
Tomato Cycles: do not discard unfinished tiles on cancel

Do not discard (fill with black) tiles which are not fully rendered
(not all the samples are calculated for tile) when canceling render.

This could be helpful to tweak some settings when render glitch is
discovered. Also it could be used in such scenarios as setting
samples number to something really high and render still image
until result is reasonable, controlling this manually.

This could make cancel not so responsible on CPU, but it wouldn't
be less responsible than GPU, also could potentially give some
%% of speedup by avoiding checking cancel state after every pixel
sampled.

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/cycles/device/device_cpu.cpp
    branches/soc-2011-tomato/intern/cycles/render/session.cpp

Modified: branches/soc-2011-tomato/intern/cycles/device/device_cpu.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/device/device_cpu.cpp	2012-08-07 09:20:30 UTC (rev 49640)
+++ branches/soc-2011-tomato/intern/cycles/device/device_cpu.cpp	2012-08-07 09:22:26 UTC (rev 49641)
@@ -154,20 +154,18 @@
 #ifdef WITH_OPTIMIZED_KERNEL
 			if(system_cpu_support_optimized()) {
 				for(int sample = start_sample; sample < end_sample; sample++) {
+					if (task.get_cancel() || task_pool.cancelled())
+						break;
+
 					for(int y = tile.y; y < tile.y + tile.h; y++) {
 						for(int x = tile.x; x < tile.x + tile.w; x++) {
-							if (task.get_cancel())
-								break;
-
-							if(task_pool.cancelled())
-								break;
-
 							kernel_cpu_optimized_path_trace(kg, render_buffer, rng_state,
 								sample, x, y, tile.offset, tile.stride);
 						}
 					}
 
 					tile.sample = sample + 1;
+
 					task.update_progress(tile);
 				}
 			}
@@ -175,22 +173,18 @@
 #endif
 			{
 				for(int sample = start_sample; sample < end_sample; sample++) {
+					if (task.get_cancel() || task_pool.cancelled())
+						break;
+
 					for(int y = tile.y; y < tile.y + tile.h; y++) {
 						for(int x = tile.x; x < tile.x + tile.w; x++) {
-							if (task.get_cancel()) {
-								break;
-							}
-
-							if(task_pool.cancelled())
-								break;
-
 							kernel_cpu_path_trace(kg, render_buffer, rng_state,
 								sample, x, y, tile.offset, tile.stride);
-
 						}
 					}
 
 					tile.sample = sample + 1;
+
 					task.update_progress(tile);
 				}
 			}

Modified: branches/soc-2011-tomato/intern/cycles/render/session.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/render/session.cpp	2012-08-07 09:20:30 UTC (rev 49640)
+++ branches/soc-2011-tomato/intern/cycles/render/session.cpp	2012-08-07 09:22:26 UTC (rev 49641)
@@ -380,8 +380,7 @@
 	if(update_render_tile_cb) {
 		/* todo: optimize this by making it thread safe and removing lock */
 
-		if(!progress.get_cancel())
-			update_render_tile_cb(rtile);
+		update_render_tile_cb(rtile);
 	}
 
 	update_status_time();
@@ -393,8 +392,8 @@
 
 	if(write_render_tile_cb) {
 		/* todo: optimize this by making it thread safe and removing lock */
-		if(!progress.get_cancel())
-			write_render_tile_cb(rtile);
+		write_render_tile_cb(rtile);
+
 		delete rtile.buffers;
 	}
 




More information about the Bf-blender-cvs mailing list