[Bf-blender-cvs] [e17f7af0ce7] blender2.7: Cleanup: remove Cycles advanced shading features toggle.

Brecht Van Lommel noreply at git.blender.org
Sun Mar 17 12:05:21 CET 2019


Commit: e17f7af0ce7e045e287b517f775a282a7d7cc8c1
Author: Brecht Van Lommel
Date:   Sat Mar 16 16:06:36 2019 +0100
Branches: blender2.7
https://developer.blender.org/rBe17f7af0ce7e045e287b517f775a282a7d7cc8c1

Cleanup: remove Cycles advanced shading features toggle.

It's effectively always enabled, only not on some unsupported OpenCL devices.
For testing those it's not useful to disable these features. This is replaced
by the more fine grained feature toggles that we have now.

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

M	intern/cycles/blender/blender_sync.cpp
M	intern/cycles/device/device.h
M	intern/cycles/device/device_cpu.cpp
M	intern/cycles/device/device_cuda.cpp
M	intern/cycles/device/device_network.cpp
M	intern/cycles/device/device_opencl.cpp
M	intern/cycles/device/opencl/opencl.h
M	intern/cycles/device/opencl/opencl_util.cpp
M	intern/cycles/kernel/kernel_types.h
M	intern/cycles/render/light.cpp

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

diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index a1202cbbad4..c595e0364c6 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -559,10 +559,6 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer& b_rlay,
 	vector<Pass> passes;
 	Pass::add(PASS_COMBINED, passes);
 
-	if(!session_params.device.advanced_shading) {
-		return passes;
-	}
-
 	/* loop over passes */
 	BL::RenderLayer::passes_iterator b_pass_iter;
 
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h
index 6f3208e955f..281681eaf78 100644
--- a/intern/cycles/device/device.h
+++ b/intern/cycles/device/device.h
@@ -73,7 +73,6 @@ public:
 	string id; /* used for user preferences, should stay fixed with changing hardware config */
 	int num;
 	bool display_device;            /* GPU is used as a display device. */
-	bool advanced_shading;          /* Supports full shading system. */
 	bool has_half_images;           /* Support half-float textures. */
 	bool has_volume_decoupled;      /* Decoupled volume shading. */
 	bool has_osl;                   /* Support Open Shading Language. */
@@ -89,7 +88,6 @@ public:
 		num = 0;
 		cpu_threads = 0;
 		display_device = false;
-		advanced_shading = true;
 		has_half_images = false;
 		has_volume_decoupled = false;
 		has_osl = false;
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index 27f091d4188..370bc48f9f7 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -1122,7 +1122,6 @@ void device_cpu_info(vector<DeviceInfo>& devices)
 	info.description = system_cpu_brand_string();
 	info.id = "CPU";
 	info.num = 0;
-	info.advanced_shading = true;
 	info.has_volume_decoupled = true;
 	info.has_osl = true;
 	info.has_half_images = true;
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index a7539d2ac31..594782f3d1d 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -2512,7 +2512,6 @@ void device_cuda_info(vector<DeviceInfo>& devices)
 		info.description = string(name);
 		info.num = num;
 
-		info.advanced_shading = (major >= 3);
 		info.has_half_images = (major >= 3);
 		info.has_volume_decoupled = false;
 
diff --git a/intern/cycles/device/device_network.cpp b/intern/cycles/device/device_network.cpp
index 91628490b51..6736480e95a 100644
--- a/intern/cycles/device/device_network.cpp
+++ b/intern/cycles/device/device_network.cpp
@@ -308,7 +308,6 @@ void device_network_info(vector<DeviceInfo>& devices)
 	info.num = 0;
 
 	/* todo: get this info from device */
-	info.advanced_shading = true;
 	info.has_volume_decoupled = false;
 	info.has_osl = false;
 
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index 948fe407f63..4cefaa217f1 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -119,7 +119,6 @@ void device_opencl_info(vector<DeviceInfo>& devices)
 		info.num = num_devices;
 		/* We don't know if it's used for display, but assume it is. */
 		info.display_device = true;
-		info.advanced_shading = OpenCLInfo::kernel_use_advanced_shading(platform_name);
 		info.use_split_kernel = true;
 		info.has_volume_decoupled = false;
 		info.id = id;
diff --git a/intern/cycles/device/opencl/opencl.h b/intern/cycles/device/opencl/opencl.h
index bb507be4c72..a8ad4a935f7 100644
--- a/intern/cycles/device/opencl/opencl.h
+++ b/intern/cycles/device/opencl/opencl.h
@@ -84,7 +84,6 @@ class OpenCLInfo
 public:
 	static cl_device_type device_type();
 	static bool use_debug();
-	static bool kernel_use_advanced_shading(const string& platform_name);
 	static bool device_supported(const string& platform_name,
 	                             const cl_device_id device_id);
 	static bool platform_version_check(cl_platform_id platform,
diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp
index 920c8dc4e6a..5a1e12af8ab 100644
--- a/intern/cycles/device/opencl/opencl_util.cpp
+++ b/intern/cycles/device/opencl/opencl_util.cpp
@@ -737,23 +737,6 @@ bool OpenCLInfo::use_debug()
 	return DebugFlags().opencl.debug;
 }
 
