[Bf-blender-cvs] [56dcfcce059] master: Cycles: Disable baking in mega kernel when not in use to improve build times

Mai Lavelle noreply at git.blender.org
Fri Jun 30 05:11:08 CEST 2017


Commit: 56dcfcce059f696ed927f97502579f8286429116
Author: Mai Lavelle
Date:   Thu Jun 29 22:50:00 2017 -0400
Branches: master
https://developer.blender.org/rB56dcfcce059f696ed927f97502579f8286429116

Cycles: Disable baking in mega kernel when not in use to improve build times

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

M	intern/cycles/device/opencl/opencl_base.cpp

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

diff --git a/intern/cycles/device/opencl/opencl_base.cpp b/intern/cycles/device/opencl/opencl_base.cpp
index e4ab979dcbf..223a5901197 100644
--- a/intern/cycles/device/opencl/opencl_base.cpp
+++ b/intern/cycles/device/opencl/opencl_base.cpp
@@ -1226,7 +1226,7 @@ void OpenCLDeviceBase::store_cached_kernel(
 }
 
 string OpenCLDeviceBase::build_options_for_base_program(
-        const DeviceRequestedFeatures& /*requested_features*/)
+        const DeviceRequestedFeatures& requested_features)
 {
 	/* TODO(sergey): By default we compile all features, meaning
 	 * mega kernel is not getting feature-based optimizations.
@@ -1234,6 +1234,14 @@ string OpenCLDeviceBase::build_options_for_base_program(
 	 * Ideally we need always compile kernel with as less features
 	 * enabled as possible to keep performance at it's max.
 	 */
+
+	/* For now disable baking when not in use as this has major
+	 * impact on kernel build times.
+	 */
+	if(!requested_features.use_baking) {
+		return "-D__NO_BAKING__";
+	}
+
 	return "";
 }




More information about the Bf-blender-cvs mailing list