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 a1202cb..c595e03 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 6f3208e..281681e 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 27f091d..370bc48 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 a7539d2..594782f 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 9162849..6736480 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 948fe40..4cefaa2 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 bb507be..a8ad4a9 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 920c8dc..5a1e12a 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 281d9a2..e0bf9b0 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 3580f4a..f60fba6 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) {