Cleanup: remove Cycles advanced shading features toggle.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sat, 16 Mar 2019 15:06:36 +0000 (16:06 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 17 Mar 2019 00:58:39 +0000 (01:58 +0100)
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.

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

index a1202cbbad4ffb706fef9b9d4132d34b1f390964..c595e0364c6754c3f43e2e5e210ac41c18f82168 100644 (file)
@@ -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;
 
index 6f3208e955f18e71ac7af5058b0fdaae9d7e65e1..281681eaf78f93c07a0f5a592e3028106f35b397 100644 (file)
@@ -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;
index 27f091d4188450a367c347be0b347a99d82f6c28..370bc48f9f7ead0bd681582da797b51ce01b1431 100644 (file)
@@ -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;
index a7539d2ac312e9d128e3571cef03ea9e0afcd090..594782f3d1d88f48e46e6e7d75d7aaef3b9af933 100644 (file)
@@ -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;
 
index 91628490b51afb12d248e09ee4ccb3e6c474117e..6736480e95a2a989da9940135f93bd830a1b823c 100644 (file)
@@ -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;
 
index 948fe407f635196f76f385aa4a428a8dfd635ae3..4cefaa217f1b9de2fbf79d8b2008a2ca304e6505 100644 (file)
@@ -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;
index bb507be4c7218986bd608ec60b4ae245646d4a47..a8ad4a935f72770aebca1533c91184ad0ad18114 100644 (file)
@@ -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,
index 920c8dc4e6ae58fe267112e68f4ceb0bb9c2abed..5a1e12af8ab15af991b33702a810e41b8afd4350 100644 (file)
@@ -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)
 {
index 281d9a250473829ee352029549e5541782811462..e0bf9b054ac04a1424493c19e60153cd36834ae6 100644 (file)
@@ -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__
index 3580f4a8eebd9677f9351fd53f35475079fc3f3d..f60fba65599a2e072254c9d5c473ef0cb4547513 100644 (file)
@@ -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) {