[Bf-blender-cvs] [ebc267b] cycles_kernel_split: Add big-tile-handle logic in thread_run -> device_opencl.cpp

varunsundar08 noreply at git.blender.org
Wed Apr 15 17:36:55 CEST 2015


Commit: ebc267bfefedd4b4a77d984576118d679870bcc0
Author: varunsundar08
Date:   Wed Apr 8 11:31:51 2015 +0530
Branches: cycles_kernel_split
https://developer.blender.org/rBebc267bfefedd4b4a77d984576118d679870bcc0

Add big-tile-handle logic in thread_run -> device_opencl.cpp

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

M	intern/cycles/device/device_opencl.cpp

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

diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index 1fc765c..103f710 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -3716,6 +3716,7 @@ One possible tile size is %zux%zu \n", tile_max_x - local_size[0] , tile_max_y -
 					: render_feasible_tile_size.y;
 			}
 		}
+		return to_path_trace_rtile;
 	}
 
 	void thread_run(DeviceTask *task)
@@ -3738,8 +3739,21 @@ One possible tile size is %zux%zu \n", tile_max_x - local_size[0] , tile_max_y -
 				tile.rng_state_offset_x = 0;
 				tile.rng_state_offset_y = 0;
 
-				/* The second argument is dummy */
-				path_trace(tile, 0);
+				size_t feasible_global_work_size = get_feasible_global_work_size(tile, CL_MEM_PTR(const_mem_map["__data"]->device_pointer));
+				if (need_to_split_tile(tile.w, tile.h, feasible_global_work_size)) {
+					int2 render_feasible_tile_size = get_render_feasible_tile_size(feasible_global_work_size);
+					vector<RenderTile> to_path_trace_render_tiles = split_tiles(tile, render_feasible_tile_size);
+
+					/* Process all split tiles */
+					for (int tile_iter = 0; tile_iter < to_path_trace_render_tiles.size(); tile_iter++) {
+						path_trace(to_path_trace_render_tiles[tile_iter], 0);
+					}
+				}
+				else {
+					/* No splitting required; process the entire tile at once */
+					/* The second argument is dummy */
+					path_trace(tile, 0);
+				}
 				tile.sample = tile.start_sample + tile.num_samples;
 #else
 				int start_sample = tile.start_sample;




More information about the Bf-blender-cvs mailing list