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.
This commit is contained in:
Brecht Van Lommel 2019-03-16 16:06:36 +01:00
parent 52a7636c29
commit e17f7af0ce
10 changed files with 4 additions and 62 deletions

@ -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;

@ -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;

@ -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;

@ -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;

@ -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;

@ -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;

@ -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,

@ -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)
{

@ -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__

@ -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) {