[Bf-blender-cvs] [c5eb95a] cycles_kernel_split: Initialize per_thread_output_buffer_size based in render type

varunsundar08 noreply at git.blender.org
Wed Apr 15 17:37:03 CEST 2015


Commit: c5eb95aa27be613345a625cc4a28befa0339f1d1
Author: varunsundar08
Date:   Thu Apr 9 14:47:24 2015 +0530
Branches: cycles_kernel_split
https://developer.blender.org/rBc5eb95aa27be613345a625cc4a28befa0339f1d1

Initialize per_thread_output_buffer_size based in render type

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

M	intern/cycles/device/device_opencl.cpp
M	intern/cycles/render/session.cpp

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

diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index 3329fb7..983a7be 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -565,6 +565,8 @@ public:
 	/* Number of path-iterations to be done in one shot */
 	unsigned int PathIteration_times;
 
+	/* Denotes if the render is background or foreground */
+	bool background;
 #ifdef __WORK_STEALING__
 	/* Work pool with respect to each work group */
 	cl_mem work_pool_wgs;
@@ -653,6 +655,7 @@ public:
 
 #ifdef __SPLIT_KERNEL__
 		use_split_kernel = true;
+		background = background_;
 
 		/* Initialize kernels */
 		ckPathTraceKernel_DataInit_SPLIT_KERNEL = NULL;
@@ -3605,7 +3608,18 @@ public:
 					ciErr = clGetMemObjectInfo((cl_mem)tile.buffer, CL_MEM_SIZE, sizeof(output_buffer_size), &output_buffer_size, NULL);
 					assert(ciErr == CL_SUCCESS && "Can't get tile.buffer mem object info");
 					/* This value is different when running on AMD and NV */
-					per_thread_output_buffer_size = output_buffer_size / (tile.w * tile.h);
+					if (background) {
+						/* In offline render the number of buffer elements
+						 * associated with tile.buffer is the current tile size
+						 */
+						per_thread_output_buffer_size = output_buffer_size / (tile.w * tile.h);
+					}
+					else {
+						/* interactive rendering, unlike offline render, the number of buffer elements
+						 * associated with tile.buffer is the entire viewport size.
+						 */
+						per_thread_output_buffer_size = output_buffer_size / (tile.buffers->params.width * tile.buffers->params.height);
+					}
 
 					/* Check render feasibility */
 					feasible_global_work_size = get_feasible_global_work_size(tile, CL_MEM_PTR(const_mem_map["__data"]->device_pointer));
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index 68ba9e5..36895d4 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -274,6 +274,11 @@ void Session::run_gpu()
 			/* update status and timing */
 			update_status_time();
 
+			if (device->use_split_kernel) {
+				/* OpenCL split - load kernels */
+				load_kernels();
+			}
+
 			/* path trace */
 			path_trace();




More information about the Bf-blender-cvs mailing list