-bool OpenCLInfo::kernel_use_advanced_shading(const string& platform)
-{
-	/* keep this in sync with kernel_types.h! */
-	if(platform == "NVIDIA CUDA")
-		return true;
-	else if(platform == "Apple")
-		return true;
-	else if(platform == "AMD Accelerated Parallel Processing")
-		return true;
-	else if(platform == "Intel(R) OpenCL")
-		return true;
-	/* Make sure officially unsupported OpenCL platforms
-	 * does not set up to use advanced shading.
-	 */
-	return false;
-}
-
 bool OpenCLInfo::device_supported(const string& platform_name,
                                   const cl_device_id device_id)
 {
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 281d9a25047..e0bf9b054ac 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -90,7 +90,6 @@ CCL_NAMESPACE_BEGIN
 #    define __QBVH__
 #  endif
 #  define __KERNEL_SHADING__
-#  define __KERNEL_ADV_SHADING__
 #  define __BRANCHED_PATH__
 #  ifdef WITH_OSL
 #    define __OSL__
@@ -107,7 +106,6 @@ CCL_NAMESPACE_BEGIN
 
 #ifdef __KERNEL_CUDA__
 #  define __KERNEL_SHADING__
-#  define __KERNEL_ADV_SHADING__
 #  define __VOLUME__
 #  define __VOLUME_SCATTER__
 #  define __SUBSURFACE__
@@ -132,50 +130,26 @@ CCL_NAMESPACE_BEGIN
 #    define __HAIR__
 #  else
 
-/* keep __KERNEL_ADV_SHADING__ in sync with opencl_kernel_use_advanced_shading! */
+#    define __KERNEL_SHADING__
+#    define __PRINCIPLED__
+#    define __CMJ__
 
 #    ifdef __KERNEL_OPENCL_NVIDIA__
-#      define __KERNEL_SHADING__
-#      define __KERNEL_ADV_SHADING__
 #      define __SUBSURFACE__
-#      define __PRINCIPLED__
 #      define __VOLUME__
 #      define __VOLUME_SCATTER__
 #      define __SHADOW_RECORD_ALL__
-#      define __CMJ__
 #      define __BRANCHED_PATH__
 #    endif  /* __KERNEL_OPENCL_NVIDIA__ */
 
-#    ifdef __KERNEL_OPENCL_APPLE__
-#      define __KERNEL_SHADING__
-#      define __KERNEL_ADV_SHADING__
-#      define __PRINCIPLED__
-#      define __CMJ__
-/* TODO(sergey): Currently experimental section is ignored here,
- * this is because megakernel in device_opencl does not support
- * custom cflags depending on the scene features.
- */
-#    endif  /* __KERNEL_OPENCL_APPLE__ */
-
 #    ifdef __KERNEL_OPENCL_AMD__
-#      define __KERNEL_SHADING__
-#      define __KERNEL_ADV_SHADING__
 #      define __SUBSURFACE__
-#      define __PRINCIPLED__
 #      define __VOLUME__
 #      define __VOLUME_SCATTER__
 #      define __SHADOW_RECORD_ALL__
-#      define __CMJ__
 #      define __BRANCHED_PATH__
 #    endif  /* __KERNEL_OPENCL_AMD__ */
 
-#    ifdef __KERNEL_OPENCL_INTEL_CPU__
-#      define __KERNEL_SHADING__
-#      define __KERNEL_ADV_SHADING__
-#      define __PRINCIPLED__
-#      define __CMJ__
-#    endif  /* __KERNEL_OPENCL_INTEL_CPU__ */
-
 #  endif  /* KERNEL_OPENCL_PREVIEW__ */
 #endif  /* __KERNEL_OPENCL__ */
 
@@ -202,9 +176,6 @@ CCL_NAMESPACE_BEGIN
 #  define __TEXTURES__
 #  define __EXTRA_NODES__
 #  define __HOLDOUT__
-#endif
-
-#ifdef __KERNEL_ADV_SHADING__
 #  define __MULTI_CLOSURE__
 #  define __TRANSPARENT_SHADOWS__
 #  define __PASSES__
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index 3580f4a8eeb..f60fba65599 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -210,8 +210,7 @@ void LightManager::disable_ineffective_light(Device *device, Scene *scene)
 		 * - If we don't need it (no HDRs etc.)
 		 */
 		Shader *shader = (scene->background->shader) ? scene->background->shader : scene->default_background;
-		bool disable_mis = !(has_portal || shader->has_surface_spatial_varying) ||
-		                   !(device->info.advanced_shading);
+		bool disable_mis = !(has_portal || shader->has_surface_spatial_varying);
 		if(disable_mis) {
 			VLOG(1) << "Background MIS has been disabled.\n";
 			foreach(Light *light, scene->lights) {



More information about the Bf-blender-cvs mailing list