[Bf-blender-cvs] [56ead9d] master: Cycles: Make branched path tracer covered with requested features

Sergey Sharybin noreply at git.blender.org
Sun Nov 22 09:57:39 CET 2015


Commit: 56ead9d34b8f473a44ba9f9fb0ff4878ea28af3e
Author: Sergey Sharybin
Date:   Sun Nov 22 13:54:51 2015 +0500
Branches: master
https://developer.blender.org/rB56ead9d34b8f473a44ba9f9fb0ff4878ea28af3e

Cycles: Make branched path tracer covered with requested features

This gives few percent extra memory saving for the CUDA kernel when
using regular path tracing.

Still more like an experiment, but will be handy in the future.

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

M	intern/cycles/device/device.h
M	intern/cycles/kernel/kernel_types.h
M	intern/cycles/render/session.cpp

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

diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h
index b956090..9324f5c 100644
--- a/intern/cycles/device/device.h
+++ b/intern/cycles/device/device.h
@@ -103,6 +103,9 @@ public:
 	/* Use subsurface scattering materials. */
 	bool use_subsurface;
 
+	/* Use branched integrator. */
+	bool use_integrator_branched;
+
 	DeviceRequestedFeatures()
 	{
 		/* TODO(sergey): Find more meaningful defaults. */
@@ -115,6 +118,7 @@ public:
 		use_camera_motion = false;
 		use_baking = false;
 		use_subsurface = false;
+		use_integrator_branched = false;
 	}
 
 	bool modified(const DeviceRequestedFeatures& requested_features)
@@ -127,7 +131,8 @@ public:
 		         use_object_motion == requested_features.use_object_motion &&
 		         use_camera_motion == requested_features.use_camera_motion &&
 		         use_baking == requested_features.use_baking &&
-		         use_subsurface == requested_features.use_subsurface);
+		         use_subsurface == requested_features.use_subsurface &&
+		         use_integrator_branched == requested_features.use_integrator_branched);
 	}
 
 	/* Convert the requested features structure to a build options,
@@ -159,6 +164,9 @@ public:
 		if(!use_subsurface) {
 			build_options += " -D__NO_SUBSURFACE__";
 		}
+		if(!use_integrator_branched) {
+			build_options += " -D__NO_BRANCHED_PATH__";
+		}
 		return build_options;
 	}
 };
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 31ad494..5ccbc1d 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -193,6 +193,9 @@ CCL_NAMESPACE_BEGIN
 #ifdef __NO_SUBSURFACE__
 #  undef __SUBSURFACE__
 #endif
+#ifdef __NO_BRANCHED_PATH__
+#  undef __BRANCHED_PATH__
+#endif
 
 /* Random Numbers */
 
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index b5bc410..762e49a 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -639,6 +639,7 @@ DeviceRequestedFeatures Session::get_requested_device_features()
 
 	BakeManager *bake_manager = scene->bake_manager;
 	requested_features.use_baking = bake_manager->get_baking();
+	requested_features.use_integrator_branched = (scene->integrator->method == Integrator::BRANCHED_PATH);
 
 	return requested_features;
 }




More information about the Bf-blender-cvs mailing list